Issue Details (XML | Word | Printable)

Key: JRUBY-2510
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Thomas E Enebo
Reporter: Ketan Padegaonkar
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

JRuby crashes with -XstartOnFirstThread on carbon

Created: 12/May/08 04:23 AM   Updated: 04/Jul/08 09:07 AM   Resolved: 18/May/08 02:50 PM
Return to search
Component/s: Java Integration
Affects Version/s: JRuby 1.1.1
Fix Version/s: JRuby 1.1.2

Time Tracking:
Not Specified

Environment: carbon


 Description  « Hide

To reproduce this bug, start jruby as: jruby -J-XstartOnFirstThread
Wait a while as jruby crashes with no warnings or errors printed on the console.

From http://www.eclipse.org/swt/faq.php#carbonapp:
If you run a Java application that uses Carbon via JNI, the application is not registered with the OS as a 'normal' UI application. As a consequence, it has no entry in the dock and it cannot be activated. AWT (or Swing) based applications don't have this problem because they seem to use undocumented SPI to register themselves.
To work around this problem you'll have to pass the -XstartOnFirstThread option to the java executable as follow:

java -XstartOnFirstThread -cp swt.jar:. ControlExample



Charles Oliver Nutter added a comment - 12/May/08 12:53 PM

I tested this with Java 5 and the following command line and it ran fine:

jruby -J-XstartOnFirstThread -e "puts 1"

What version of OS X, Java, etc were you running?


Ketan Padegaonkar added a comment - 12/May/08 06:38 PM

I'm using java 5.0 on osx 10.5.2:

 
[ketan@storm: /opt/workspaces/swtbot]$ java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

And this is what I happen to get when I do jruby -J-XstartOnFirstThread -e 'puts "hello world"'; echo $?

 
[ketan@storm: /opt/workspaces/swtbot]$ jruby -J-XstartOnFirstThread -e 'puts "hello world"'; echo $?
1

Normally jruby exits with exit code 0.

Jruby without the -J works fine:

 
[ketan@storm: /opt/workspaces/swtbot]$ jruby -e 'puts "hello world"'; echo $?
hello world
0

Ketan Padegaonkar added a comment - 18/May/08 12:12 AM

seems to have been fixed in trunk! SWT works fine. Jruby with -XstartOnFirstThread exits with exit code 0


Ketan Padegaonkar made changes - 18/May/08 12:12 AM
Field Original Value New Value
Resolution Fixed [ 1 ]
Fix Version/s JRuby 1.2 [ 14132 ]
Status Open [ 1 ] Resolved [ 5 ]
Thomas E Enebo made changes - 18/May/08 02:50 PM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Thomas E Enebo added a comment - 18/May/08 02:50 PM

Since this works in trunk it will be fixed for 1.1.2


Thomas E Enebo made changes - 18/May/08 02:50 PM
Assignee Thomas E Enebo [ enebo ]
Resolution Fixed [ 1 ]
Fix Version/s JRuby 1.2 [ 14132 ]
Fix Version/s JRuby 1.1.2 [ 14210 ]
Status Reopened [ 4 ] Resolved [ 5 ]
Charles Oliver Nutter made changes - 04/Jul/08 09:07 AM
Status Resolved [ 5 ] Closed [ 6 ]