Bug 215879 - SWT crashes on start
Summary: SWT crashes on start
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 blocker with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Kevin Barnes CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability, vm
Depends on:
Blocks:
 
Reported: 2008-01-18 20:59 EST by Daniel CLA
Modified: 2008-04-14 16:04 EDT (History)
4 users (show)

See Also:


Attachments
the error report (18.98 KB, text/plain)
2008-01-18 20:59 EST, Daniel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel CLA 2008-01-18 20:59:43 EST
Created attachment 87317 [details]
the error report

I'm using the SWT library, ran the "Hello World" example:

import org.eclipse.swt.widgets.*;

public class SWTExperiment {
	
	public static void main (String [] args) {
		Display display = new Display ();
		Shell shell = new Shell(display);
		shell.open ();
		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch ()) display.sleep ();
		}
		display.dispose ();
	}
}

and SWT fails to load, it always exits with
java has exited due to signal 4 (SIGILL).

I see the window flash open, then immediately it crashes.
There is nothing in the logs.

when i open the resulting jar with the jar launcher I get the crash report which I attached.
Comment 1 Daniel CLA 2008-01-18 21:03:33 EST
also, I ditched the new version and tried 3.2.2 and it worked
Comment 2 Kevin Barnes CLA 2008-01-25 15:26:30 EST
stack trace indicates carbon libraries ("libswt-pi-carbon-3346")
Comment 3 Mike Wilson CLA 2008-04-11 18:01:42 EDT
On my Mac, running OS X 10.5.2, I successfully ran the hello world example, from the command line, using the SWT from R3.4 M6. Can you try that version and see if it fails for you? Also, can you run
    java -version
and let us know what it prints?

Comment 4 Daniel CLA 2008-04-11 19:45:17 EDT
this is the output from java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode, sharing)

I'm running Mac OS X 10.4.11, so still on Tiger.

I ran it again with the R3.4 M6 (including swt-debug.jar) and i'm getting the same issue, seeing the frame and then crashing with SIGILL.
Comment 5 Mike Wilson CLA 2008-04-11 20:12:25 EDT
Adding Steve to increase the visibility.

Comment 6 Kevin Barnes CLA 2008-04-14 10:31:01 EDT
How are you launching your app? If you are launch from the command line, are you using the -XstartOnFirstThread option? 

(http://www.eclipse.org/swt/faq.php#carbonapp)

I'm running on leopard w/o any problems. I'll try Tiger.
Comment 7 Kevin Barnes CLA 2008-04-14 11:15:48 EDT
Sorry, I could not reproduce this on Tiger either. I tried running in Eclipse, from command line, and exporting a project as a runnable jar from Eclipse. No crashes.
Please provide detailed instructions on how you are creating your project and running you code.
Comment 8 Daniel CLA 2008-04-14 15:37:50 EDT
I created it using xcode 2.5 on tiger.  I tried using eclipse but it would not build from source for some reason, so thats how i ended up on xcode.  There are no command line arguments except -cp SWTexperiment.jar SWTexperiment, which doesn't pertain to this.  


I just tried adding the -XstartOnFirstThread option and everything worked fine.  No crashing, everything is wonderful.  what does this option do?
Comment 9 Steve Northover CLA 2008-04-14 16:04:19 EDT
http://www.eclipse.org/swt/faq.php#carbonapp