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

appletviewer from JDK1.0.2 core dumps is audio is played.

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      sparc
    • OS:
      solaris_2.4
    • Verification:
      Not verified

      Description

      When audio is being played the appletviewer will core dump audio is busy.
      To reproduce:

      1. Bring up the appletviewer with TicTacToe applet.
      2. Click on a box to play to open up the audio port.
      3. cat sounds/*.au > /dev/audio or use audioplay or whatever to keep the /dev/audio busy
          for a long time.
      4. while 3 is going on play the ticTacToe.
      And you will see it will try retry for 3 times and attempt to write to the audio port
      and core dump.
      Here is the trace:

      Full thread dump:
          "Image Fetcher 3" (TID:0xee7015e8, sys_thread_t:0xede91de0) prio=8
      java.lang.Object.wait(Object.java)
      sun.awt.image.ImageFetcher.nextImage(ImageFetcher.java:81)
      sun.awt.image.ImageFetcher.run(ImageFetcher.java:96)
          "Image Fetcher 2" (TID:0xee701488, sys_thread_t:0xedec1de0) prio=8
      java.lang.Object.wait(Object.java)
      sun.awt.image.ImageFetcher.nextImage(ImageFetcher.java:81)
      sun.awt.image.ImageFetcher.run(ImageFetcher.java:96)
          "Image Fetcher 1" (TID:0xee7012e0, sys_thread_t:0xedef1de0) prio=8
      java.lang.Object.wait(Object.java)
      sun.awt.image.ImageFetcher.nextImage(ImageFetcher.java:81)
      sun.awt.image.ImageFetcher.run(ImageFetcher.java:96)
          "Image Fetcher 0" (TID:0xee7010b0, sys_thread_t:0xedf21de0) prio=8
      java.lang.Object.wait(Object.java)
      sun.awt.image.ImageFetcher.nextImage(ImageFetcher.java:81)
      sun.awt.image.ImageFetcher.run(ImageFetcher.java:96)
          "Audio Player" (TID:0xee700be0, sys_thread_t:0xedf91de0) prio=10 *current thread*
      sun.audio.AudioDevice.play(AudioDevice.java:368)
      sun.audio.AudioPlayer.run(AudioPlayer.java:118)
          "applet-TicTacToe-Handler" (TID:0xee702738, sys_thread_t:0xedfc1de0) prio=6
      java.lang.Object.wait(Object.java)
      ibm.JEmpower.AppletFrame.getNextEvent(AppletFrame.java:387)
      ibm.JEmpower.AppletFrame.run(AppletFrame.java:421)
      java.lang.Thread.run(Thread.java)
          "Screen Updater" (TID:0xee7021d8, sys_thread_t:0xedff1de0) prio=4
      java.lang.Object.wait(Object.java)
      sun.awt.ScreenUpdater.nextEntry(ScreenUpdater.java:75)
      sun.awt.ScreenUpdater.run(ScreenUpdater.java:95)
          "AWT-Motif" (TID:0xee701520, sys_thread_t:0xee0f1de0) prio=5
      java.lang.Thread.run(Thread.java)
          "AWT-Input" (TID:0xee7014f8, sys_thread_t:0xee121de0) prio=5
          "Finalizer thread" (TID:0xee7003b0, sys_thread_t:0xee3f1de0) prio=1
          "Async Garbage Collector" (TID:0xee700368, sys_thread_t:0xef441de0) prio=1
          "Idle thread" (TID:0xee700320, sys_thread_t:0xef471de0) prio=0
          "clock handler" (TID:0xee7001f8, sys_thread_t:0xef551de0) prio=11
          "main" (TID:0xee7000a0, sys_thread_t:0xbbb98) prio=5
      ibm.JEmpower.JEmpower.main(JEmpower.java:95)
      SIGABRT 6* abort (generated by abort(3) routine)
          si_signo [6]: SIGABRT 6* abort (generated by abort(3) routine)
          si_errno [0]: Error 0
          si_code [0]: SI_USER [pid: 3576, uid: 8019]
      stackbase=EDF92000, stackpointer=EDF91170

      Full thread dump:
          "Image Fetcher 3" (TID:0xee7015e8, sys_thread_t:0xede91de0) prio=8
      java.lang.Object.wait(Object.java)
      sun.awt.image.ImageFetcher.nextImage(ImageFetcher.java:81)
      sun.awt.image.ImageFetcher.run(ImageFetcher.java:96)
          "Image Fetcher 2" (TID:0xee701488, sys_thread_t:0xedec1de0) prio=8
      java.lang.Object.wait(Object.java)
      sun.awt.image.ImageFetcher.nextImage(ImageFetcher.java:81)
      sun.awt.image.ImageFetcher.run(ImageFetcher.java:96)
          "Image Fetcher 1" (TID:0xee7012e0, sys_thread_t:0xedef1de0) prio=8
      java.lang.Object.wait(Object.java)
      sun.awt.image.ImageFetcher.nextImage(ImageFetcher.java:81)
      sun.awt.image.ImageFetcher.run(ImageFetcher.java:96)
          "Image Fetcher 0" (TID:0xee7010b0, sys_thread_t:0xedf21de0) prio=8
      java.lang.Object.wait(Object.java)
      sun.awt.image.ImageFetcher.nextImage(ImageFetcher.java:81)
      sun.awt.image.ImageFetcher.run(ImageFetcher.java:96)
          "Audio Player" (TID:0xee700be0, sys_thread_t:0xedf91de0) prio=10 *current thread*
      sun.audio.AudioDevice.play(AudioDevice.java:368)
      sun.audio.AudioPlayer.run(AudioPlayer.java:118)
          "applet-TicTacToe-Handler" (TID:0xee702738, sys_thread_t:0xedfc1de0) prio=6
      java.lang.Object.wait(Object.java)
      ibm.JEmpower.AppletFrame.getNextEvent(AppletFrame.java:387)
      ibm.JEmpower.AppletFrame.run(AppletFrame.java:421)
      java.lang.Thread.run(Thread.java)
          "Screen Updater" (TID:0xee7021d8, sys_thread_t:0xedff1de0) prio=4
      java.lang.Object.wait(Object.java)
      sun.awt.ScreenUpdater.nextEntry(ScreenUpdater.java:75)
      sun.awt.ScreenUpdater.run(ScreenUpdater.java:95)
          "AWT-Motif" (TID:0xee701520, sys_thread_t:0xee0f1de0) prio=5
      java.lang.Thread.run(Thread.java)
          "AWT-Input" (TID:0xee7014f8, sys_thread_t:0xee121de0) prio=5
          "Finalizer thread" (TID:0xee7003b0, sys_thread_t:0xee3f1de0) prio=1
          "Async Garbage Collector" (TID:0xee700368, sys_thread_t:0xef441de0) prio=1
          "Idle thread" (TID:0xee700320, sys_thread_t:0xef471de0) prio=0
          "clock handler" (TID:0xee7001f8, sys_thread_t:0xef551de0) prio=11
          "main" (TID:0xee7000a0, sys_thread_t:0xbbb98) prio=5
      ibm.JEmpower.JEmpower.main(JEmpower.java:95)
      Monitor Cache Dump:
          unknown key (key=0xef441de0): unowned
      Waiting to be notified:
      "Async Garbage Collector"
          sun.awt.ScreenUpdater@EE7021D8/EE73A010 (key=0xee7021d8): unowned
      Waiting to be notified:
      "Screen Updater"
          sun.audio.AudioDevice@EE700CF8/EE741268 (key=0xee700cf8): monitor owner: "Audio Player"
          sun.awt.motif.MToolkit@EE7014E0/EE7378F0 (key=0xee7014e0): monitor owner: "AWT-Motif"
          ibm.JEmpower.AppletFrame@EE7026C8/EE73B290 (key=0xee7026c8): unowned
      Waiting to be notified:
      "applet-TicTacToe-Handler"
          java.util.Vector@EE7016C0/EE741DB8 (key=0xee7016c0): unowned
      Waiting to be notified:
      "Image Fetcher 3"
      "Image Fetcher 1"
      "Image Fetcher 2"
      "Image Fetcher 0"
      Registered Monitor Dump:
          Finalize me queue lock: unowned
      Waiting to be notified:
      "Finalizer thread"
          Thread queue lock: unowned
          Class lock: unowned
          Java stack lock: unowned
          Code rewrite lock: unowned
          Heap lock: unowned
          Has finalization queue lock: unowned
          Monitor IO lock: unowned
          Child death monitor: unowned
          Event monitor: unowned
          I/O monitor: unowned
      Waiting to be notified:
      "AWT-Input"
          Alarm monitor: unowned
      Waiting to be notified:
      "clock handler"
          Sbrk lock: unowned
          Monitor cache lock: unowned
          Monitor registry: monitor owner: "Audio Player"
      Thread Alarm Q:
          sys_thread_t 0xee121de0 [Timeout expired]
          sys_thread_t 0xef441de0 [Timeout in 5 ms]

      *** panic: "../../../../src/solaris/java/green_threads/src/iomgr.c", line 516: assertion failure



      So the bottom line is that java closes the stream and but AudioPlayer does not check the
      return since the audioOpen is a void.

      Here is how I worked around the problem such that java will not crash.
      354c354
      < public synchronized void play() {
      ---
      > public void play() {
      356d355
      < System.out.println("In audioplay now");
      369,374c368
      < // The check here is to ensure that the audio device is not closed.
      < // If not java will core dump like AppletViewer spr#QWUU38BLCT
      < if (dev > 0) {
      < audioWrite(ulaw, ulaw.length);
      < }
      <
      ---
      > audioWrite(ulaw, ulaw.length);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              flar Jim Graham
              Reporter:
              ksrini Kumar Srinivasan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: