This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: bus error on lib2to3
Type: crash Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Rhamphoryncus, benjamin.peterson, gvanrossum, pitrou
Priority: normal Keywords: patch

Created on 2008-06-14 20:55 by benjamin.peterson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
3114.patch pitrou, 2008-06-14 23:27
test_3114.patch pitrou, 2008-06-14 23:50
3114-better.patch pitrou, 2008-06-15 17:45
Messages (13)
msg68218 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-14 20:55
I was just merging 2to3 work (and you'll have to do svnmerge.py merge in
Lib/lib2to3 for this to work) into py3k and was running the tests when
this rather alarming thing happended:

$ ./python.exe Lib/test/regrtest.py test_lib2to3
...
test test_lib2to3 crashed -- <class 'UnboundLocalError'>: local variable
'result' referenced before assignment
Traceback (most recent call last):
  File "Lib/test/regrtest.py", line 601, in runtest_inner
Bus error

Thinking this had something to do with r64281, I reverted it and got:
test test_lib2to3 crashed -- <class 'UnboundLocalError'>: local variable
'result' referenced before assignment
Fatal Python error: GC object already tracked
Abort trap

This probably isn't a lib2to3 problem, but that's how I got it.
msg68221 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-14 21:27
I have determined that this was caused by r64121.
msg68222 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-14 21:52
I should mention the Bus error happens at test_future_builtins
(lib2to3.tests.test_fixers.Test_filter).
msg68224 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-06-14 23:26
The following patch fixes it, which is somehow a bit scary...
msg68225 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-06-14 23:50
And a test.
msg68226 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-15 00:06
Thanks very much. Committed in r64384.
msg68227 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2008-06-15 00:09
I'm not sure that fix is 100% right - it fixes safety, but not
correctness.  Wouldn't it be more correct to move all 3 into
temporaries, assign from tstate, then XDECREF the temporaries? 
Otherwise you're going to expose just the value or traceback, without a
type set.
msg68229 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2008-06-15 03:28
N.B. Benjamin made a typo in the revision, it's r64284.
msg68232 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-06-15 13:33
Adam is right, we should use three temporaries so that the tstate is
consistent when the former values are DECREf'ed. I'll produce a patch
later today, unless someone beats me to it.
msg68233 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-06-15 13:33
PS: I don't think this is "release blocker" anymore.
msg68244 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-06-15 17:45
Here is a patch against the current py3k, along with a stricter test
(which fails both with the previous patch, and the original unpatched
py3k). I've also checked the svnmerged test_lib2to3 doesn't crash.
msg68249 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2008-06-15 20:06
Looking good.
msg68250 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-15 20:09
done in r64302.
History
Date User Action Args
2022-04-11 14:56:35adminsetgithub: 47364
2008-06-15 20:09:55benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg68250
2008-06-15 20:06:18Rhamphoryncussetmessages: + msg68249
2008-06-15 17:45:48pitrousetfiles: + 3114-better.patch
messages: + msg68244
2008-06-15 13:33:52benjamin.petersonsetpriority: release blocker -> normal
2008-06-15 13:33:31pitrousetmessages: + msg68233
2008-06-15 13:33:04pitrousetmessages: + msg68232
2008-06-15 03:28:45gvanrossumsetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg68229
nosy: + gvanrossum
2008-06-15 00:09:41Rhamphoryncussetnosy: + Rhamphoryncus
messages: + msg68227
2008-06-15 00:06:15benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg68226
2008-06-14 23:50:40pitrousetfiles: + test_3114.patch
messages: + msg68225
2008-06-14 23:27:06pitrousetfiles: + 3114.patch
keywords: + patch
messages: + msg68224
2008-06-14 21:52:27benjamin.petersonsetmessages: + msg68222
2008-06-14 21:27:37benjamin.petersonsetnosy: + pitrou
messages: + msg68221
2008-06-14 20:55:10benjamin.petersoncreate