[New-bugs-announce] [issue3537] dict creation failure causes crash

Roger Upole report at bugs.python.org
Sun Aug 10 20:10:24 CEST 2008


New submission from Roger Upole <rupole at hotmail.com>:

If the first item can't be inserted the interpreter will crash 
eventually.

while 1:
	try:
		d = { 'a':a,
		  'b':'b',
		  'c':'c',
		  'd':'d',
		  'e':'e',
		  'f':'f',
		  'g':'g',
		  'h':'h',
		  'i':'i',
		  'j':'j',
		  'k':'k',
		  'l':'l',
		  'm':'m',
		  'n':'n',
		  'o':'o'
		  }
	except:
		pass

As best I can tell, this only happens for the first item.
In a debug build, this assert fails on the second time thru
the loop (dictobject.c, line 247):
		assert (mp->ma_table == mp->ma_smalltable);

Apparently something is leaving one of the entries in the list
of preallocated dict objects in an inconsistent state.

----------
messages: 70990
nosy: rupole
severity: normal
status: open
title: dict creation failure causes crash
versions: Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3537>
_______________________________________


More information about the New-bugs-announce mailing list