Linux segmentation fault message

Matt Graham danceswithcrows at usa.net
Sat Jun 22 12:26:08 MST 2013


>> 'qsearch' works fine on my local computers, but when I try to run it
>> on my web host I see this error message:
>> ~(location) line 6: 26955 Done
>>        fgrep -y "$name1" q-hid
>>      26956 Segmentation fault | fgrep -y "$name2" > tempz
From: "Carruth, Rusty"
> you left off the first line:
> #!/bin/bash

True, but it should've died immediately if it couldn't find the interpreter,
not a few lines down.

Is this a shared server, or a VPS?  I ask mostly because a long long time ago,
I had a little C program that malloc()ed an array, filled it with random
numbers, and ran a set of tests on it.  This program always segfaulted after a
few iterations when run on the shared Solaris machines.  On my home box, it
always ran to completion.  Same C, same gcc invocation.  The only thing that
made any sense was that the little program was consuming too much RAM or CPU
and getting sent a SIGSEGV by whatever "prevent runaway user processes from
eating everything" system they had set up.  Using nice on it didn't seem to
help, and I was malloc()ing a few hundred K at most.

Also also, -y is obsolete (replaced by -i), and fgrep == grep -F , and I don't
think you actually need -F if you're using the shell's builtin read function
since you're only getting 1 string not a series of strings separated by \n. 
Those things shouldn't cause segfaults though.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see



More information about the PLUG-discuss mailing list