RE: [Python-Dev] FW: regarding the Python Developer posting...
[about the big switch in unicodectype.c]
[Tim: use the current CVS tree instead... code's been replace...]
duh! gotta read them archives before seeing following up on an request... can't trust the hyper-active Python development team with a code freeze.... <wink> I'm happy to report that it now compiles correctly without a -traditional-cpp flag. Unfortuantely, test_re.py now seg faults.... which is caused by test_sre.py... in particular the following: src/Lib/test/test_sre.py if verbose: print 'Test engine limitations' # Try nasty case that overflows the straightforward recursive # implementation of repeated groups. #test(r"""sre.match(r'(x)*', 50000*'x').span()""", # (0, 50000), RuntimeError) #test(r"""sre.match(r'(x)*y', 50000*'x'+'y').span()""", # (0, 50001), RuntimeError) #test(r"""sre.match(r'(x)*?y', 50000*'x'+'y').span()""", # (0, 50001), RuntimeError) test_unicodedata fails... same endian problem as SGI... test_format fails... looks like a problem with the underlying C code. Here's the config instructions for Mac OS X Public Beta: Building Python 2.0b1 + CVS 9/26/2000 Dan Wolfe ./configure -with-threads -with-dyld -with-suffix=.exe change in src/config.h: /* Define if you have POSIX threads */ #define _POSIX_THREADS 1 to /* #define _POSIX_THREADS 1 */ change in src/Makefile # Compiler options passed to subordinate makes OPT= -g -O2 -OPT:Olimit=0 to OPT= -g -O2 comment out the following in src/Lib/test/test_sre.py if verbose: print 'Test engine limitations' # Try nasty case that overflows the straightforward recursive # implementation of repeated groups. #test(r"""sre.match(r'(x)*', 50000*'x').span()""", # (0, 50000), RuntimeError) #test(r"""sre.match(r'(x)*y', 50000*'x'+'y').span()""", # (0, 50001), RuntimeError) #test(r"""sre.match(r'(x)*?y', 50000*'x'+'y').span()""", # (0, 50001), RuntimeError) After install, manually go into /usr/local/bin strip the .exe off the installed files. - Dan
dan wrote:
[Tim: use the current CVS tree instead... code's been replace...]
duh! gotta read them archives before seeing following up on an request... can't trust the hyper-active Python development team with a code freeze.... <wink>
heh. your bug report was the main reason for getting this change into 2.0b2, and we completely forgot to tell you about it...
Unfortuantely, test_re.py now seg faults.... which is caused by test_sre.py... in particular the following:
src/Lib/test/test_sre.py
if verbose: print 'Test engine limitations'
# Try nasty case that overflows the straightforward recursive # implementation of repeated groups. #test(r"""sre.match(r'(x)*', 50000*'x').span()""", # (0, 50000), RuntimeError) #test(r"""sre.match(r'(x)*y', 50000*'x'+'y').span()""", # (0, 50001), RuntimeError) #test(r"""sre.match(r'(x)*?y', 50000*'x'+'y').span()""", # (0, 50001), RuntimeError)
umm. I assume it bombs if you uncomment those lines, right? you could try adding a Mac OS clause to the recursion limit stuff in Modules/_sre.c: #if !defined(USE_STACKCHECK) #if defined(...whatever's needed to detect Max OS X...) #define USE_RECURSION_LIMIT 5000 #elif defined(MS_WIN64) || defined(__LP64__) || defined(_LP64) /* require smaller recursion limit for a number of 64-bit platforms: Win64 (MS_WIN64), Linux64 (__LP64__), Monterey (64-bit AIX) (_LP64) */ /* FIXME: maybe the limit should be 40000 / sizeof(void*) ? */ #define USE_RECURSION_LIMIT 7500 #else #define USE_RECURSION_LIMIT 10000 #endif #endif replace "...whatever...", and try larger values than 5000 (or smaller, if necessary. 10000 is clearly too large for your platform). (alternatively, you can increase the stack size. maybe it's very small by default?) </F>
participants (2)
-
Dan Wolfe
-
Fredrik Lundh