[Python-bugs-list] [ python-Bugs-546059 ] regex segfault on Mac OS X

noreply@sourceforge.net noreply@sourceforge.net
Thu, 19 Sep 2002 15:07:29 -0700


Bugs item #546059, was opened at 2002-04-19 03:51
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=546059&group_id=5470

Category: Regular Expressions
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Dimitri Papadopoulos (papadopo)
Assigned to: Fredrik Lundh (effbot)
Summary: regex segfault on Mac OS X

Initial Comment:
I attach a Python script and a data file.

Run it this way to reproduce the segfault:
	./bug.py data.txt

I can't reproduce the bug on Solaris or Linux, only Mac
OS X.


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-09-19 15:07

Message:
Logged In: NO 

I also get a lot of segfaults in the re module on Mac OS X.1-2. Example:

md% python
Python 2.2 (#1, 07/14/02, 23:25:09) 
[GCC Apple cpp-precomp 6.14] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
md% cat test.py
import re, urllib
rdf_re = re.compile(r'<rdf:Description\s+about="(?P<about>.*?)"\s+dc:title="(?P<title>.*?)"\s+dc:identifier="(?P<identifier>.*?)".*?/>', re.DOTALL|re.IGNORECASE)
x = urllib.urlopen('http://hit-or-miss.org/projects/trackback/').read()
print re.findall(rdf_re, x)
md% python test.py
Segmentation fault
md% gdb python
GNU gdb 5.1-20020408 (Apple version gdb-228) (Sun Jul 14 10:07:24 GMT 2002)
Copyright 2002 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 "powerpc-apple-macos10".
Reading symbols for shared libraries .... done
(gdb) set args test.py
(gdb) run
Starting program: /usr/bin/python test.py
[Switching to process 1113 thread 0xb03]
Agent pid 439
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
Reading symbols for shared libraries . done

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x0007d8f8 in PyMember_SetOne ()
(gdb) 
(gdb) backtrace
#0  0x0007d8f8 in PyMember_SetOne ()
#1  0x0007e124 in PyMember_SetOne ()
#2  0x0007e124 in PyMember_SetOne ()
#3  0x0007e124 in PyMember_SetOne ()
...
#4065 0x0007e3a8 in PyMember_SetOne ()
#4066 0x00080864 in PyMember_SetOne ()
#4067 0x00045930 in PyObject_Call ()
#4068 0x0005df64 in PyEval_GetFuncDesc ()
#4069 0x0005b1f8 in PyEval_EvalCode ()
#4070 0x0005c634 in PyEval_EvalCodeEx ()
#4071 0x0005db9c in PyEval_GetFuncDesc ()
#4072 0x0005b314 in PyEval_EvalCode ()
#4073 0x0005c634 in PyEval_EvalCodeEx ()
#4074 0x00058a80 in PyEval_EvalCode ()
#4075 0x00027e90 in PyRun_FileExFlags ()
#4076 0x00026ef4 in PyRun_SimpleFileExFlags ()
#4077 0x000069f0 in Py_Main ()
#4078 0x00002970 in start ()
#4079 0x000027f0 in start ()
(gdb) 


----------------------------------------------------------------------

Comment By: Dimitri Papadopoulos (papadopo)
Date: 2002-04-19 05:43

Message:
Logged In: YES 
user_id=52414

I've run the same program with MacPython instead of Python
for Mac OS X from Fink and I now get a "maximum recursion
limit exceeded" so this may be a duplicate of similar bug
reports:
418626
437472
493252
except that I can reproduce this with Python 2.2.


----------------------------------------------------------------------

Comment By: Dimitri Papadopoulos (papadopo)
Date: 2002-04-19 03:53

Message:
Logged In: YES 
user_id=52414

This was reproduced using the Python 2.2 for Mac OS X from
Fink, version (#1 Jan 9, 2002)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=546059&group_id=5470