<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>485</bug_id>
          
          <creation_ts>2011-03-24 02:57:29 +0100</creation_ts>
          <short_desc>Freeze on loadLibrary of AWT in Eclipse RCP app inside GLProfile.initSingleton() on Mac OS X</short_desc>
          <delta_ts>2011-04-03 22:07:14 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>macosx</component>
          <version>2</version>
          <rep_platform>pc_x86_64</rep_platform>
          <op_sys>macosx</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Wade Walker">wwalker3</reporter>
          <assigned_to name="Wade Walker">wwalker3</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>921</commentid>
    <comment_count>0</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2011-03-24 02:57:29 +0100</bug_when>
    <thetext>The loadLibrary of AWT inside GLProfile.initSingleton() freezes on Mac OS X 10.6.7, nvidia GeForce 320M, Java 1.6.0_24. It works fine in a standalone SWT app, but freezes in an Eclipse RCP app.

I can force it not to load AWT by setting -Djava.awt.headless=true, but I&apos;m not sure the app will work that way -- still debugging later problems.

Here&apos;s the stack trace:

Daemon Thread [Thread-1] (Suspended)	
	ClassLoader$NativeLibrary.load(String) line: not available [native method]	
	ClassLoader.loadLibrary0(Class, File) line: 1823	
	ClassLoader.loadLibrary(Class, String, boolean) line: 1720	
	Runtime.loadLibrary0(Class, String) line: 823	
	System.loadLibrary(String) line: 1045	
	LoadLibraryAction.run() line: 50	
	AccessController.doPrivileged(PrivilegedAction&lt;T&gt;) line: not available [native method]	
	Toolkit.loadLibraries() line: 1605	
	Toolkit.&lt;clinit&gt;() line: 1627	
	JAWTJNILibLoader$1.run() line: 58	
	AccessController.doPrivileged(PrivilegedAction&lt;T&gt;) line: not available [native method]	
	JAWTJNILibLoader.loadAWTImpl() line: 53	
	JAWTUtil.&lt;clinit&gt;() line: 66	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	ReflectionUtil.callMethod(Object, Method, Object[]) line: 267	
	NativeWindowFactory.initSingleton(boolean) line: 176	
	GLProfile.initProfilesForDefaultDevices(boolean) line: 1095	
	GLProfile.access$000(boolean) line: 66	
	GLProfile$1.run() line: 107	
	AccessController.doPrivileged(PrivilegedAction&lt;T&gt;) line: not available [native method]	
	GLProfile.initSingleton(boolean) line: 105	
	Activator.&lt;clinit&gt;() line: 67	
	NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not available [native method]	
	NativeConstructorAccessorImpl.newInstance(Object[]) line: 39	
	DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27	
	Constructor&lt;T&gt;.newInstance(Object...) line: 513	
	Class&lt;T&gt;.newInstance0() line: 355	
	Class&lt;T&gt;.newInstance() line: 308	
	BundleHost(AbstractBundle).loadBundleActivator() line: 151	
	BundleContextImpl.start() line: 751	
	BundleHost.startWorker(int) line: 370	
	BundleHost(AbstractBundle).start(int) line: 284	
	SecureAction.start(Bundle, int) line: 417	
	BundleLoader.setLazyTrigger() line: 265	
	EclipseLazyStarter.postFindLocalClass(String, Class, ClasspathManager) line: 106	
	ClasspathManager.findLocalClass(String) line: 453	
	DefaultClassLoader.findLocalClass(String) line: 216	
	BundleLoader.findLocalClass(String) line: 393	
	BundleLoader.findClassInternal(String, boolean, ClassLoader) line: 469	
	BundleLoader.findClass(String, boolean) line: 422	
	BundleLoader.findClass(String) line: 410	
	DefaultClassLoader.loadClass(String, boolean) line: 107	
	DefaultClassLoader(ClassLoader).loadClass(String) line: 248	
	BundleLoader.loadClass(String) line: 338	
	BundleHost.loadClass(String, boolean) line: 232	
	BundleHost(AbstractBundle).loadClass(String) line: 1197	
	EquinoxRegistryStrategy(RegistryStrategyOSGI).createExecutableExtension(RegistryContributor, String, String) line: 174	
	ExtensionRegistry.createExecutableExtension(RegistryContributor, String, String) line: 904	
	ConfigurationElement.createExecutableExtension(String) line: 243	
	ConfigurationElementHandle.createExecutableExtension(String) line: 55	
	EclipseAppHandle.run(Object) line: 191	
	EclipseAppLauncher.runApplication(Object) line: 110	
	EclipseAppLauncher.start(Object) line: 79	
	EclipseStarter.run(Object) line: 369	
	EclipseStarter.run(String[], Runnable) line: 179	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	Main.invokeFramework(String[], URL[]) line: 620	
	Main.basicRun(String[]) line: 575	
	Main.run(String[]) line: 1408	
	Main.main(String[]) line: 1384</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>923</commentid>
    <comment_count>1</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2011-03-24 03:07:16 +0100</bug_when>
    <thetext>The bug 486 shows up after I bypass this one. Not sure if the lack of AWT load causes bug 486 (it also happens if I omit GLProfile.initSingleton() instead of using -Djava.awt.headless).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>925</commentid>
    <comment_count>2</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2011-03-25 03:04:03 +0100</bug_when>
    <thetext>This bug has been seen in the wild at http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/#comment-52. He mentions the same behavior I&apos;ve seen, where Eclipse sticks at the flash screen.

The problem seems to be when loading the AWT library -- it freezes inside the loadLibrary() call.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>930</commentid>
    <comment_count>3</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2011-04-02 23:58:17 +0200</bug_when>
    <thetext>Setting -Djava.awt.headless=true fixes this problem, and also fixes a separate problem where standalone (non-RCP) SWT apps freeze when you quit (on Mac OS X). Apparently loading libawt.jnilib if you&apos;re using SWT on the Mac is just a bad idea.

The thread at http://lists.apple.com/archives/Java-dev/2008/Dec/msg00249.html says that Apple&apos;s JDK checks for -XstartOnFirstThread=true and if so doesn&apos;t load AWT. Perhaps we should check for this in NativeWindowFactory.initSingleton()? Or maybe run all SWT apps with -Djava.awt.headless=true on the Mac?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>931</commentid>
    <comment_count>4</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2011-04-03 22:07:14 +0200</bug_when>
    <thetext>Apparently the right answer is to set -Djava.awt.headless=true on Mac OS X RCP projects. The RuntimeMXBean can&apos;t see the -XstartOnFirstThread argument to the JVM, so we can&apos;t piggyback on that. And there&apos;s no way for GLProfile.initSingleton() to know that a program is going to use SWT later, so I don&apos;t think we can change JOGL to fix this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>