Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7129720

MAC: SIGBUS running JRuby's readLine()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 7u4
    • Fix Version/s: tbd_minor
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      os_x

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              chhelin Charlie Helin (Inactive)
              Reporter:
              jmelvin James Melvin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: