You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Oliver Deakin <ol...@googlemail.com> on 2006/06/21 21:10:53 UTC

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

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


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