Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353185

Summary: Eclipse crashes on updateSplash at startup when launched by launchd
Product: [Eclipse Project] Equinox Reporter: Mikko Taivainen <mikko.taivainen>
Component: LauncherAssignee: Project Inbox <equinox.launcher-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: aniefer, bernat.to, darnells, jboehme, jordi.paricio, pwebster, remy.suen, Silenio_Quarti, tjwatson
Version: unspecified   
Target Milestone: Juno M5   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 364484    
Attachments:
Description Flags
RCP app crash log with -nosplash option
none
Bugfix
none
fix none

Description Mikko Taivainen CLA 2011-07-27 05:18:45 EDT
Build Identifier: 20110615-0604

If Eclipse is launched from the Finder (i.e. using "launchd") to open a file it crashes on splash screen. Specifying -nosplash in eclipse.ini doesn't help (it just hides the splash screen but the crash still occurs).

This problem started after upgrading from Snow Leopard to Lion (Mac OS X 10.7).

Here's stack trace from the crash report:

Current thread (000000000616b400):  JavaThread "main" [_thread_in_native, id=-1394257216, stack(00000000bf800000,00000000c0000000)]
Stack: [00000000bf800000,00000000c0000000]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.eclipse.equinox.launcher.JNIBridge._update_splash()V+0
j  org.eclipse.equinox.launcher.JNIBridge.updateSplash()Z+1
j  org.eclipse.equinox.launcher.Main$SplashHandler.updateSplash()V+27
v  ~StubRoutines::call_stub
j  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j  sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
j  sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+161
j  org.eclipse.core.runtime.internal.adaptor.DefaultStartupMonitor.update()V+16
j  org.eclipse.core.runtime.adaptor.EclipseStarter.updateSplash(Lorg/eclipse/core/runtime/internal/adaptor/Semaphore;Lorg/eclipse/core/runtime/adaptor/EclipseStarter$StartupEventListener;)V+65
j  org.eclipse.core.runtime.adaptor.EclipseStarter.setStartLevel(I)V+132
j  org.eclipse.core.runtime.adaptor.EclipseStarter.startup([Ljava/lang/String;Ljava/lang/Runnable;)Lorg/osgi/framework/BundleContext;+269
j  org.eclipse.core.runtime.adaptor.EclipseStarter.run([Ljava/lang/String;Ljava/lang/Runnable;)Ljava/lang/Object;+34
v  ~StubRoutines::call_stub
j  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j  sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
j  sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+161
j  org.eclipse.equinox.launcher.Main.invokeFramework([Ljava/lang/String;[Ljava/net/URL;)V+211
j  org.eclipse.equinox.launcher.Main.basicRun([Ljava/lang/String;)V+126
j  org.eclipse.equinox.launcher.Main.run([Ljava/lang/String;)I+4
v  ~StubRoutines::call_stub
 

Reproducible: Always

Steps to Reproduce:
1. Choose any file in Finder and select Open With | Other... | Eclipse (you may need to browse to location of your Eclipse installation)
2. Eclipse crashes and Mac shows a crash report
Comment 1 Mikko Taivainen CLA 2011-07-27 05:21:21 EDT
Some more details from the crash report:


Process:         eclipse [3279]
Path:            /Applications/eclipse/*/Eclipse.app/Contents/MacOS/eclipse
Identifier:      org.eclipse.eclipse
Version:         3.7 (3.7)
Code Type:       X86 (Native)
Parent Process:  launchd [264]

Date/Time:       2011-07-27 12:04:32.204 +0300
OS Version:      Mac OS X 10.7 (11A511)
Report Version:  9

Interval Since Last Report:          51612 sec
Crashes Since Last Report:           59
Per-App Interval Since Last Report:  2575 sec
Per-App Crashes Since Last Report:   6
Anonymous UUID:                      C5CE9AC3-EF20-4328-8B29-6CBC2000DF5E

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000

VM Regions Near 0:
--> __PAGEZERO             0000000000000000-0000000000001000 [    4K] ---/--- SM=NUL  /Applications/eclipse/*/Eclipse.app/Contents/MacOS/eclipse
    __TEXT                 0000000000001000-0000000000005000 [   16K] r-x/rwx SM=COW  /Applications/eclipse/*/Eclipse.app/Contents/MacOS/eclipse

Application Specific Information:
objc[3279]: garbage collection is OFF
 
Java information:
 Exception type: Bus Error (0xa) at pc=0000000093c9866e
 
 Java VM: Java HotSpot(TM) Client VM (20.1-b02-383 mixed mode macosx-x86)
Comment 2 Steven Darnell CLA 2011-07-29 16:45:22 EDT
I am seeing the exact same crash in our RCP app based on Eclipse 3.7.0 when running on Lion (10.7). We have a file association defined in the app's Info.plist; double-clicking the associated file from Finder leads to the crash.

Can anyone recommend a workaround for this problem? Unfortunately, I will not be able to wait for the 3.7.1 update in September due to our release schedule.
Comment 3 Jordi Paricio CLA 2011-08-04 04:05:36 EDT
We have the same problem described by Steven. We are receiving a lot of complaints from our users using Lion.
Can someone look into this issue and tell us a workaround?
Comment 4 Jordi Boehme Lopez CLA 2011-08-09 09:27:10 EDT
Same Problem here on Lion when opening our RCP App using a file association.
Comment 5 Jordi Paricio CLA 2011-09-06 05:16:41 EDT
Is somebody looking into this bug?
I have a lot of customers with this problem and they aren't happy about this not being resolved.
Can anyone point me to a possible fix?
Comment 6 Steven Darnell CLA 2011-09-06 14:01:42 EDT
For those that are interested, I created a topic in the Eclipse Equinox forum asking the community for a workaround to this bug: http://www.eclipse.org/forums/index.php/t/238787/

If this bug is assigned a 4.2x milestone, may I also ask that it be considered for 3.7.1. This definitely falls under the description of a maintenance/stability fix.
Comment 7 Andrew Niefer CLA 2011-09-06 17:03:56 EDT
I don't believe anyone has looked at this bug because I'm not aware of anyone other than myself that would generally be looking at launcher bugs at all.

I don't have a Mac myself and last I checked, none of the machines I can get access to were running Lion yet.

Is there a different stack trace when you use -nosplash?
From the trace in comment #0, the call 
j  org.eclipse.equinox.launcher.JNIBridge.updateSplash()Z+1
j  org.eclipse.equinox.launcher.Main$SplashHandler.updateSplash()V+27
should not happen if -nosplash was specified.
Comment 8 Steven Darnell CLA 2011-09-06 18:04:06 EDT
Created attachment 202847 [details]
RCP app crash log with -nosplash option

Andrew -- You would think it shouldn't, but it does.

This is the top of the stack trace with the -nosplash option in the RCP app .ini file.

j  org.eclipse.equinox.launcher.JNIBridge._update_splash()V+0
j  org.eclipse.equinox.launcher.JNIBridge.updateSplash()Z+1
j  org.eclipse.equinox.launcher.Main$SplashHandler.updateSplash()V+27
v  ~StubRoutines::call_stub

I attached the full crash log hoping it may be useful.
Comment 9 Steven Darnell CLA 2011-09-12 13:44:13 EDT
Andrew -- How do we move forward from this point?

Lion is a reality for Mac development and a crash of this nature must be fixed. It doesn't get more basic than opening a file.
Comment 10 Jordi Paricio CLA 2011-09-20 05:09:00 EDT
I agree with Steven. Opening files is something you expect to work always.
What is the status of this bug?
Comment 11 Jordi Paricio CLA 2011-10-14 03:36:45 EDT
Is there any progress on this bug?
Comment 12 Steven Darnell CLA 2011-10-17 13:54:24 EDT
The folks at EclipseSource have identified an OSX API change between 10.6 and 10.7 as the source of the problem. I tested a potential fix from them the last week, but it did not work in my hands in my RCP app.
Comment 13 Jordi Boehme Lopez CLA 2011-11-18 09:59:42 EST
Created attachment 207220 [details]
Bugfix

I investigated the problem and here is a patch to fix the bug on Mac OS X Lion (and in Snow Leopard when a file was launched from Spotlight).
It has been tested on various Lion and Snow Leopard Systems with 32Bit and 64Bit.

The patch is already working in production for us.
Comment 14 Steven Darnell CLA 2011-11-18 16:29:19 EST
Please include the patch in 3.7.2. This definitely falls under the description of a maintenance/stability fix.
Comment 15 Missing name CLA 2011-11-21 05:06:08 EST
Thanks for this patch!
Can someone give me a link on how to recompile equinox to test this immediately on our application? Many thanks!
Comment 16 Silenio Quarti CLA 2011-11-21 15:57:58 EST
Created attachment 207334 [details]
fix

Note that the previous patch has a leak when running on Leopard. This patch does not require the version check since it does not use the bookmark API which was only added in 10.6.  I have tested it in Leopard, SnowLeopard and Lion.
Comment 17 Andrew Niefer CLA 2011-11-22 11:03:58 EST
I have compiled and releaed Silenio's patch into master
Comment 18 Thomas Watson CLA 2011-12-01 17:45:01 EST
(In reply to comment #17)
> I have compiled and releaed Silenio's patch into master

Andrew in commit http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=9876030b849fbf63a92767c15b92d0a946743e4c you adopted the new binaries.  Is this all that is needed?  I thought you would need to update some fragments to pull in the new library binaries.
Comment 19 Andrew Niefer CLA 2011-12-15 14:26:09 EST
(In reply to comment #18)
> (In reply to comment #17)
> > I have compiled and releaed Silenio's patch into master
> 
> Andrew in commit
> http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=9876030b849fbf63a92767c15b92d0a946743e4c
> you adopted the new binaries.  Is this all that is needed?  I thought you would
> need to update some fragments to pull in the new library binaries.

Sorry, Tom is correct, this change did not actually make M4 because I forgot to update the fragments build.properties to consume the new binaries
Comment 20 Andrew Niefer CLA 2011-12-16 12:11:22 EST
I have updated the fragment build.properties to point at the correct tag