[Patches] [ python-Patches-580869 ] Fix for seg fault on test_re on mac osx
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 10 Oct 2002 15:38:25 -0700
Patches item #580869, was opened at 2002-07-13 05:15
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=580869&group_id=5470
Category: Tests
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Steven D. Majewski (sdm7g)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: Fix for seg fault on test_re on mac osx
Initial Comment:
import resource
soft, hard = resource.getrlimit(
resource.RLIMIT_STACK )
resource.setrlimit( resource.RLIMIT_STACK, (1024 *
2048, hard))
is the python equivalent of the tcsh 'limit stack 2048'
and will
keep python from seg faulting on test_re .
( maybe wrapped in a "if os.platform == 'darwin' : " --
are there any other systems that have this problem ? )
-- Steve Majewski
----------------------------------------------------------------------
>Comment By: Thomas Wouters (twouters)
Date: 2002-10-11 00:38
Message:
Logged In: YES
user_id=34209
Oh, and the diff is kind of amusing. It seems to be
MacBinary, but 'file' on my Debian machine isn't quite sure:
/home/thomas/regrtest.diff: MacBinary III data with
surprising version number
Fortunately it's still readable :-) I guess I should go back
to "cool with a Macintosh" too.
----------------------------------------------------------------------
Comment By: Thomas Wouters (twouters)
Date: 2002-10-11 00:28
Message:
Logged In: YES
user_id=34209
I'd suggest adding a min(max, <new limit>) to the patch, so
that it becomes:
soft, hard = resource.getrlimit(resource.RLIMIT_STACK)
newsoft = min(hard, max(soft, 1024*2048))
resource.setrlimit(resource.RLIMIT_STACK, newsoft, hard)
And if the test suite only triggers this problem, doesn't it
make more sense in s?re.py, as Fredrik suggested ?
----------------------------------------------------------------------
Comment By: Barry A. Warsaw (bwarsaw)
Date: 2002-10-10 21:05
Message:
Logged In: YES
user_id=12800
I can verify the patch works on 10.1, specifically the OSX
Server in the SF compile farm.
----------------------------------------------------------------------
Comment By: Steven D. Majewski (sdm7g)
Date: 2002-10-10 19:11
Message:
Logged In: YES
user_id=105602
NOT running as root -- I just tried it again and verified
that it
works for me. HOWEVER: I haven't yet upgraded to Jaguar/10.2
Maybe that's the difference ?
I can post a request on the pythonmac list and ask some
others to
try it and find out if it's a 10.1.x vs 10.2 thing. -- Steve
----------------------------------------------------------------------
Comment By: Skip Montanaro (montanaro)
Date: 2002-10-10 18:04
Message:
Logged In: YES
user_id=44345
Sorry for the bogus updates. Opera 6.0 Beta 1 apparently has file
upload problems. Resorting to IE...
----------------------------------------------------------------------
Comment By: Skip Montanaro (montanaro)
Date: 2002-10-10 18:01
Message:
Logged In: YES
user_id=44345
BTW, attached is my diff against regrtest.py.
----------------------------------------------------------------------
Comment By: Skip Montanaro (montanaro)
Date: 2002-10-10 18:01
Message:
Logged In: YES
user_id=44345
BTW, attached is my diff against regrtest.py.
----------------------------------------------------------------------
Comment By: Skip Montanaro (montanaro)
Date: 2002-10-10 18:00
Message:
Logged In: YES
user_id=44345
BTW, attached is my diff against regrtest.py.
----------------------------------------------------------------------
Comment By: Skip Montanaro (montanaro)
Date: 2002-10-10 17:57
Message:
Logged In: YES
user_id=44345
I tried adding the above code to regrtest.py. When I tried to
run python regrtest.py test_re I got a ValueError exception:
"not allowed to raise maximum limit". I have no trouble using
the ulimit builtin command to raise my stack size. Steve,
were you perhaps running as root when you tried this?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=580869&group_id=5470