Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Oct 2008 09:34:25 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        admin@cpcnw.co.uk
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Seg Fault Action!
Message-ID:  <44y706qk9q.fsf@be-well.ilk.org>
In-Reply-To: <op.ujqaapi3t4j7n6@3bsd.cpcnw.co.uk> (Graham Bentley's message of "Tue\, 28 Oct 2008 09\:36\:15 -0000")
References:  <20081027184022.14D9D10656C1@hub.freebsd.org> <op.ujqaapi3t4j7n6@3bsd.cpcnw.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
"Graham Bentley" <admin@cpcnw.co.uk> writes:

> I have often wondered what to do if I compile a port and
> immediatly after trying to run it I get a seg fault.
>
> In the past I have just tried to find an alternative port
> that did the same job, but it has always felt as though I
> wasnt trying hard enough.
>
> Yesterday after upgrading all my ports tree I decided to
> get printing working and cups / HP stuff all works fine
> as does the web gui to cups so I decided to try and
> make xpp.
>
> The result is 'Segmentation Fault' - thats it!
>
> How do I go about finding out what caused it and how to
> get the program running?
>
> Any tips etc appreciated!

Segmentation fault means (roughly) accessing a region of memory that
hadn't even been mapped into that process.  Generally you need some
software debugging skills to go after these problems directly.

There are some less direct steps you can take that can help.  For one,
make sure your ports are up-to-date with your installed ports tree
before installing more ports.  You can run the program under truss(1),
which will help you figure out what kind of bad data is being passed
to system calls (assuming that's where the failure is, but it's not
unusual for that to be the case).  You can generate a crash dump of
the program, and (you or someone else) can use a debugger to see where
it was when it failed -- usually a strong hint.

And of course, asking for help in figuring out a specific problem is
an option as well.  I'd look at xpp, but at the moment my machines
with the ports collection installed are powered down...

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
		http://be-well.ilk.org/~lowell/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44y706qk9q.fsf>