[augeas-devel] Out-of-Memory or "Regular expression subtraction 'r1 - r2' failed" ?

David Lutterkort lutter at watzmann.net
Wed Nov 25 02:14:03 UTC 2015


On Sun, Oct 25, 2015 at 1:30 PM, Yclept Nemo <orbisvicis at gmail.com> wrote:

> Hi,
>
> Is this an error on my end, or a hidden out-of-memory failure?
>
>  >>  1 module Test =
>  >>  2     let dqr             = /.*/ - /(.*[^\])?([\]{2})*".*/ -
> /(.*[^\])?[\]([\]{2})*)/
>  >>  3     let t01             = /[a-z]([a-z_]*[a-z])?/
>  >>  4     let t02             = /(true|false)/
>  >>  5     let t03             = /(0|[1-9][0-9]*)/
>  >>  6     let t04             = /(0|[1-9][0-9]*)\.[0-9]+/
>  >>  7     let t05             = /"/ . dqr . /"/
>  >>  8     let t06             = t02 | t03 | t04 | t05
>  >>  9     let t07             = /[ \t]*=[ \t]*/
>  >> 10     let t08             = /[ \t]*#[ \t]*/
>  >> 11     let t09             = t08 . /([^ \t\n].*)?/
>  >> 12     let t10             = t01 . t07 . t06 . t09?
>  >> 13     let t11             = /([^ \t\n].*)?/ - t10
>
>  >> $ augparse test.aug
>  >> ... Failed to compile t11
>  >> ... exception: Regular expression subtraction 'r1 - r2' failed
>
> Tools augparse/augtool fail at 90% RSS - approx. 5500MB of physical memory
> and a large (2-3GB?) swap size. The resulting error message (r1 & r2 in
> text form) is long but only 32kb in size.
>

Unfortunately, the diagnostics aren't all that good there - but since you
are getting an error result back, it's not OOM. The code for regexp_minus
in regexp.c can fail for a number of reasons that aren't expressed well in
that code. One reason why it can blow up with this error is that 'r1 - r2'
does not match anything (i.e., as sets, r1 is a subset of r2) and there's a
comment in the code that we can't write a regular expression that matches
nothing.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20151124/dd2d008a/attachment.htm>


More information about the augeas-devel mailing list