[TRE-general] segv from /usr/lib/libtre.so.4 (tre-0.7.5)

Ville Laurikari ville at laurikari.net
Sat Jan 6 13:19:15 EET 2007


On Thu, Jan 04, 2007 at 05:36:14PM +0100, Paolo wrote:
> hi,
>
> while testing crm114 (crm114.sf.net) got segv from libtre:
>
> $ gdb --args crm -w 8192 '-{window;isolate (:f:) /QUICKREF.txt/; match (:: :a: :b:) [:f:] /((?.+)^$.{10}).*/; output /:*:a:\n/}'
>
> tarting program: /usr/local/bin/crm-btr -w 8192 -\{window\;isolate\ \(:f:\)\ /QUICKREF.txt/\;\ match\ \(::\ :a:\ :b:\)\ \[:f:\]\ /\(\(\?.+\)\^\$.\{10\}\).\*/\;\ output\ /:\*:a:\\n/\}
>
> Program received signal SIGSEGV, Segmentation fault.

> the guilty RE is '((?.+)^$.{10}).*'

Hmm, well, that does not look like a valid regexp.  The '(?.+)' part
does not go through the parser.  If the intention is to use
non-capturing parentheses, maybe the RE should look like this:

  ((?:.+)^$.{10}).*

So, I would say the bug is in crm114; it seems that it does not check
the regcomp() return value at least in this particular case.


--
http://www.iki.fi/vl/


More information about the TRE-general mailing list