Issue222825
Created on 2000-11-18.19:22:09 by bckfnn, last changed 2000-11-26.15:41:51 by bckfnn.
| Messages | |||
|---|---|---|---|
| msg95 (view) | Author: Finn Bock (bckfnn) | Date: 2000-11-18.19:22:09 | |
I am writing a compiler/translator that uses JPython
as a backend. In this application the size of the generated
code gets very large and I have found out that JPython
crashes with the following error under some circumstances:
Traceback (innermost last):
(no code object) at line 0
java.lang.VerifyError: org/python/pycode/_pyx0
at java.lang.ClassLoader.resolveClass(ClassLoader.java)
at org.python.core.BytecodeLoader.loadClassFromBytes(BytecodeLoader.java:77)
at org.python.core.BytecodeLoader.loadBytes(BytecodeLoader.java:92)
at org.python.core.BytecodeLoader.makeCode(BytecodeLoader.java:103)
at org.python.core.Py.compile(Py.java:1366)
at org.python.core.Py.compile(Py.java:1379)
at org.python.core.__builtin__.execfile(__builtin__.java:263)
at org.python.core.__builtin__.execfile(__builtin__.java:275)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:132)
at org.python.util.jpython.main(jpython.java:124)
java.lang.VerifyError: java.lang.VerifyError: org/python/pycode/_pyx0
Please note that this is not a problem for me anymore because
I have rewritten my code in such a way that the problem
dissappear but I think it is a good thing for you to know
that there seems to be a problem when the code size gets big
in JPython.
Basically what I did was to change calls like this:
add_output_values(("EbcIo",EbcIo))
into:
add_output_values("EbcIo",EbcIo)
and then the problem is not there anymore.
If you remove some of the calls to add_output_values the problem
also goes away.
I have confirmed this problem under Solaris JDK 1.1.5 and Win NT JDK 1.2.1.
Here is the code that gives me the problem. It is very large but
since this problem probably has with the size to do I have chosed
to post it anyway:
---- Cut here -------------------------------------------------------------
from math import *
from runtime import *
import sys
# Dynamic declarations
file_counter = 0
while 1:
try:
AGC_Compensation = StaticExpression(1)
except ZeroDivisionError:
ErrorHandler.error('Division by zero while evaluating variable
"AGC_Compensation"',142)
except OverflowError:
ErrorHandler.error('Numerical overflow while evaluating variable
"AGC_Compensation"',142)
except IndexError:
ErrorHandler.error('Array subscript out of bounds while evaluating variable
"AGC_Compensation"',142)
except NameError:
ErrorHandler.error('Undeclared function found while evaluating variable
"AGC_Compensation"',142)
try:
Transmission_Time_Interval = StaticExpression(20)
except ZeroDivisionError:
ErrorHandler.error('Division by zero while evaluating variable
"Transmission_Time_Interval"',227)
except OverflowError:
ErrorHandler.error('Numerical overflow while evaluating variable
"Transmission_Time_Interval"',227)
except IndexError:
ErrorHandler.error('Array subscript out of bounds while evaluating variable
"Transmission_Time_Interval"',227)
except NameError:
ErrorHandler.error('Undeclared function found while evaluating variable
"Transmission_Time_Interval"',227)
try:
Nrof_Coded_Bits_To_Start_Up = StaticExpression(2)
if Transmission_Time_Interval.currValue()>20:
Nrof_Coded_Bits_To_Start_Up =
StaticExpression(int(ceil(Transmission_Time_Interval.currValue()/10)))
except ZeroDivisionError:
ErrorHandler.error('Division by zero while evaluating variable
"Nrof_Coded_Bits_To_Start_Up"',471)
except OverflowError:
ErrorHandler.error('Numerical overflow while evaluating variable
"Nrof_Coded_Bits_To_Start_Up"',471)
except IndexError:
ErrorHandler.error('Array subscript out of bounds while evaluating variable
"Nrof_Coded_Bits_To_Start_Up"',471)
except NameError:
ErrorHandler.error('Undeclared function found while evaluating variable
"Nrof_Coded_Bits_To_Start_Up"',471)
try:
AGC_sigma2ref = StaticExpression(35)
except ZeroDivisionError:
ErrorHandler.error('Division by zero while evaluating variable
"AGC_sigma2ref"',150)
except OverflowError:
ErrorHandler.error('Numerical overflow while evaluating variable
"AGC_sigma2ref"',150)
except IndexError:
ErrorHandler.error('Array subscript out of bounds while evaluating variable
"AGC_sigma2ref"',150)
except NameError:
ErrorHandler.error('Undeclared function found while evaluating variable
"AGC_sigma2ref"',150)
try:
Nrof_CRC_Parity_Bits = StaticExpression(16)
except ZeroDivisionError:
ErrorHandler.error('Division by zero while evaluating variable
"Nrof_CRC_Parity_Bits"',259)
except OverflowError:
ErrorHandler.error('Numerical overflow while evaluating variable
"Nrof_CRC_Parity_Bits"',259)
except IndexError:
ErrorHandler.error('Array subscript out of bounds while evaluating variable
"Nrof_CRC_Parity_Bits"',259)
except NameError:
ErrorHandler.error('Undeclared function found while evaluating variable
"Nrof_CR
|
|||
| msg96 (view) | Author: Finn Bock (bckfnn) | Date: 2000-11-26.15:41:51 | |
There are natural upper limites for the size of code objects, namely the limites of the JVM. Each code object becomes one java method and each python module becomes one java class. The limites that exists for java class and java methods also exists for jython. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2000-11-18 19:22:09 | bckfnn | create | |
Supported by Python Software Foundation,
Powered by Roundup