Issue589148

classification
Title: Syntax error -> jython infinite loop
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: pedronis Nosy List: p2sam, pedronis, thorstein
Priority: normal Keywords:

Created on 2002-07-31.15:01:38 by thorstein, last changed 2003-07-12.00:31:52 by pedronis.

Messages
msg698 (view) Author: Thorstein Thorsteinsson (thorstein) Date: 2002-07-31.15:01:38
The following ex.py:
------------------
a = 1
if a = 1:
    print "Success!"
------------------
leads to an infinite loop somewhere in the Jython
interpreter. This only happens when the code is
executed non-interactively, an interactive session
correctly signals the syntax error in line 2.

Output from jython -v ex.py
----------------------------------------
jython -v ex.py 
import: 'exceptions' as org.python.core.exceptions 
in builtin modules
import: 'site' as /home/tthorste/jython-
2.1/Lib/site$py.class
import: 'sys' as sys in builtin modules
import: 'os' as org.python.modules.os in builtin 
modules
import: 'javaos' as /home/tthorste/jython-
2.1/Lib/javaos$py.class
import: 'java' as java package
import: 'File' as java class
import: 'BufferedReader' as java class
import: 'InputStreamReader' as java class
import: 'IOException' as java class
import: 'javapath' as /home/tthorste/jython-
2.1/Lib/javapath$py.class
import: 'System' as java class
import: 'UserDict' as /home/tthorste/jython-
2.1/Lib/UserDict$py.class
import: 'string' as /home/tthorste/jython-
2.1/Lib/string$py.class
import: 'strop' not found (=> ImportError)
import: 're' as /home/tthorste/jython-
2.1/Lib/re$py.class
import: 'sre' as /home/tthorste/jython-
2.1/Lib/sre$py.class
import: 'sre_compile' as /home/tthorste/jython-
2.1/Lib/sre_compile$py.class
import: '_sre' as org.python.modules._sre in builtin 
modules
import: 'sre_constants' as /home/tthorste/jython-
2.1/Lib/sre_constants$py.class
import: 'sre_parse' as /home/tthorste/jython-
2.1/Lib/sre_parse$py.class
import: 'copy_reg' as /home/tthorste/jython-
2.1/Lib/copy_reg$py.class
import: 'types' as org.python.modules.types in 
builtin modules
import: 'thread' as org.python.modules.thread in 
builtin modules
import: 'sitecustomize' not found (=> ImportError)
----------------------------------------
then jython hangs, using lots of CPU:
> ps -ef | grep java
... /usr/java1.2/jre/bin/../bin/sparc/native_threads
/java -Dpython.home=/home/...
----------------------------------------
I'm running on Solaris 2.8 with jre 1.2 version 2.1 of
Jython.

> jython --version
Jython 2.1 on java (JIT: sunwjit)
>

(Jython downloaded on July 15th.)
----------------------------------------

But thanks for doing a great job.
Thorstein
msg699 (view) Author: Thorstein Thorsteinsson (thorstein) Date: 2002-07-31.15:03:59
Logged In: YES 
user_id=587322

Note that my line 3 in ex.py was indented, but that
got lost in SourceForge's translation.
Thorstein
msg700 (view) Author: Thorstein Thorsteinsson (thorstein) Date: 2002-07-31.15:28:40
Logged In: YES 
user_id=587322

This piece of code behaves similarly:
--------------
def a(b,c): pass

a(1), 2)
--------------
leading to an infinite loop in Jython. Again running
interactively correctly diagnoses the error on line 3.

Thorstein
msg701 (view) Author: Pedro Sam (p2sam) Date: 2003-04-25.12:26:13
Logged In: YES 
user_id=72446

I am unable to reproduce this bug using:

Jython 2.1
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
Linux-2.4.20

import: 'types' as org.python.modules.types in builtin modules
import: 'thread' as org.python.modules.thread in builtin modules
import: 'sitecustomize' not found (=> ImportError)
Traceback (innermost last):
  (no code object) at line 0
  File "ex.py", line 2
        a( 1 ), 2 )
                  ^
SyntaxError: invalid syntax
msg702 (view) Author: Samuele Pedroni (pedronis) Date: 2003-07-12.00:31:52
Logged In: YES 
user_id=61408

I'm unable to reproduce the problem.
History
Date User Action Args
2002-07-31 15:01:38thorsteincreate