[BusyBox] Segfault in sed during binutils build.

Glenn McGrath bug1 at optushome.com.au
Mon Sep 15 10:18:58 UTC 2003


On Mon, 15 Sep 2003 04:49:29 -0400
Rob Landley <rob at landley.net> wrote:

> On Sunday 14 September 2003 22:04, Glenn McGrath wrote:

> > One particular rathole i dont want to go back down, is the sed
> > newline hack that i put in which is required to parse any configure
> > script. (The line numbering part)
> 
> I'll look at it more closely later in the week (I've just gone back to
> grad school, and monday and tuesday contain the majority of my course
> load; I'm in class until about 8 pm both days).
> 
> But my itch is getting busybox and uclibc to work together, hence...

Im afraid all my "fixes" have broken the configure scripts that were
working :(

Trying to reverse the damage now.

> > If i remember correctly using a newline character isnt supported in
> > libc's regex's, the hack i did is to convert '\n' into "\\n" and
> > back.
> 
> Working around deficiencies in glibc doesn't interest me much, and
> adding newline match target support to uclibc (maybe with yet another
> flag to the regex thing to activate it, I dunno I haven't looked at
> it) sounds like a cleaner solution for my particular needs. :)
> 
> > I suspect its breaking some scripts that have a "\\n" in their
> > regex, i was just happy i had something that worked, didnt look for
> > a better solution.
> 
> Um, according to the standard, the pattern space is just one line,
> right?  So the newline can only _be_ at the end, so this is a synonym
> for one of those begin/end matching characters ($, I think...)  Or am
> I misunderstanding?  (Keep in mind it's almost 4 am my time...)

The pattern space is read one line at a time, lines can to the pattern
space with a seperating '\n'. e.g. N or H commands.

I added a test to the testsuite that demonstrates the problem,
testsuite/sed/sed-regex-match-newline

I dont know if its a bug in glibc/uclibc or if sed and the libc's
implement different standards of behaviour as far as regex's go.


Glenn



More information about the busybox mailing list