Re: Seg Fault Action!

2008-10-30 Thread Lowell Gilbert
Graham Bentley [EMAIL PROTECTED] 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/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Seg Fault Action!

2008-10-30 Thread Graham Bentley

For one,
make sure your ports are up-to-date with your installed ports tree
before installing more ports.  


Yep, done that :)


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).  


OK will check out truss 


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.


Is that what a core dump is?

Thanks for replies :)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Seg Fault Action!

2008-10-30 Thread Lowell Gilbert
Graham Bentley [EMAIL PROTECTED] writes:

 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.

 Is that what a core dump is?

I actually meant core dump.  Crash dump slipped into my brain from a
somewhat different concept, on a different OS, that I am dealing with
at work.  Sorry.

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
http://be-well.ilk.org/~lowell/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]