Author pitrou
Recipients Mark.Shannon, pitrou
Date 2014-10-16.12:21:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413462074.66.0.621604261793.issue22653@psf.upfronthosting.co.za>
In-reply-to
Content
I got a weird crash in an interpreter session. Here is what I did:

$ ./python 
Python 3.5.0a0 (default:fd658692db3a+, Oct 15 2014, 23:13:43) 
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open('toto', 'ab')
>>> f.write(b'bb')
2
>>> f.flush()
>>> 
>>> f = open('toto', 'ab')
__main__:1: ResourceWarning: unclosed file <_io.BufferedWriter name='toto'>
python: Objects/dictobject.c:855: insertdict: Assertion `ep->me_key != ((void *)0) && ep->me_key != (&_dummy_struct)' failed.
Abandon (core dumped)


Here are the inner frames of the traceback:

(gdb) bt
#0  0x00007f27e691df77 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007f27e69215e8 in __GI_abort () at abort.c:90
#2  0x00007f27e6916d43 in __assert_fail_base (fmt=0x7f27e6a6df58 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x6878d0 "ep->me_key != ((void *)0) && ep->me_key != (&_dummy_struct)", file=file@entry=0x6874f2 "Objects/dictobject.c", 
    line=line@entry=855, function=function@entry=0x6880a0 <__PRETTY_FUNCTION__.10152> "insertdict") at assert.c:92
#3  0x00007f27e6916df2 in __GI___assert_fail (assertion=0x6878d0 "ep->me_key != ((void *)0) && ep->me_key != (&_dummy_struct)", 
    file=0x6874f2 "Objects/dictobject.c", line=855, function=0x6880a0 <__PRETTY_FUNCTION__.10152> "insertdict") at assert.c:101
#4  0x00000000004b65d0 in insertdict (mp=0x7f27e76f9838, key='f', hash=-9123380860235530973, value=<_io.BufferedWriter at remote 0x7f27e766e758>)
    at Objects/dictobject.c:855
#5  0x00000000004b752a in PyDict_SetItem (
    op={'f': <_io.BufferedWriter at remote 0x7f27e766e758>, '__builtins__': <module at remote 0x7f27e7750358>, '__spec__': None, '__warningregistry__': {'version': 0}, '__doc__': None, 'rlcompleter': <module at remote 0x7f27e5f0b358>, '__name__': '__main__', '__cached__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/home/antoine/.pythonrc.py') at remote 0x7f27e765d468>, 'readline': <module at remote 0x7f27e5f0b058>}, 
    key='f', value=<_io.BufferedWriter at remote 0x7f27e766e758>) at Objects/dictobject.c:1245
#6  0x00000000005a9f7c in PyEval_EvalFrameEx (f=Frame 0x7f27e7704d78, for file <stdin>, line 1, in <module> (), throwflag=0) at Python/ceval.c:2065


Here are the hash initialization values:

(gdb) p _Py_HashSecret
$1 = {uc = "\260\306\vA\a\342\274\337\341\026\003\bbq\366\f\"\032E\232jb%\023", fnv = {prefix = -2324734786846079312, suffix = 934058638581110497}, 
  siphash = {k0 = 16122009286863472304, k1 = 934058638581110497}, djbx33a = {padding = "\260\306\vA\a\342\274\337\341\026\003\bbq\366\f", 
    suffix = 1379617070853200418}, expat = {padding = "\260\306\vA\a\342\274\337\341\026\003\bbq\366\f", hashsalt = 1379617070853200418}}
(gdb) p PyHash_Func
$2 = {hash = 0x5ee557 <siphash24>, name = 0x6b2020 "siphash24", hash_bits = 64, seed_bits = 128}


The crash seems difficult to reproduce simply by typing the lines above. Perhaps by forcing the hash initialization values as above.
History
Date User Action Args
2014-10-16 12:21:14pitrousetrecipients: + pitrou, Mark.Shannon
2014-10-16 12:21:14pitrousetmessageid: <1413462074.66.0.621604261793.issue22653@psf.upfronthosting.co.za>
2014-10-16 12:21:14pitroulinkissue22653 messages
2014-10-16 12:21:13pitroucreate