Issue1406

classification
Title: Parsing a simple PEP 342 coroutine crashes Jython 2.5
Type: crash Severity: major
Components: Core Versions: 2.5.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: thobes Nosy List: fwierzbicki, scoder, thobes
Priority: urgent Keywords:

Created on 2009-07-19.14:23:07 by scoder, last changed 2009-07-20.09:45:03 by thobes.

Messages
msg4919 (view) Author: Stefan Behnel (scoder) Date: 2009-07-19.14:23:05
I get reproducible crashes when parsing a simple PEP 342 coroutine in
Jython, e.g.

  def dechunk(target):
      while True:
          for item in (yield):
              target.send(item)

The error is:

java.lang.VerifyError: (class: org/python/pycode/_pyx0, method:
dechunk$1 signature:
(Lorg/python/core/PyFrame;Lorg/python/core/ThreadState;)Lorg/python/core/PyObject;)
Register 3 contains wrong type
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
        at java.lang.Class.getConstructor0(Class.java:2699)
        at java.lang.Class.getConstructor(Class.java:1657)
        at org.python.core.BytecodeLoader.makeCode(BytecodeLoader.java:68)
        at
org.python.compiler.LegacyCompiler$LazyLegacyBundle.loadCode(LegacyCompiler.java:43)
        at org.python.core.CompilerFacade.compile(CompilerFacade.java:34)
        at org.python.core.Py.compile_flags(Py.java:1631)
        at org.python.core.Py.compile_flags(Py.java:1636)
        at org.python.core.Py.compile_flags(Py.java:1646)
        at
org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:166)
        at org.python.util.jython.run(jython.java:229)
        at org.python.util.jython.main(jython.java:117)


This is with Jython 2.5.0 final (and latest SVN) on Linux using SUN's
Java 6:

java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)
msg4920 (view) Author: Stefan Behnel (scoder) Date: 2009-07-19.14:31:20
Same with Sun JRE 1.5.0.16.
msg4925 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2009-07-19.22:27:16
reproduced. ouch.
msg4926 (view) Author: Tobias Ivarsson (thobes) Date: 2009-07-20.09:30:09
I know what this is, I've fixed similar problems in other places. I'll
get on it right away.

Here is a smaller sample that causes the same problem:

  def err():
      for item in (yield):
          pass
msg4927 (view) Author: Tobias Ivarsson (thobes) Date: 2009-07-20.09:45:02
Fixed in revision 6550.
History
Date User Action Args
2009-07-20 09:45:03thobessetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg4927
2009-07-20 09:30:09thobessetassignee: fwierzbicki -> thobes
messages: + msg4926
nosy: + thobes
2009-07-20 03:39:57fwierzbickisetassignee: fwierzbicki
2009-07-19 22:27:16fwierzbickisetpriority: high -> urgent
resolution: accepted
messages: + msg4925
2009-07-19 22:25:05fwierzbickisetnosy: + fwierzbicki
2009-07-19 20:08:12pjenveysetpriority: high
2009-07-19 14:31:20scodersetmessages: + msg4920
2009-07-19 14:23:22scodersettype: crash
2009-07-19 14:23:07scodercreate