[vox-tech] Mystery Segmentation Faults: grep and sed

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Tue Dec 28 11:55:03 PST 2004


On Tue, 28 Dec 2004, Peter Jay Salzman wrote:

> On Tue 28 Dec 04, 11:59 AM, Dylan Beaudette <dylan at iici.no-ip.org> said:
> > Good morning!
> > 
> > Last night all was well with my G4 powerbook, even after a rather large
> > number of updates from and apt-get update && apt-get upgrade.
> > 
> > However, this morning, I noticed some strange segmentation faults when the
> > machine was starting. They all seemed to be happening after a sed command
> > was issued. I tried manually using sed and grep, and both now seem to be
> > giving segementation faults!
> > 
> > here is a quick example with the output of strace included:
> > 
> > --------------------snip----------------------
> > dylan at pbg4:~$ echo "food" | grep -i food
> > Segmentation fault
> > 
> > dylan at pbg4:~$ strace echo "food" | grep -i food

[ ...snippage... ]

> > -----------------------snip-----------------------
>  
> Hi Dylan,
> 
> I don't believe this isn't the actual segfault.  I think you want to do:
> 
>    strace -ff -s"99" foo | bar

Seems to me like:

  echo "food" | strace grep -i food

would be more informative.  The pipe is implemented by the shell before
either the producer or consumer commands are invoked, so the "-ff" option 
only applies to commands invoked by strace, not the ones invoked by the
shell after the pipe symbol.

[...]

> If you can stomach the traffic, debian-user is, IMHO the best general
> technical mailing list on the net.  In its heyday, I thought vox-tech was
> nearly as good (but I'm biased...)  :)

"heyday"? :(

Later, Dylan Baudette says:

> on a whim i restarted my machine, and now all is well! i can't really
> explain why that would fix something like that, but i sure am happy to
> have a functioning system back.

I have seen things like this before when basic shared libraries like glibc
or ld.so are upgraded.  Most shared libraries can be replaced by running
"ldconfig" and terminating all processes that use the libraries being
replaced (and restarting them if necessary).  For some libraries, this
approach just isn't practical.  (If someone knows an easy way how to do
this without rebooting, pipe up!)

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------





More information about the vox-tech mailing list