help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Program termination


From: M Atakan Gurkan
Subject: Re: [Help-gsl] Program termination
Date: Thu, 25 Dec 2003 03:13:38 -0600
User-agent: Mutt/1.2.5.1i

On Wed, Dec 24, 2003 at 10:35:17PM +0530, Nomesh Bolia wrote:
> Either: "Segmentation fault"
> 
> Or: "Killed"
> 
> Could somebody throw some light on the cause of this behaviour? And, 
> possible ways to improve the same? 
> 
> Eagerly looking to some ideas,
Hi,
If you are using a GNU or Unix system, you can use "-g" option to compiler
and run your code with the debugger. If you are using gcc, use gdb. I might
be hard to do everything but it is simple to get an idea. For example if you
are running your code as:
./foo bar1 bar2
use:
gdb ./foo
and once it launches, use:
run bar1 bar2
it will stop at the segmentation fault and you can get a backtrace with "bt"
and check the values of variables with "p". Check the gdb manual for
details. You might also want to use Electric Fence to make sure you
get the seg fault at the right moment. But if you are allocating and freeing
a lot of pieces of memory then efence might not be a good idea.

good luck,

ato




reply via email to

[Prev in Thread] Current Thread [Next in Thread]