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

MAC: SIGBUS running JRuby's readLine()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • tbd
    • 7u4
    • hotspot
    • generic
    • os_x

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: