[New-bugs-announce] [issue14354] Crash in _ctypes_alloc_callback

Joe Rumsey report at bugs.python.org
Sat Mar 17 21:55:44 CET 2012

New submission from Joe Rumsey <python at rumsey.org>:

I have reproduced this crash in Apple's default 2.7.1 python, and in 2.7.3 built from source myself.  But only in release mode.  If I rebuild 2.7.3 in debug, the crash goes away.

The attached file reproduces the issue, which has to do with a union containing multiple structs being used as a value for a callback argument.  I've stripped it down as much as I can.  Removing any fields from either the union or the Dice struct will cause this to no longer crash.

The original source of this is libtcod's python wrapper library, which seems to work fine on platforms other than Mac, though it had a lot of other problems on 64-bit systems before I got to this one.  This issue may also be more 64-bit specific than Mac specific.

This is the callstack from Apple's python:

#0  0x00000001010c7712 in _ctypes_alloc_callback ()
#1  0x00000001010c4a1c in PyCData_AtAddress ()
#2  0x0000000100050afa in icu::DigitList::getDouble ()
#3  0x000000010000bd32 in PyObject_Call ()
#4  0x000000010008bf63 in ubrk_swap ()
#5  0x000000010008ecd8 in triedict_swap ()
#6  0x000000010008ed4d in triedict_swap ()
#7  0x00000001000a608f in ucnv_openStandardNames ()
#8  0x00000001000a614f in ucnv_openStandardNames ()
#9  0x00000001000a72a2 in ucnv_getUnicodeSet ()
#10 0x00000001000b72af in ucnv_getDisplayName ()
#11 0x0000000100000e88 in ?? ()

assignee: ronaldoussoren
components: Macintosh, ctypes
files: testctypes.py
messages: 156205
nosy: ogre, ronaldoussoren
priority: normal
severity: normal
status: open
title: Crash in _ctypes_alloc_callback
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file24919/testctypes.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list