[ grinder-Bugs-2936167 ] Script execution hangs when using jython 2.5.1 and windows

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.grinder.devel
Message-ID <[email protected]>
Bugs item #2936167, was opened at 2010-01-21 09:32
Message generated for change (Comment added) made by philipa
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=2936167&group_id=18598

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core engine
Group: None
Status: Open
Resolution: None
Priority: 7
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Philip Aston (philipa)
Summary: Script execution hangs when using jython 2.5.1 and windows

Initial Comment:
When adding jython into the classpath of the agent the process hangs and will only repsond to ctrl-c

The script then continue to run.

----------------------------------------------------------------------

>Comment By: Philip Aston (philipa)
Date: 2010-02-22 20:29

Message:
[Discussion about the first test case]

Phil,
Not what you wanted to hear, but it did not hang up on my Windows 2003
box. See output below, along with jython and java version stamps. Also note
that I am only having problems on my Windows 2003 box that I have to run
the agent on (unfortunately). I have not had any issues on Windows XP or
Windows 7 while developing my grinder test script.

C:\Temp\mark\grinder-test>java -cp test.jar;jython.jar test.Parent
[parent] Starting [java, -classpath, test.jar;jython.jar, test.Child]
[parent] Waiting
[child] Initializing Jython
[child] Executing Jython
Hello world
[child] Done
[parent] Done, process exit code: 0

C:\Temp\mark\grinder-test>java -jar jython.jar --version
Jython 2.5.1


C:\Temp\mark\grinder-test>java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

Mark

-----Original Message-----
From: Philip Aston [mailto:[email protected]] 
Sent: Monday, February 22, 2010 1:45 AM
To: grinder-use
Subject: Re: [Grinder-use] Grinder 3.3 and jython 2.5.1

Mark,

I've attached a test case. Can you trying running this as follows:

      java -cp test.jar;c:jython2.5.1/jython.jar test.Parent

Use Java 6, and adjust the path to your jython.jar appropriately. If it
works, as it always does for me under Linux, you'll see output similar to
the following:

     [parent] Starting [java, -classpath,
test.jar:/opt/jython/jython2.5.1/jython.jar, test.Child]
     [parent] Waiting
     [child] Initializing Jython
     *sys-package-mgr*: processing modified jar,
'/home/philipa/grinder/bugs/bug2936167/test.jar'
     [child] Executing Jython
     Hello world
     [child] Done
     [parent] Done, process exit code: 0

I expect it will fail for you on Windows, and will just block after
"Initializing Jython". If this is the case, please use the task manager to
work out what the process id of the child process is, and then use the Java
jstack command to get a thread dump from it. Additionally, please can you
try running against older versions of Jython, e.g. 2.2.1.

On the other hand, if it works fine for you I'll have to think on.

- Phil



----------------------------------------------------------------------

Comment By: Philip Aston (philipa)
Date: 2010-02-21 18:14

Message:
I don't think this can easily be worked around in The Grinder and it will
need to be fixed in Jython. However, we will need to create a standalone
reproducer.

----------------------------------------------------------------------

Comment By: Philip Aston (philipa)
Date: 2010-02-21 18:13

Message:

This stack trace shows that the problem is Jython 2.5.1 not being able to
initialize correctly because it can't figure out whether a stream is a
tty:

// PySystemState.java
    //...
    private void initEncoding() {
        String encoding = registry.getProperty(PYTHON_CONSOLE_ENCODING);
        if (encoding == null) {
            return;
        }

        for (PyFile stdStream : new PyFile[] {(PyFile)this.stdin,
(PyFile)this.stdout,
                                              (PyFile)this.stderr}) {
            if (stdStream.isatty()) {
                stdStream.encoding = encoding;
            }
        }
    }

When called under The Grinder, stdin, stderr, and stdout are connected to
the parent process streams. Jython on Windows clearly has issues with
figuring out whether one of these streams is a tty.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=2936167&group_id=18598

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.