how to debug when "Segmentation fault"

Maksim Kasimov maksim.kasimov at gmail.com
Wed Oct 5 09:01:42 CEST 2005


yes, to generete core dump is the best way,

but the command "$ ulimit -c 500000" don't make python to generete core dump in the time of crush.

I would like to know how to run python script so if it crushes than core dump will be genereted.

Thanks


Pierre Barbier de Reuille wrote:
> Maksim Kasimov a écrit :
> 
>>Hello,
>>
>>my programm sometime gives "Segmentation fault" message (no matter how
>>long the programm had run (1 day or 2 weeks). And there is nothing in
>>log-files that can points the problem.
>>My question is how it possible to find out where is the problem in the
>>code? Thanks for any help.
>>
>>Python 2.2.3
>>FreeBSD
>>
> 
> 
> Well, your best bet is to generate a core file !
> To do so, in the shell launching the program, you need to accept core
> files. The command is :
> 
> $ ulimit -c <max size of core file accepted>
> 
> For example:
> $ ulimit -c 500000
> 
> For a 500MB max file.
> 
> Then, if your program crash, you should see a file named "core.XXXX"
> where XXXX is the PID of the process. You can know exactly where the
> program crashed using gbd :
> 
> $ gdb --core=core.XXXX
> 
> Then, depending on the debug information you have in your executables
> you may (or may not) be able to know what happened :)
> 
> Pierre


-- 
Best regards,
Maksim Kasimov
mailto: maksim.kasimov at gmail.com



More information about the Python-list mailing list