Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.2
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:Snow leopard 10.6.7 on a 2011 Macbook Pro
-
Number of attachments :
Description
I created the following "test.rb":
require 'fiber'
::Fiber.current.object_id
Executing jruby --1.9 test.rb results in:
CachingCallSite.java:388:in `pollAndGetClass': java.lang.NullPointerException
from CachingCallSite.java:100:in `call'
from test.rb:2:in `_file_'
from test.rb:-1:in `load'
from Ruby.java:671:in `runScript'
from Ruby.java:575:in `runNormally'
from Ruby.java:424:in `runFromMain'
from Main.java:278:in `doRunFromMain'
from Main.java:198:in `internalRun'
from Main.java:164:in `run'
from Main.java:148:in `run'
from Main.java:128:in `main'
Note: this seems to happen only if not actually in a fiber block. Also, merely calling Fiber.current does not trigger the NPE. Only when you call a method (any method, it seems) on the resulting object do you get the NPE.
MRI seems to have a valid "global fiber" that gets returned when you call Fiber.current outside a fiber block.
Fixed in trunk for now, in 28414b7. Thanks for the report!