classification
Title: crash in expat when compiling with --enable-profiling
Type: crash Stage: test needed
Components: XML Versions: Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, ezio.melotti, ronaldoussoren
Priority: low Keywords:

Created on 2006-06-07 20:58 by ronaldoussoren, last changed 2010-08-22 10:34 by BreamoreBoy. This issue is now closed.

Messages (4)
msg60928 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2006-06-07 20:58
On MacOSX 10.4.6, Xcode 2.3 (but appearently also on earlier versions 
of Xcode) the script below causes a segmentation fault in expat when 
python is compiled with --enable-profiling.

The script (to be run from the root of the python source tree)

import plistlib

p = plistlib.PlistParser()
print p.parse(open('Mac/scripts/BuildApplet.plist'))


The gdb session:

$ gdb ./python.exe 
GNU gdb 6.3.50-20050815 (Apple version gdb-477) (Sun Apr 30 
20:01:44 GMT 2006)
Copyright 2004 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 "i386-apple-darwin"...Reading symbols for 
shared libraries .. done

(gdb) r t.py
Starting program: /Users/ronald/Python/python-trunk/build/
python.exe t.py
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000004
0x01320285 in poolGrow (pool=0x600270) at /Users/ronald/Python/
python-trunk/Modules/expat/xmlparse.c:6018
6018        pool->blocks = (BLOCK *)
(gdb) 

and backtrace:

(gdb) where
#0  0x01320285 in poolGrow (pool=0x600270) at /Users/ronald/
Python/python-trunk/Modules/expat/xmlparse.c:6018
#1  0x0132772f in doProlog (parser=0x620640, enc=0x1345760, 
s=0x185503e "\"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://
www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0
\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n
\t<string>English</string>\n\t<key>CFBundleDocu"..., 
end=0x1855652 "", tok=12, next=0x1855064 " \"http://
www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0
\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n
\t<string>English</string>\n\t<key>CFBundleDocumentTypes</
key>\n\t<array>\n\t\t<dict>\n\t\t\t<"..., nextPtr=0x620658, 
haveMore=1 '\001') at /Users/ronald/Python/python-trunk/Modules/
expat/xmlparse.c:5935
#2  0x0132d5a5 in prologInitProcessor (parser=0x620640, 
s=0x1855000 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!
DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" 
\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist 
version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelo"..., 
end=0x1855652 "", nextPtr=0x620658) at /Users/ronald/Python/
python-trunk/Modules/expat/xmlparse.c:3551
#3  0x0131f7c4 in XML_ParseBuffer (parser=0x620640, len=1618, 
isFinal=0) at /Users/ronald/Python/python-trunk/Modules/expat/
xmlparse.c:1562
#4  0x01319bb2 in xmlparse_ParseFile (self=0x129efa8, 
f=0x12991d0) at /Users/ronald/Python/python-trunk/Modules/
pyexpat.c:1025
#5  0x0006de12 in PyEval_EvalFrameEx (f=0x6219c0, throwflag=0) 
at ../Python/ceval.c:3553
#6  0x0006df07 in PyEval_EvalFrameEx (f=0x61a860, throwflag=0) 
at ../Python/ceval.c:3650
#7  0x0006e71a in PyEval_EvalCodeEx (co=0x1298380, 
globals=0x1241ae0, locals=0x1241ae0, args=0x0, argcount=0, 
kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../
Python/ceval.c:2832
#8  0x0006e8d9 in PyEval_EvalCode (co=0x1298380, 
globals=0x1241ae0, locals=0x1241ae0) at ../Python/ceval.c:494
#9  0x00091f2f in PyRun_FileExFlags (fp=0xa000bd00, 
filename=0xbffffbb7 "t.py", start=257, globals=0x1241ae0, 
locals=0x1241ae0, closeit=1, flags=0xbffffa7c) at ../Python/
pythonrun.c:1230
#10 0x00092300 in PyRun_SimpleFileExFlags (fp=0xa000bd00, 
filename=0xbffffbb7 "t.py", closeit=1, flags=0xbffffa7c) at ../Python/
pythonrun.c:854
#11 0x00005b6f in Py_Main (argc=1, argv=0xbffffb00) at ../Modules/
main.c:494
#12 0x000023c5 in _start (argc=2, argv=0xbffffb00, envp=0xbffffb0c) 
at /SourceCache/Csu/Csu-58.1.1/crt.c:272
#13 0x000022cd in start ()


msg89800 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-06-29 00:07
I got this warning compiling Python3.1:
/home/wolf/Python-3.1/Modules/expat/xmlparse.c: In function ‘doProlog’:
/home/wolf/Python-3.1/Modules/expat/xmlparse.c:3771: warning: passing
argument 1 of ‘normalizePublicId’ discards qualifiers from pointer
target type

I don't know if it's in any way related to this problem, but I found
this issue while searching for 'doProlog' and 'xmlparse'.
msg92323 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-09-06 14:30
This is no longer a problem with 2.6.x from SVN and Xcode 3.2 (on OSX 
10.6). I haven't tested if the problem is still present on other versions 
of OSX, but I'd say it is pretty safe to assume that this was a toolchain 
problem.
msg114667 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-22 10:34
Closed in reply to msg92323.
History
Date User Action Args
2010-08-22 10:34:53BreamoreBoysetstatus: open -> closed

nosy: + BreamoreBoy
messages: + msg114667

resolution: out of date
2009-09-06 14:30:28ronaldoussorensetmessages: + msg92323
2009-06-29 00:07:36ezio.melottisetnosy: + ezio.melotti
messages: + msg89800
2009-03-21 03:40:03ajaksu2setstage: test needed
type: crash
versions: + Python 2.6, - Python 2.5
2006-06-07 20:58:36ronaldoussorencreate