how to debug when "Segmentation fault"

jepler at unpythonic.net jepler at unpythonic.net
Wed Oct 5 15:51:25 CEST 2005


Interesting.  I'd noticed that the metaclass one didn't crash my 2.2, but I
didn't check the marshal one.

This one core dumps in 'Python 2.2.2 (#1, Feb 24 2003, 19:13:11) ... linux2'
but inexplicably prints 'keys' when I ran it on the 2.4.1 I used in my last
post.

>>> import marshal
>>> f = lambda: None
>>> d = marshal.dumps(f.func_code).replace('\0\0S', '~~S')
>>> f.func_code = marshal.loads(d)
>>> f()

This crashes both my 2.2.2 and 2.4.1:
>>> import marshal
>>> f = lambda: None
>>> d = marshal.dumps(f.func_code).replace('\0\0S', '\xff\xffS')
>>> f.func_code = marshal.loads(d)
>>> f()

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051005/a8450c79/attachment.pgp>


More information about the Python-list mailing list