[FIXED] OSX / Java 7

Started by normen, August 14, 2012, 17:07:59

Previous topic - Next topic

void256

Ok, repeating the last test with a more recent version of Java 7:

java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)


Appears to work better but fullscreen still does not work (I'll get a window without a border in the left bottom corner of the screen when I press 'F') and still it crashes when I keep pressing 'F' a couple of times:

java -cp lwjgl_test.jar:lwjgl.jar:lwjgl_util.jar -Djava.library.path=../native/macosx/ org.lwjgl.test.WindowCreationTest
The following keys are available:
ESCAPE:		Exit test
ARROW Keys:	Move window when in non-fullscreen mode
L:		List selectable display modes
0-8:		Selection of display modes
F:		Toggle fullscreen
SHIFT-F:	Toggle fullscreen with Display.destroy()/create() cycle
Found 96 display modes
Problem retrieving mode with 640x480x24@-1
Problem retrieving mode with 800x600x24@-1
Problem retrieving mode with 1024x768x24@-1
Window handle is null
Resizeable
nCreate
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Setting context
Non-default
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Resizeable
Setting context
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Setting context
Non-default
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Resizeable
Setting context
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Setting context
Non-default
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Resizeable
Setting context
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Setting context
Non-default
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Resizeable
Setting context
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Setting context
Non-default
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Resizeable
Setting context
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Setting context
Non-default
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Resizeable
Setting context
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Setting context
Non-default
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Resizeable
Setting context
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Setting context
Non-default
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Resizeable
Setting context
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Setting context
Non-default
setView
nMakeCurrent
nReleaseCurrentContexta
clearDrawable
Setting options
Setting options
Resizeable
Setting context
2012-10-23 20:31:19.453 java[509:1107] An uncaught exception was raised
2012-10-23 20:31:19.454 java[509:1107] *** Collection <__NSSetM: 0x7f911905f3c0> was mutated while being enumerated.
2012-10-23 20:31:19.456 java[509:1107] (
	0   CoreFoundation                      0x00007fff9a84a0a6 __exceptionPreprocess + 198
	1   libobjc.A.dylib                     0x00007fff943de3f0 objc_exception_throw + 43
	2   CoreFoundation                      0x00007fff9a8ddf98 __NSFastEnumerationMutationHandler + 232
	3   AppKit                              0x00007fff91af595e -[NSView trackingAreas] + 254
	4   AppKit                              0x00007fff91bdc35b -[NSView(NSInternal) _enableOrDisableTrackingAreas] + 96
	5   AppKit                              0x00007fff91be58f5 -[NSFrameView _windowChangedKeyState] + 93
	6   AppKit                              0x00007fff91be538e -[NSWindow _setFrameNeedsDisplay:] + 169
	7   AppKit                              0x00007fff91be9770 -[NSWindow becomeMainWindow] + 41
	8   AppKit                              0x00007fff91be3073 -[NSWindow _changeKeyAndMainLimitedOK:] + 830
	9   AppKit                              0x00007fff91be286b -[NSWindow _makeKeyRegardlessOfVisibility] + 104
	10  AppKit                              0x00007fff91be27c5 -[NSWindow makeKeyAndOrderFront:] + 25
	11  liblwjgl.jnilib                     0x000000017140f3a1 Java_org_lwjgl_opengl_MacOSXDisplay_nCreateWindow + 657
	12  ???                                 0x00000001065e3f90 0x0 + 4401807248
	13  ???                                 0x00000001065d8333 0x0 + 4401759027
	14  ???                                 0x00000001065d8806 0x0 + 4401760262
	15  ???                                 0x00000001065d8158 0x0 + 4401758552
	16  ???                                 0x00000001065d8158 0x0 + 4401758552
)
2012-10-23 20:31:19.456 java[509:1107] *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSSetM: 0x7f911905f3c0> was mutated while being enumerated.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff9a84a0a6 __exceptionPreprocess + 198
	1   libobjc.A.dylib                     0x00007fff943de3f0 objc_exception_throw + 43
	2   CoreFoundation                      0x00007fff9a8ddf98 __NSFastEnumerationMutationHandler + 232
	3   AppKit                              0x00007fff91af595e -[NSView trackingAreas] + 254
	4   AppKit                              0x00007fff91bdc35b -[NSView(NSInternal) _enableOrDisableTrackingAreas] + 96
	5   AppKit                              0x00007fff91be58f5 -[NSFrameView _windowChangedKeyState] + 93
	6   AppKit                              0x00007fff91be538e -[NSWindow _setFrameNeedsDisplay:] + 169
	7   AppKit                              0x00007fff91be9770 -[NSWindow becomeMainWindow] + 41
	8   AppKit                              0x00007fff91be3073 -[NSWindow _changeKeyAndMainLimitedOK:] + 830
	9   AppKit                              0x00007fff91be286b -[NSWindow _makeKeyRegardlessOfVisibility] + 104
	10  AppKit                              0x00007fff91be27c5 -[NSWindow makeKeyAndOrderFront:] + 25
	11  liblwjgl.jnilib                     0x000000017140f3a1 Java_org_lwjgl_opengl_MacOSXDisplay_nCreateWindow + 657
	12  ???                                 0x00000001065e3f90 0x0 + 4401807248
	13  ???                                 0x00000001065d8333 0x0 + 4401759027
	14  ???                                 0x00000001065d8806 0x0 + 4401760262
	15  ???                                 0x00000001065d8158 0x0 + 4401758552
	16  ???                                 0x00000001065d8158 0x0 + 4401758552
)
libc++abi.dylib: terminate called throwing an exception
Abort trap: 6


:-\

kappa

Tested on OS X 10.6.6, Java 6, 64bit.

LWJGL's Gears Test works but on startup lots of error messages appear in the console http://pastebin.com/8VPLe22E possibly clues as to why it fails to startup on the macs above?, looks like native memory leaks also this message looks odd "Invalid memory access of location 0x18 rip=0x7fff8767d11c").

The gears test then continues to work fine (working native cocoa window, yay!) but when the window is closed it crashes with following exception http://pastebin.com/4sZeiTqt

Matzon

Would it make sense to create a branch, so we can get more eyes on the code?

mc78


void256

Ok, more testing: Nifty works, yay!  :D

Native mouse cursors are not supported? I get this Exception:

org.lwjgl.LWJGLException: Native cursors not supported


I've tried the MouseCreationTest to verify and it seems there is another native exception

java -cp lwjgl_test.jar:lwjgl.jar:lwjgl_util.jar -Djava.library.path=../native/macosx/ org.lwjgl.test.input.MouseCreationTest
Window handle is null
Resizeable
2012-10-25 23:44:24.258 java[1106:1107] An uncaught exception was raised
2012-10-25 23:44:24.259 java[1106:1107] *** Collection <__NSSetM: 0x7fb8fa8865d0> was mutated while being enumerated.
2012-10-25 23:44:24.260 java[1106:1107] (
	0   CoreFoundation                      0x00007fff8ee520a6 __exceptionPreprocess + 198
	1   libobjc.A.dylib                     0x00007fff889e63f0 objc_exception_throw + 43
	2   CoreFoundation                      0x00007fff8eee5f98 __NSFastEnumerationMutationHandler + 232
	3   AppKit                              0x00007fff860fd95e -[NSView trackingAreas] + 254
	4   AppKit                              0x00007fff861e435b -[NSView(NSInternal) _enableOrDisableTrackingAreas] + 96
	5   AppKit                              0x00007fff861ed8f5 -[NSFrameView _windowChangedKeyState] + 93
	6   AppKit                              0x00007fff861ed38e -[NSWindow _setFrameNeedsDisplay:] + 169
	7   AppKit                              0x00007fff861ea86b -[NSWindow _makeKeyRegardlessOfVisibility] + 104
	8   AppKit                              0x00007fff861ea7c5 -[NSWindow makeKeyAndOrderFront:] + 25
	9   liblwjgl.jnilib                     0x000000016c8073a1 Java_org_lwjgl_opengl_MacOSXDisplay_nCreateWindow + 657
	10  ???                                 0x000000010374ff90 0x0 + 4352966544
)
2012-10-25 23:44:24.261 java[1106:1107] *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSSetM: 0x7fb8fa8865d0> was mutated while being enumerated.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff8ee520a6 __exceptionPreprocess + 198
	1   libobjc.A.dylib                     0x00007fff889e63f0 objc_exception_throw + 43
	2   CoreFoundation                      0x00007fff8eee5f98 __NSFastEnumerationMutationHandler + 232
	3   AppKit                              0x00007fff860fd95e -[NSView trackingAreas] + 254
	4   AppKit                              0x00007fff861e435b -[NSView(NSInternal) _enableOrDisableTrackingAreas] + 96
	5   AppKit                              0x00007fff861ed8f5 -[NSFrameView _windowChangedKeyState] + 93
	6   AppKit                              0x00007fff861ed38e -[NSWindow _setFrameNeedsDisplay:] + 169
	7   AppKit                              0x00007fff861ea86b -[NSWindow _makeKeyRegardlessOfVisibility] + 104
	8   AppKit                              0x00007fff861ea7c5 -[NSWindow makeKeyAndOrderFront:] + 25
	9   liblwjgl.jnilib                     0x000000016c8073a1 Java_org_lwjgl_opengl_MacOSXDisplay_nCreateWindow + 657
	10  ???                                 0x000000010374ff90 0x0 + 4352966544
)
libc++abi.dylib: terminate called throwing an exception
Abort trap: 6

kappa

A branch is a good step to finally getting this work completed too.

@EmuMog you mentioned that you wanted to run a final beautification pass on the code, if you could please do this, we can then branch the LWJGL SVN trunk and merge your changes into it.

We can then focus on ironing out the last issues, including applying patches/fixes from others, once stable enough we can merge the branch back into truck and get out a new LWJGL release.

mc78

For anyone wanting a version controlled option to EmuMog's zipped files, I've added EmuMog's source files to my unofficial lwjgl git mirror.

The branch with EmuMog's changes is:
https://github.com/mcunha/lwjgl/tree/macos-jr7

The only changes I've applied was removing the SVN property expansions present in the original source files that were provided.

Matzon

Created branch for code: https://java-game-lib.svn.sourceforge.net/svnroot/java-game-lib/branches/osx-java7/
Applied 28008537/src.zip to branch.
EmuMog please PM me a sourceforge user name so I can give you write access.

kappa

Checked out branch, made some minor changes to allow it to compile, namely:-

Updated macosx_ant build.xml, removed PPC support, bumped the minimum OS X SDK for 32/64bit native to SDK 10.5. Commented out some code in Display.m that required SDK 10.7+, namely NSApplicationPresentationFullScreen, etc

Should be easier now for ppl to start hacking on it, fixing stuff and adding missing functionality. Just checkout and run build.xml to compile.

kappa

Fixed leaking memory issue by adding a NSAutoreleasePool to the nCreateWindow method in Display.m and a drain to nDestroyWindow.

There is still some elusive crash on exit bug which triggers on calling Display.destroy();

build for testing: https://www.dropbox.com/s/b6gj27dmoyo0h0j/macosx.zip

macdonag

Hi

I noticed some code was checked into a branch which seems to support Mac & Java 7.  I haven't had a chance to download it & build it yet.  Is it in a usable state?  If not, any idea when it might be or what's missing?

Thanks for the continued work on this, I was having no luck with the previous version (using VBOs, then getting a problem related to JAWT), so hopefully this branch will solve all my problems! :-)

kappa

Hi macdonag,

The code is still relatively fresh and unstable, although Emu's done a good job and completed the heavy lifting part, the PPC support has been dropped (making the natives smaller) and OS X 10.5 is the new minimum requirement, there still remains issues that need to be fixed and implemented. There are a few native crashes at the moment that need to be tracked down and fixed, some missing functionality needs to be added (e.g. native cursor support, etc) and to generally run tests on the API to find and fix calls so they all work as expected.

There are test builds above that you can download and try (do report back with how it goes) or you can check out the branch and hack at it to assist further.

mc78

I'm halfway through making a patch that adds the following to the build system:
- Detect if 10.6 SDK is available, and fallback to 10.7 if not. Building on 10.7+ will never have 10.6 SDK available [unless copied by hand by a developer from an old Snow Leopard install]
- Detect if gcc-4.2 still available, and fallbackk to just "gcc" if not. Snow Leopard and above dropped gcc-4.2 and they're not available on fresh installs.

macdonag

Hopefully this will be covered by mc78's fixes, but I got the following error trying to build on 10.8.2:

/Users/graham/Documents/Code/svn/java-game-lib/LWJGL/build.xml:478: The following error occurred while executing this line:
/Users/graham/Documents/Code/svn/java-game-lib/LWJGL/build.xml:511: The following error occurred while executing this line:
/Users/graham/Documents/Code/svn/java-game-lib/LWJGL/platform_build/macosx_ant/build.xml:59: The following error occurred while executing this line:
/Users/graham/Documents/Code/svn/java-game-lib/LWJGL/platform_build/macosx_ant/build.xml:22: Execute failed: java.io.IOException: Cannot run program "gcc-4.2" (in directory "/Users/graham/Documents/Code/svn/java-game-lib/LWJGL/bin/lwjgl/i386"): error=2, No such file or directory

kappa

Fixed a native crash on startup which should hopefully fix the above reported startup crashes. It was happening with Revenge of the Titans which I used for testing and debugging purposes, the game now runs on my setup mostly just as well as the stable version of LWJGL.

Latest test build: https://www.dropbox.com/s/b6gj27dmoyo0h0j/macosx.zip