You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Geir Magnusson Jr (JIRA)" <ji...@apache.org> on 2006/06/21 20:47:29 UTC

[jira] Created: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

[classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06
-----------------------------------------------------------------------------------------------

         Key: HARMONY-638
         URL: http://issues.apache.org/jira/browse/HARMONY-638
     Project: Harmony
        Type: Bug

  Components: Classlib  
    Reporter: Geir Magnusson Jr


it seems that exec() doesn't work - it never returns.  Bug in IBM j9 kernel classes?

Mark Hindress is trying to duplcate to reconfirm.

ubuntu 6.06
gcc 3.4
invoked by Sun Java 1.5.0_07
IBM J9 for linux, v3 mk II



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Created: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by Oliver Deakin <ol...@googlemail.com>.

Geir Magnusson Jr wrote:
> Oliver Deakin wrote:
>   
>> Geir Magnusson Jr wrote:
>>     
>>> However, in our case, when I say "exec never returns" I mean "exec()"
>>> never returns.
>>>
>>> so you'd never actually get to "do IO" above, because you are hanging in
>>> exec().
>>>
>>> Big difference, right?
>>>   
>>>       
>> Certainly 
>>     
>
> So I assume you agree?  (Just want to make sure that I'm not missing
> something terribly important here...)
>   

Yes, that is a different case to what I was imagining (and what was on 
that page I linked).
Seems that *I* was missing something important ;)

> - do you have a stack trace that gives more info for what each
>   
>> of the threads are
>> doing? Could you attach it to the JIRA if you do please - Ive just tried
>> running a cut down
>> version of the test on my SLES9 machine and it exited fine, so it would
>> be useful to have
>> a trace from your machine to see what's happening.
>>
>>     
>
> Done
>   

Thanks

Regards,
Oliver

> geir
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>
>   

-- 
Oliver Deakin
IBM United Kingdom Limited


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [jira] Created: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Oliver Deakin wrote:
> Geir Magnusson Jr wrote:
>>
>> However, in our case, when I say "exec never returns" I mean "exec()"
>> never returns.
>>
>> so you'd never actually get to "do IO" above, because you are hanging in
>> exec().
>>
>> Big difference, right?
>>   
> 
> Certainly 

So I assume you agree?  (Just want to make sure that I'm not missing
something terribly important here...)

- do you have a stack trace that gives more info for what each
> of the threads are
> doing? Could you attach it to the JIRA if you do please - Ive just tried
> running a cut down
> version of the test on my SLES9 machine and it exited fine, so it would
> be useful to have
> a trace from your machine to see what's happening.
> 

Done

geir


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [jira] Created: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by Oliver Deakin <ol...@googlemail.com>.
Geir Magnusson Jr wrote:
> Oliver Deakin wrote:
>   
>> The example returns once they have fixed it. If you look at the example
>> just before the "Why Runtime.exec() hangs" heading (BadExecJava2.java)
>> you will see a situation that is almost exactly the same as in the test
>> case.
>> i.e. an exec followed by a waitFor(), without any reading of streams.
>> In this case the exec never returns.
>>
>> The later example is how to fix it.
>>     
>
> I don't think so.
>
> When they are saying "the exec never returns", they are meaning that
> from the POV of the programmer, the spawned thing never returns.
>
> That's why you can do
>
> exec()
> do IO
> waitFor()
> done
>
> However, in our case, when I say "exec never returns" I mean "exec()"
> never returns.
>
> so you'd never actually get to "do IO" above, because you are hanging in
> exec().
>
> Big difference, right?
>   

Certainly - do you have a stack trace that gives more info for what each 
of the threads are
doing? Could you attach it to the JIRA if you do please - Ive just tried 
running a cut down
version of the test on my SLES9 machine and it exited fine, so it would 
be useful to have
a trace from your machine to see what's happening.

Thanks,
Oliver

> geir
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>
>   

-- 
Oliver Deakin
IBM United Kingdom Limited


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [jira] Created: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Oliver Deakin wrote:
> The example returns once they have fixed it. If you look at the example
> just before the "Why Runtime.exec() hangs" heading (BadExecJava2.java)
> you will see a situation that is almost exactly the same as in the test
> case.
> i.e. an exec followed by a waitFor(), without any reading of streams.
> In this case the exec never returns.
> 
> The later example is how to fix it.

I don't think so.

When they are saying "the exec never returns", they are meaning that
from the POV of the programmer, the spawned thing never returns.

That's why you can do

exec()
do IO
waitFor()
done

However, in our case, when I say "exec never returns" I mean "exec()"
never returns.

so you'd never actually get to "do IO" above, because you are hanging in
exec().

Big difference, right?

geir


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [jira] Created: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by Oliver Deakin <ol...@googlemail.com>.
The example returns once they have fixed it. If you look at the example
just before the "Why Runtime.exec() hangs" heading (BadExecJava2.java)
you will see a situation that is almost exactly the same as in the test 
case.
i.e. an exec followed by a waitFor(), without any reading of streams.
In this case the exec never returns.

The later example is how to fix it.

Regards,
Oliver


Geir Magnusson Jr wrote:
> Oliver Deakin wrote:
>   
>> I remember seeing problems like this before, in a non-Harmony jre, where a
>> Runtime.exec() would never return. I hunted around and found an
>> interesting page
>> on JavaWorld:
>>
>>  http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
>>
>> I found the "Why Runtime.exec() hangs" section very useful, and it
>> solved my problem
>> at the time. I'm not saying that what you're seeing is definitely the
>> same thing that I encountered,
>> but it may help. I notice that in this test stdout and stderr for the
>> process are not read - is it
>> possible that it is producing some output, and since it isn't being read
>> the process just waits
>> leading to the exec never exiting?
>>     
>
> I think the phrasing in the article is misleading, because we're not
> seeing exec() *return*, which is a different issue than the case that
> they are talking about, namely the subsequent waitFor() not returning.
>
> So I think this doesn't apply.  Interesting reading, though.
>
> geir
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>
>   

-- 
Oliver Deakin
IBM United Kingdom Limited


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [jira] Created: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Oliver Deakin wrote:
> I remember seeing problems like this before, in a non-Harmony jre, where a
> Runtime.exec() would never return. I hunted around and found an
> interesting page
> on JavaWorld:
> 
>  http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
> 
> I found the "Why Runtime.exec() hangs" section very useful, and it
> solved my problem
> at the time. I'm not saying that what you're seeing is definitely the
> same thing that I encountered,
> but it may help. I notice that in this test stdout and stderr for the
> process are not read - is it
> possible that it is producing some output, and since it isn't being read
> the process just waits
> leading to the exec never exiting?

I think the phrasing in the article is misleading, because we're not
seeing exec() *return*, which is a different issue than the case that
they are talking about, namely the subsequent waitFor() not returning.

So I think this doesn't apply.  Interesting reading, though.

geir

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [jira] Created: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by Oliver Deakin <ol...@googlemail.com>.
I remember seeing problems like this before, in a non-Harmony jre, where a
Runtime.exec() would never return. I hunted around and found an 
interesting page
on JavaWorld:
 
  http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

I found the "Why Runtime.exec() hangs" section very useful, and it 
solved my problem
at the time. I'm not saying that what you're seeing is definitely the 
same thing that I encountered,
but it may help. I notice that in this test stdout and stderr for the 
process are not read - is it
possible that it is producing some output, and since it isn't being read 
the process just waits
leading to the exec never exiting?

Regards,
Oliver


Geir Magnusson Jr (JIRA) wrote:
> [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06
> -----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-638
>          URL: http://issues.apache.org/jira/browse/HARMONY-638
>      Project: Harmony
>         Type: Bug
>
>   Components: Classlib  
>     Reporter: Geir Magnusson Jr
>
>
> it seems that exec() doesn't work - it never returns.  Bug in IBM j9 kernel classes?
>
> Mark Hindress is trying to duplcate to reconfirm.
>
> ubuntu 6.06
> gcc 3.4
> invoked by Sun Java 1.5.0_07
> IBM J9 for linux, v3 mk II
>
>
>
>   

-- 
Oliver Deakin
IBM United Kingdom Limited


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


[jira] Commented: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-638?page=comments#action_12417181 ] 

Geir Magnusson Jr commented on HARMONY-638:
-------------------------------------------

    [junit] Thread: main (priority 5) (LOCATION OF ERROR)
    [junit]  NATIVE   java/lang/Object.wait(JI)V
    [junit]  00000003 java/lang/Object.wait()V
    [junit]  00000094 org/apache/harmony/luni/internal/process/SystemProcess.cre ate([Ljava/lang/String;[Ljava/lang/String;Ljava/io/File;)Ljava/lang/Process;
    [junit]  0000001e java/lang/Runtime.exec([Ljava/lang/String;[Ljava/lang/Stri ng;Ljava/io/File;)Ljava/lang/Process;
    [junit]  00000036 java/lang/Runtime.exec(Ljava/lang/String;[Ljava/lang/Strin g;Ljava/io/File;)Ljava/lang/Process;
    [junit]  00000004 java/lang/Runtime.exec(Ljava/lang/String;[Ljava/lang/Strin g;)Ljava/lang/Process;
    [junit]  00000003 java/lang/Runtime.exec(Ljava/lang/String;)Ljava/lang/Proce ss;
    [junit]  0000006f tests/api/java/io/FileTest.test_setReadOnly()V
    [junit]  00000004 java/lang/reflect/AccessibleObject.invokeV(Ljava/lang/Obje ct;[Ljava/lang/Object;)V
    [junit]  00000182 java/lang/reflect/Method.invoke(Ljava/lang/Object;[Ljava/l ang/Object;)Ljava/lang/Object;  (@974DF0FE)
    [junit]  0000006c junit/framework/TestCase.runTest()V


> [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06
> -----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-638
>          URL: http://issues.apache.org/jira/browse/HARMONY-638
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Geir Magnusson Jr

>
> it seems that exec() doesn't work - it never returns.  Bug in IBM j9 kernel classes?
> Mark Hindress is trying to duplcate to reconfirm.
> ubuntu 6.06
> gcc 3.4
> invoked by Sun Java 1.5.0_07
> IBM J9 for linux, v3 mk II

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-638?page=comments#action_12417297 ] 

Geir Magnusson Jr commented on HARMONY-638:
-------------------------------------------

as discussed on dev list, fork() is failing due to some ulimit.  I can repeat it, and make it go away as well, so while we have an example, I will fix natives to throw exception if this happens.

> [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06
> -----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-638
>          URL: http://issues.apache.org/jira/browse/HARMONY-638
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Geir Magnusson Jr
>     Assignee: Geir Magnusson Jr

>
> it seems that exec() doesn't work - it never returns.  Bug in IBM j9 kernel classes?
> Mark Hindress is trying to duplcate to reconfirm.
> ubuntu 6.06
> gcc 3.4
> invoked by Sun Java 1.5.0_07
> IBM J9 for linux, v3 mk II

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-638?page=all ]

Geir Magnusson Jr reassigned HARMONY-638:
-----------------------------------------

    Assign To: Geir Magnusson Jr

> [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06
> -----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-638
>          URL: http://issues.apache.org/jira/browse/HARMONY-638
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Geir Magnusson Jr
>     Assignee: Geir Magnusson Jr

>
> it seems that exec() doesn't work - it never returns.  Bug in IBM j9 kernel classes?
> Mark Hindress is trying to duplcate to reconfirm.
> ubuntu 6.06
> gcc 3.4
> invoked by Sun Java 1.5.0_07
> IBM J9 for linux, v3 mk II

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-638?page=all ]
     
Geir Magnusson Jr resolved HARMONY-638:
---------------------------------------

    Resolution: Fixed

I believe this is now fixed w/ checkins r416412 and r416419 for linux and windows respectively.

In summary, if fork() failed, native code hung forever waiting for non-existent child to signal parent.

That's now fixed, and also a start at returning meaningful return codes was made so that nicer-looking exceptions can be thrown.


> [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06
> -----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-638
>          URL: http://issues.apache.org/jira/browse/HARMONY-638
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Geir Magnusson Jr
>     Assignee: Geir Magnusson Jr

>
> it seems that exec() doesn't work - it never returns.  Bug in IBM j9 kernel classes?
> Mark Hindress is trying to duplcate to reconfirm.
> ubuntu 6.06
> gcc 3.4
> invoked by Sun Java 1.5.0_07
> IBM J9 for linux, v3 mk II

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-638) [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-638?page=comments#action_12417182 ] 

Geir Magnusson Jr commented on HARMONY-638:
-------------------------------------------

And the other threads  :
   [junit] Thread: JIT Compilation Thread (priority 10) (daemon)

    [junit] Thread: Finalizer thread (priority 5) (daemon)

    [junit] Thread: Thread-1 (priority 5) (daemon)
    [junit]  NATIVE   org/apache/harmony/luni/internal/process/SystemProcess.cre ateImpl(Ljava/lang/Process;[[B[[B[B)[J
    [junit]  00000023 org/apache/harmony/luni/internal/process/SystemProcess$1.r un()V
    [junit]  0000000d java/lang/Thread.run()V




> [classlib] Tests hang on in luni : tests.api.java.io.FileTest / test_setReadOnly on Ubunti 6.06
> -----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-638
>          URL: http://issues.apache.org/jira/browse/HARMONY-638
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Geir Magnusson Jr

>
> it seems that exec() doesn't work - it never returns.  Bug in IBM j9 kernel classes?
> Mark Hindress is trying to duplcate to reconfirm.
> ubuntu 6.06
> gcc 3.4
> invoked by Sun Java 1.5.0_07
> IBM J9 for linux, v3 mk II

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira