History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-1553
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ola Bini
Reporter: Kornelius Kalnbach
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
JRuby

Generator sometimes hangs up

Created: 11/Nov/07 02:16 AM   Updated: 22/Dec/07 06:26 AM
Component/s: Core Classes/Modules
Affects Version/s: JRuby 1.1b1
Fix Version/s: JRuby 1.0.3, JRuby 1.1RC2

Time Tracking:
Not Specified

File Attachments: 1. Text File generator.patch (0.5 kb)

Environment: Mac OS X 10.4, MacBook, Core Duo, 2GB RAM


 Description  « Hide
The Generator seems to have problems with big enumerations:

$ time jruby -rgenerator -e 'gen = Generator.new((0..100000)); gen.next while gen.next?'
real 0m5.699s
$ time jruby -rgenerator -e 'gen = Generator.new((0..100000)); gen.next while gen.next?'
^C
real 3m9.880s

It seems the bigger the number is, the more often jruby hangs up (process goes to sleep.)

This also affects the bm_loop_generator benchmark from Ruby 1.9.

Since the problem doesn't arise always, I can't think of a test case yet.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter - 11/Nov/07 02:19 AM
On channel mele said this seemed to be ok in 1.0.x, but that may just be because it doesn't compile and doesn't run as fast. I'd imagine there's just a threading deadlock somewhere in the generator code. Fix for 1.1 and 1.0.3.

Peter Brant - 16/Nov/07 05:59 PM
Fix attached.

It turns out the problem was that the generator could fail to notice that the thread supplying data had finished.

I'm not really sure how to test for this. Any thoughts?


Vladimir Sizikov - 03/Dec/07 05:29 AM
Ah, this problem has been fixed when JRUBY-1640 was fixed. Basically, the same root cause, different manifestations.

And the patches are very close too.

I guess this issue can be safely closed now.


Ola Bini - 03/Dec/07 05:39 AM
This is resolved on trunk. Also, other test cases catch this one too.