JDK-7129720 : MAC: SIGBUS running JRuby's readLine()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7u4
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: generic
  • Submitted: 2012-01-13
  • Updated: 2012-06-07
  • Resolved: 2012-06-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbd_minorResolved
Related Reports
Duplicate :  
Description
This bug shadows a JIRA bug created for the Mac OS X port at...

http://java.net/jira/browse/MACOSX_PORT-615

Here is the description from that bug:

This was a bug in my code but it resulted in a SIGBUS where I would of expected something like a stackoverflow.
I was attempting to implement a version of the JRuby demo IRB TextArea implementation in a application of mine.
In an, earlier than this one, version of the readline override method...
private String readLine(final String prompt) {
Configuration.getSysOut().println("readLine");
append(prompt.trim(), promptStyle);
append(" ", inputStyle); // hack to get right style for input
area.setCaretPosition(area.getDocument().getLength());
startPos = area.getDocument().getLength();

Readline.getHistory(Readline.getHolder(runtime)).moveToEnd();
Configuration.getSysOut().println("before");
synchronized (amEditing) {
try { amEditing.wait(); } catch (InterruptedException e) {
}
}

String result = getLine().trim();
Configuration.getSysOut().println("result " + result);
return result+(byte)4;
}
I thought since I had a separate text area for input where the demo only had one for both input and output I could skip the amEditing.wait()
So I commented it out.
Without even entering anything but I believe simply putting out the original prompt and then waiting (not waiting with my bug) for input it started scrolling the textarea to the right and after a little while crashed the app.
Bug reporting since I don't think this should fail the JVM.

Attaching crash log and 'current' version of the class with the overridden readline shown above.