Menu

If JAI-ImageIO installed, Firefox dies

Mijail
2008-03-04
2013-04-16
  • Mijail

    Mijail - 2008-03-04

    I have found what seems to be a strange crashing of the whole Firefox when the Java Advanced Image - ImageIO library is installed.

    Since JAI-ImageIO is not supported on Mac OS X, I only installed the pure java portion of it (a single .jar) in ~/Library/Java/Extensions, as extracted from the official distributions of the library; that way I have some of the library's functionality, though not the native acceleration provided by the native libraries available for the supported platforms.

    But I have just discovered that doing so causes Firefox to crash when loading *any* Java Applet. Tested and repeatable on Mac OS X 10.5.2 Intel, Firefox 3 beta 3, and Firefox 2.x, but I am fearing that this has been going on for at least one year (10.4 PowerPC).

    I am using version 1.0_01 of the ImageIO library. When possible, I will test on 10.4 Intel and PowerPC, and with later versions of the ImageiO lib, and report here.

    To me this seems to be quite strange. Any idea of what could be causing the crash? Note that there is no need for the applets to use ImageIO to cause the crash - rather, it is immediate.

     
    • Steven Michaud

      Steven Michaud - 2008-03-04

      I haven't yet had a chance to test this, but here's an obvious
      question:

      Do the same crashes happen in Safari?

       
    • Mijail

      Mijail - 2008-03-04

      Yes, I should have mentioned that. Safari always works OK. Opera, on the other hand, crashes in the same cases than Firefox.

      I have already tried ImageIO 1.0_1, 1.1 and 1.2 (daily build) with Firefox 2.0.0.4 and OS X 10.5.2, and the crash still happens. But I have recovered some logs that seem to build up a clue of the problem:

      In /var/log/system.log:

      Mar  4 17:17:14 HMmb [0x0-0xbb0bb].org.mozilla.firefox[0]: ### MRJPlugin:  getPluginBundle() here. ###
      Mar  4 17:17:14 HMmb [0x0-0xbb0bb].org.mozilla.firefox[0]: ### MRJPlugin:  CFBundleGetBundleWithIdentifier() succeeded. ###
      Mar  4 17:17:14 HMmb [0x0-0xbb0bb].org.mozilla.firefox[0]: ### MRJPlugin:  CFURLGetFSRef() succeeded. ###
      Mar  4 17:17:15 HMmb firefox-bin[1240]: Apple Applet Plugin: JNI exception (registerNatives, 421)
      Mar  4 17:17:15 HMmb firefox-bin[1240]: Exception
      Mar  4 17:17:15 HMmb firefox-bin[1240]: in thread "Thread-0"
      Mar  4 17:17:15 HMmb firefox-bin[1240]: Invalid memory access of location 00000000 eip=1af6652d

      In /var/log/Java Console.log:

      sun.misc.ServiceConfigurationError: javax.imageio.spi.ImageInputStreamSpi: Provider com.sun.media.imageioimpl.stream.ChannelImageInputStreamSpi not found
          at sun.misc.Service.fail(Service.java:129)
          at sun.misc.Service.access$000(Service.java:111)
          at sun.misc.Service$LazyIterator.next(Service.java:273)
          at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:188)
          at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:120)
          at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:141)
          at apple.awt.CToolkit.registerDefaultServices(CToolkit.java:1249)
          at apple.awt.CToolkit.<init>(CToolkit.java:117)
          at apple.awt.MyCToolkit.<init>(MyCToolkit.java:67)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
          at java.lang.Class.newInstance0(Class.java:350)
          at java.lang.Class.newInstance(Class.java:303)
          at java.awt.Toolkit$2.run(Toolkit.java:833)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
          at sun.plugin.viewer.context.WebKitAppletContext.<clinit>(WebKitAppletContext.java:26)
          at jep.AppletHandlerFactory.callRegisterNatives(Native Method)
          at jep.AppletHandlerFactory.initProperties(AppletHandlerFactory.java:254)

      And, in the firefox-bin*.crash:
      ...
      Java information:
      Version: Java HotSpot(TM) Client VM (1.5.0_13-119 mixed mode)
      Virtual Machine version: Java HotSpot(TM) Client VM (1.5.0_13-119) for macosx-x86, built on Sep 28 2007 23:59:21 by root with gcc 4.0.1 (Apple Inc. build 5465)
      Exception type: Bus Error (0xa) at pc=0x18f1c52d

      Current thread (0x1910a3d0):  JavaThread "Thread-0" [_thread_in_vm, id=-1332592640]
      Stack: [0xb08a4000,0xb0924000)
      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j  jep.AppletHandlerFactory.callRegisterNatives()V+0
      j  jep.AppletHandlerFactory.initProperties()V+39
      v  ~StubRoutines::call_stub
      ...

      If I can provide any more information, please tell me.

       
    • Steven Michaud

      Steven Michaud - 2008-03-04

      It'll be a few days before I can look into this further.  But thanks for the information.

       
    • Mijail

      Mijail - 2008-03-05

      Just completing the report: I have now tested this on a PowerPC machine with OS X 10.4.11 and Firefox 2.0.0.12. Again, Firefox dies if jai-imageIO is installed. Safari always works.

      If needed, I'll upload the jai-imageIO.jar file to a bugreport or whatever.

      Crash logs:

      /var/log/system.log:

      firefox-bin: Java is generating its shared archive, version 1.5
      firefox-bin: An unexpected Java error has been detected by HotSpot Virtual Machine.
      firefox-bin: If this error is reproducible, please report it with the following information:
      firefox-bin:   1. Provide the steps to reproduce, a test case, and any relevant information
      firefox-bin:   2. The corresponding JavaNativeCrash_pid<num>.crash.log (Java state)
      firefox-bin:   3. The corresponding <name>.crash.log (native state; generated by CrashReporter)
      firefox-bin:   4. This data:
      firefox-bin:        Java VM: Java HotSpot(TM) Client VM (1.5.0_13-121 mixed mode)
      firefox-bin:        Bus Error (0xa) at pc=0x9cb44028
      firefox-bin:        Process ID: 1666, Current Thread: 41016832
      firefox-bin: File report at: http://bugreport.apple.com/
      firefox-bin: An error report file has been written to:
      firefox-bin:   .../JavaNativeCrash_pid1666.crash.log
      crashdump[1676]: firefox-bin crashed
      crashdump[1676]: crash report written to: /Users/mija/Library/Logs/CrashReporter/firefox-bin.crash.log

      firefox-bin.crash.log:
      ...
      Exception:  EXC_BAD_ACCESS (0x0001)
      Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

      Thread 0:
      0   libSystem.B.dylib               0x900411f8 mach_wait_until + 8
      1   libSystem.B.dylib               0x90040fc4 nanosleep + 388
      2   libSystem.B.dylib               0x90044798 usleep + 88
      3   JavaEmbeddingPlugin             0x07739c24 Java_java_lang_Object_wait_redirect + 8396
      4   JavaEmbeddingPlugin             0x0771c5bc JEPCreateJavaVMAndInitAWT + 456
      5   com.netscape.MRJPlugin          0x07568d80 JEPCreateJavaVMAndInitAWT + 120
      6   com.netscape.MRJPlugin          0x07567208 MRJSession::open(char const*) + 780
      7   com.netscape.MRJPlugin          0x075715b4 MRJPlugin::StartupJVM() + 388
      8   com.netscape.MRJPlugin          0x07570ca8 MRJPlugin::CreateInstance(nsISupports*, nsID const&, void**) + 44
      9   org.mozilla.firefox             0x0024081c nsPluginHostImpl::TrySetUpPluginInstance(char const*, nsIURI*, nsIPluginInstanceOwner*) + 928
      ...

      JavaNativeCrash*.crash.log:
      ...
      # An unexpected Java error has been detected by HotSpot Virtual Machine:
      #
      # Java VM: Java HotSpot(TM) Client VM (1.5.0_13-121 mixed mode)
      #
      #  Bus Error (0xa) at pc=0x9cb44028, pid=1666, tid=41016832

      ---------------  T H R E A D  ---------------

      Current thread (0x0850c620):  JavaThread "Thread-0" [_thread_in_vm, id=41603584]

      Stack: [0xf0913000,0xf0993000)
      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j  jep.AppletHandlerFactory.callRegisterNatives()V+0
      j  jep.AppletHandlerFactory.initProperties()V+39
      v  ~StubRoutines::call_stub

      ...

      Java Console.log:
      sun.misc.ServiceConfigurationError: javax.imageio.spi.ImageReaderSpi: Provider com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi not found
          at sun.misc.Service.fail(Service.java:129)
          at sun.misc.Service.access$000(Service.java:111)
          at sun.misc.Service$LazyIterator.next(Service.java:273)
          at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:188)
          at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:120)
          at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:141)
          at apple.awt.CToolkit.registerDefaultServices(CToolkit.java:1226)
          at apple.awt.CToolkit.<init>(CToolkit.java:136)
          at apple.awt.MyCToolkit.<init>(MyCToolkit.java:67)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
          at java.lang.Class.newInstance0(Class.java:350)
          at java.lang.Class.newInstance(Class.java:303)
          at java.awt.Toolkit$2.run(Toolkit.java:833)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
          at sun.plugin.viewer.context.WebKitAppletContext.<clinit>(WebKitAppletContext.java:26)
          at jep.AppletHandlerFactory.callRegisterNatives(Native Method)
          at jep.AppletHandlerFactory.initProperties(AppletHandlerFactory.java:254)

       
    • Mijail

      Mijail - 2008-03-05

      (oh, and I followed the "file bug report at Apple" route a couple of times during the last 1 or 2 years. Never heard back)

       
    • Steven Michaud

      Steven Michaud - 2008-03-09

      As you said in your first message, jai-imageio
      (https://jai-imageio.dev.java.net/) isn't supported on Mac OS X.
      Moreover, all the downloads for the officially supported platforms
      (available at https://jai-imageio.dev.java.net/binary-builds.html\)
      include executable binaries as well as jar files.

      So I've decided (at least for the time being) not to try to alter the
      Java Embedding Plugin to support jai-imageio.

      However, I have a hunch that your crashes might go away if you switch
      to Java 1.4.2 in Apple's Java Control Panel (Applications : Utilities
      : Java : Java Preferences).  Please try this and post your results
      here.

      If this works, you'll at least have an "unofficial" way to use
      jai-imageio with the Java Embedding Plugin.

       
      • Mijail

        Mijail - 2008-03-09

        No luck, the crashes still happen. I'll add the interesting excerpts from the logs at the end of this message.

        The problem is: we at the open source gvSIG project (www.gvsig.org) need the JAI-ImageIO functionality, and have been installing the jar file in ~/Libraries/Java/Extensions for our users. So by now our users must have found themselves with Java causing crashes in Firefox, Camino and Opera (I didn't know it also used the JEP!).

        For us at gvSIG, there are two possible courses of action that I can think of right now:
        (a) maybe we could recompile the JAI-ImageIO jarfile so that it does not try to load any native dylib (in case that the crashing is caused by that, which I am not really counting on; ditto for the possibility of the JAI-ImageIO's license allowance on such a thing, to begin with)
        (b) or, maybe we could try ourselves our hand at solving the problem at the JEP...

        Could you please give us any hint on those options? Would you guess that (a) could solve the issue? And, do you think (b) would be very hard?

        Thank you.

        The logs:
        JavaNativeCrash*.crash.log:
        ...
        Unexpected Signal : Bus Error occurred at PC=0x925DE01B
        Function=[Unknown.]
        Library=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libhotspot.dylib

        NOTE: We are unable to locate the function name symbol for the error
              just occurred. Please refer to release documentation for possible
              reason and solutions.

        Current Java thread:
            at jep.AppletHandlerFactory.callRegisterNatives(Native Method)
            at jep.AppletHandlerFactory.initProperties(AppletHandlerFactory.java:254)
        ...

        JavaConsole.log:
        sun.misc.ServiceConfigurationError: javax.imageio.spi.ImageOutputStreamSpi: Provider com.sun.media.imageioimpl.stream.ChannelImageOutputStreamSpi not found
            at sun.misc.Service.fail(Service.java:129)
            at sun.misc.Service.access$000(Service.java:111)
            at sun.misc.Service$LazyIterator.next(Service.java:272)
            at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:174)
            at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:113)
            at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:134)
            at apple.awt.CToolkit.registerDefaultServices(CToolkit.java:1200)
            at apple.awt.CToolkit.<init>(CToolkit.java:131)
            at apple.awt.MyCToolkit.<init>(MyCToolkit.java:67)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
            at java.lang.Class.newInstance0(Class.java:308)
            at java.lang.Class.newInstance(Class.java:261)
            at java.awt.Toolkit$2.run(Toolkit.java:760)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:739)
            at sun.plugin.viewer.context.WebKitAppletContext.<clinit>(WebKitAppletContext.java:26)
            at jep.AppletHandlerFactory.callRegisterNatives(Native Method)
            at jep.AppletHandlerFactory.initProperties(AppletHandlerFactory.java:254)

         
    • Steven Michaud

      Steven Michaud - 2008-03-10

      > No luck, the crashes still happen.

      Sorry to hear about it.  (Sometimes crashes in registerNatives are
      caused by trying to load jnilibs for more than one Java version.  So
      it's sometimes possible to stop these crashes by specifying a
      different Java version in the Control Panel.)

      > For us at gvSIG, there are two possible courses of action that I can
      > think of right now:
      >
      > (a) maybe we could recompile the JAI-ImageIO jarfile so that it does
      >     not try to load any native dylib (in case that the crashing is
      >     caused by that, which I am not really counting on; ditto for the
      >     possibility of the JAI-ImageIO's license allowance on such a
      >     thing, to begin with)
      >
      > (b) or, maybe we could try ourselves our hand at solving the problem
      >     at the JEP...

      I don't think either alternative will be easy.  But I suspect (b) will
      be _much_ harder than (a), so I'd try (a) first.

      If you find a solution, please let me know about it.

      Right now I don't have a lot of time to spend on the Java Embedding
      Plugin.  But that may change at some point ... in which case I may be
      able to devote some more time to this problem myself.

       
      • Mijail

        Mijail - 2008-03-10

        OK, thank you very much for your suggestion. If we do / discover anything interesting, we'll report here somewhere.

        A last note: we got the idea of using the jai-imageio.jar out of other platforms' distributions from another Java open source GIS project, GeoTools; so not only gvSIG+OS X users are at risk, in case you find more of this kind of reports.
        (Interestingly, the web page where they pointed to this possibility removed that almost a year ago...)

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.