Issue Details (XML | Word | Printable)

Key: JRUBY-3049
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Charles Oliver Nutter
Reporter: William Gannon
Votes: 0
Watchers: 1
Operations

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

EXCEPTION_ACCESS_VIOLATION

Created: 10/Oct/08 08:42 AM   Updated: 12/Jan/09 04:28 PM   Resolved: 11/Oct/08 05:20 PM
Return to search
Component/s: None
Affects Version/s: JRuby 1.1.4
Fix Version/s: JRuby 1.1.5

Time Tracking:
Not Specified

File Attachments: 1. Text File hs_err_pid2912.log (6 kB)

Environment: Windows XP Pro SP3, Java 1.6.0_07-b06, HotSpot build 10.0-b23, mixed mode, sharing), AMD X2 5600, 2GB RAM


 Description  « Hide

This code causes an EXCEPTION_ACCESS_VIOLATION

c = 1

while (true)
flag = 0
(1..20).each do |e|
flag += (c % e)
end
break if (flag == 0)
c += 1
end
c

Below is the message:

#

  1. An unexpected error has been detected by Java Runtime Environment:
    #
  2. EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d8a0242, pid=2912, tid=2772
    #
  3. Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode, sharing)
  4. Problematic frame:
  5. V [jvm.dll+0x30242]
    #
  6. An error report file with more information is saved as hs_err_pid2912.log
    #
  7. If you would like to submit a bug report, please visit:
  8. http://java.sun.com/webapps/bugreport/crash.jsp
    #


William Gannon added a comment - 10/Oct/08 08:45 AM

I forgot to mention, this is with build 7858


Charles Oliver Nutter added a comment - 10/Oct/08 09:22 AM

I was able to reproduce this with SoyLatte JDK 6 (1.6.0_03-p3) on OS X. The problem seems to be in the "client" JIT compiler in the JVM, which we've had some trouble with before. Segfaults in the JVM are always the JVM's fault, but there may be something we can do to work around it.

In the short term, you can use the "server" VM by passing --server (or -server to the "java" command) which does not crash. I will file a bug with the Hotspot devs.


Charles Oliver Nutter added a comment - 11/Oct/08 01:51 PM

Managed to reduce it to this:

while (true)
  100.times {|e|} 
end

I talked with the Hotspot guys and they confirmed it's the same cause as an issue we reported last spring. That issue is fixed in all the various codebases, but I don't believe those fixes have propagated to any released version of Hotspot yet. The bug ID is 6758445, though I couldn't find it in the public bug listings.

I'm looking into the generated bytecode and will hopefully have it repaired soon.


Charles Oliver Nutter added a comment - 11/Oct/08 05:12 PM

I have committed a fix in r7870 that resolves this and cleans up/improves the "while" logic that was the source of the problem. I'm going to add a test that exhibits the crash before marking this resolved.


Charles Oliver Nutter added a comment - 11/Oct/08 05:20 PM

Hmm, I could not reduce this to a case that wouldn't slow down the build substantially. Short to medium runs of a fixnum-delimited loop do not appear to crash, and the true version would obviously run forever. So I think we'll have to go without a test for this one. I will, however, ping the ASM guys about possibly adding this as a verification. That would help reduce the likelihood of it coming up in the future.


Charles Oliver Nutter made changes - 11/Oct/08 05:20 PM
Field Original Value New Value
Assignee Thomas E Enebo [ enebo ] Charles Oliver Nutter [ headius ]
Resolution Fixed [ 1 ]
Fix Version/s JRuby 1.1.5 [ 14528 ]
Status Open [ 1 ] Resolved [ 5 ]
Charles Oliver Nutter made changes - 12/Jan/09 04:28 PM
Status Resolved [ 5 ] Closed [ 6 ]