Prevent crashes when ending fullscreenmode?

Hi!

It’s been a while since I posted last, but here comes new problems that I need your help with;)

I run my 2D games in fullscreen mode and it works great, besides frmo the fact that it generates (sometimes!) a rather ugly .log crash file when I exit the game. This seems to be a common error and I’ve seen it in other peoples demos and stuff.

I’ve read around in this forum quit a lot and some say that “fullscreen can be a bit buggy” and that you “have to work around it” and I’m quit interested in HOW to do that :wink:

Concluding:
How can I prevent my fullscreen, active rendering application (bufferstrategy) to end so badly when I exit?

Here’s an output from a typical .log file
(hs_err_pid4068.log)

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D069916
Function=Java_sun_print_Win32PrintJob_printRawData+0x4F26
Library=C:\Program\JBuilder9\jdk1.4\jre\bin\awt.dll

Current Java thread:
at sun.java2d.DefaultDisposerRecord.invokeNativeDispose(Native Method)
at sun.java2d.DefaultDisposerRecord.dispose(DefaultDisposerRecord.java:24)
at sun.java2d.Disposer.run(Disposer.java:99)
at java.lang.Thread.run(Thread.java:536)

Dynamic libraries:
0x00400000 - 0x00407000 C:\Program\JBuilder9\jdk1.4\bin\javaw.exe
0x77F50000 - 0x77FF9000 C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F4A000 C:\WINDOWS\system32\kernel32.dll
0x77DC0000 - 0x77E5D000 C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78086000 C:\WINDOWS\system32\RPCRT4.dll
0x77D30000 - 0x77DBC000 C:\WINDOWS\system32\USER32.dll
0x77C60000 - 0x77CA0000 C:\WINDOWS\system32\GDI32.dll
0x77C00000 - 0x77C53000 C:\WINDOWS\system32\MSVCRT.dll
0x6D340000 - 0x6D46A000 C:\Program\JBuilder9\jdk1.4\jre\bin\client\jvm.dll
0x76B30000 - 0x76B5D000 C:\WINDOWS\System32\WINMM.dll
0x5D270000 - 0x5D277000 C:\WINDOWS\System32\serwvdrv.dll
0x5B5A0000 - 0x5B5A7000 C:\WINDOWS\System32\umdmxfrm.dll
0x6D1E0000 - 0x6D1E7000 C:\Program\JBuilder9\jdk1.4\jre\bin\hpi.dll
0x6D310000 - 0x6D31E000 C:\Program\JBuilder9\jdk1.4\jre\bin\verify.dll
0x6D220000 - 0x6D239000 C:\Program\JBuilder9\jdk1.4\jre\bin\java.dll
0x6D330000 - 0x6D33D000 C:\Program\JBuilder9\jdk1.4\jre\bin\zip.dll
0x10000000 - 0x1001E000 E:\Projects\Kidwo\KidwoClient\TrayIcon12.dll
0x773C0000 - 0x77BB4000 C:\WINDOWS\system32\SHELL32.DLL
0x70A70000 - 0x70AD5000 C:\WINDOWS\system32\SHLWAPI.dll
0x78090000 - 0x78174000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.10.0_x-ww_f7fb5805\comctl32.dll
0x77330000 - 0x773BB000 C:\WINDOWS\system32\comctl32.dll
0x5B270000 - 0x5B2A4000 C:\WINDOWS\System32\uxtheme.dll
0x6D2E0000 - 0x6D2EE000 C:\Program\JBuilder9\jdk1.4\jre\bin\net.dll
0x71AC0000 - 0x71AC9000 C:\WINDOWS\System32\WSOCK32.dll
0x71AA0000 - 0x71AB4000 C:\WINDOWS\System32\WS2_32.dll
0x71A90000 - 0x71A98000 C:\WINDOWS\System32\WS2HELP.dll
0x746F0000 - 0x74734000 C:\WINDOWS\System32\MSCTF.dll
0x63000000 - 0x63014000 C:\WINDOWS\System32\SynTPFcs.dll
0x77BF0000 - 0x77BF7000 C:\WINDOWS\system32\VERSION.dll
0x71A40000 - 0x71A7C000 C:\WINDOWS\system32\mswsock.dll
0x0B390000 - 0x0B397000 C:\Program\Logitech\MouseWare\System\LgWndHk.dll
0x71A80000 - 0x71A88000 C:\WINDOWS\System32\wshtcpip.dll
0x6D000000 - 0x6D105000 C:\Program\JBuilder9\jdk1.4\jre\bin\awt.dll
0x72FD0000 - 0x72FF3000 C:\WINDOWS\System32\WINSPOOL.DRV
0x76370000 - 0x7638C000 C:\WINDOWS\System32\IMM32.dll
0x7CCC0000 - 0x7CDE1000 C:\WINDOWS\system32\ole32.dll
0x73730000 - 0x73774000 C:\WINDOWS\System32\ddraw.dll
0x73B90000 - 0x73B96000 C:\WINDOWS\System32\DCIMAN32.dll
0x73910000 - 0x739D7000 C:\WINDOWS\System32\D3DIM700.DLL
0x6D190000 - 0x6D1E0000 C:\Program\JBuilder9\jdk1.4\jre\bin\fontmanager.dll
0x0F5D0000 - 0x0F5D7000 C:\Program\Logitech\iTouch\iTchHk.dll
0x0F5F0000 - 0x0F5FB000 C:\Program\Delade filer\Logitech\Scrolling\LgMsgHk.dll
0x76060000 - 0x760C1000 C:\WINDOWS\System32\MSVCP60.dll
0x6D2B0000 - 0x6D2D1000 C:\Program\JBuilder9\jdk1.4\jre\bin\jsound.dll
0x72CF0000 - 0x72CF9000 C:\WINDOWS\System32\wdmaud.drv
0x72CE0000 - 0x72CE8000 C:\WINDOWS\System32\msacm32.drv
0x77BD0000 - 0x77BE4000 C:\WINDOWS\System32\MSACM32.dll
0x77BC0000 - 0x77BC7000 C:\WINDOWS\System32\midimap.dll
0x6D290000 - 0x6D2AE000 C:\Program\JBuilder9\jdk1.4\jre\bin\jpeg.dll
0x10420000 - 0x10436000 E:\Projects\Kidwo\KidwoClient\timer.dll
0x76C80000 - 0x76CA2000 C:\WINDOWS\system32\imagehlp.dll
0x6DAA0000 - 0x6DB1D000 C:\WINDOWS\system32\DBGHELP.dll
0x76BE0000 - 0x76BEB000 C:\WINDOWS\System32\PSAPI.DLL

Local Time = Thu Dec 04 14:07:12 2003
Elapsed Time = 19

The exception above was detected in native code outside the VM

Java VM: Java HotSpot™ Client VM (1.4.1_02-b06 mixed mode)

And another version of crashing when closing down my fullscreenmode:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x0
Function=[Unknown.]
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.

Current Java thread:
at sun.awt.windows.Win32BackBufferSurfaceData.initSurface(Native Method)
at sun.awt.windows.Win32BackBufferSurfaceData.createData(Win32BackBufferSurfaceData.java:49)
at sun.awt.windows.Win32BackBuffer.createHWData(Win32BackBuffer.java:28)
at sun.awt.windows.WVolatileImage.initAcceleratedBackground(WVolatileImage.java:100)
at sun.awt.windows.Win32BackBuffer.displayChanged(Win32BackBuffer.java:35)
at sun.awt.SunDisplayChanger.notifyListeners(SunDisplayChanger.java:102)
at sun.awt.Win32GraphicsEnvironment.displayChanged(Win32GraphicsEnvironment.java:98)
at sun.awt.windows.WToolkit$4.run(WToolkit.java:723)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

Both are known bugs, fixed in 1.5 (beta should be out sometime early next year)…

Ah these are good news ! This would be great and a lot of ppl will use fullscreen mode in normal applets with standard sun jre ( no jogl or other extensions )

[quote]Both are known bugs, fixed in 1.5 (beta should be out sometime early next year)…
[/quote]
JavaLobby newsletter indicated the early access for JavaLobby members is targeted for Dec 15th but no later than Dec 22 before the Holiday break.

No good thing can come out from this early access stuff… You will be filing new bugs, and i will be unhappy…

There is a quick and dirty workaround, DO NOT call dispose when u end your app , call System.exit

[quote]There is a quick and dirty workaround, DO NOT call dispose when u end your app , call System.exit
[/quote]
50% of the time doing that causes the crash on my machine :-/

Disposing of the window on the other hand works just fine on my machine. :stuck_out_tongue:

Don’t write any bugs, and we won’t be able to find them :smiley:

I found that I get crashes only when I run my app from an IDE (I use JCreator 2.5 lite). I have found that if I run the app from the command line I never experience the crash. But yeah in any case it has been aknowledged and fixed in the upcoming 1.5.

[quote]No good thing can come out from this early access stuff… You will be filing new bugs, and i will be unhappy…
[/quote]
LOL!! :smiley: :smiley:

What! You mean there are bugs in that code?? What did you do that for? Next, time just omit the bugs and then we will all be happy ;D

[trembovetski is carefully putting a huge banner reading “STOP MAKING BUGS IN THE CODE, STUPID!” in red letters onto his office wall]

i think if u call Frame.setFullScreenWindow(null);
and then system.exit(0); it will not create weird errors

it works pretty good for me anyway

setFullScreenWindow(null);

yes its a MUST, return from FULLSCREEN ( what i thought you were doing ) and call then System.exit(

has any1 risked testing fullscreen/bufferstrategy with the 1.5 beta? :smiley:

Please, do test your apps with pre-alpha… The earlier we get the feedback, the more chance there is that we’ll be able to fix the problems you may run into…