how to debug when "Segmentation fault"

Maksim Kasimov maksim.kasimov at gmail.com
Wed Oct 5 10:14:42 EDT 2005


looks sad :(

ok, until the decision not found, i've run my script (if someone have the same problem) using sh-script like this:

#!/bin/sh
while true
do
myscript.py
echo "scrip was fault" | mail -s "run.sh" maksim.kasimov at gmail.com
done



... still works ;)


Franz Steinhaeusler wrote:
> Tamer, thanks for your tip.
> 
> I tried Jeff's code:
> 
> import marshal
> f = lambda: None
> code =
> marshal.loads(marshal.dumps(f.func_code).replace('d\0\0S','d\xff\xffS'))
> f.func_code = code
> f()
> 
> saved it as foo.py, than
> 
> C:\Python24\Lib>gdb python
> GNU gdb 5.1.1 (mingw experimental)
> Copyright 2002 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "mingw32"...(no debugging symbols found)...
> (gdb) r foo.py
> Starting program: C:\Python24/python.exe foo.py
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x1e027b23 in ?? ()
> (gdb) bt
> #0  0x1e027b23 in ?? ()
> #1  0x00977240 in ?? ()
> #2  0x1e1a82b8 in ?? ()
> Cannot access memory at address 0x7
> (gdb)
> 
> How can I interpret this results? ;)
> 
> Am I right, that I need a debug build of python built with mingw or
> cygwin in Windows?


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



More information about the Python-list mailing list