Closed GoogleCodeExporter closed 8 years ago
More specifically I can tell that LibJogl is responsible for the crash, but
maybe that's a result from incorrect usage somewhere inside MT4j? Or it is just
LibJogl.
Original comment by michael....@gmail.com
on 1 Mar 2011 at 10:20
Crash report in attachment.
Original comment by michael....@gmail.com
on 2 Mar 2011 at 9:42
Attachments:
And this is the terminal output:
INFO - Platform: "Mac OS X" -> Version: "10.6.6" -> JVM Bit: "64"
INFO - Platform: "Mac OS X" -> Version: "10.6.6" -> JVM Bit: "64"
INFO - MT4j window dimensions: "1920 X 1200"
INFO - Maximum framerate: "60"
INFO - OpenGL Version: "2.1 NVIDIA-1.6.26" - Vendor: "NVIDIA Corporation" -
Renderer: "NVIDIA GeForce GT 130 OpenGL Engine"
INFO - Non power of two texture sizes allowed: "true"
INFO - OpenGL Framebuffer Object Extension available: "true"
INFO - Vertical Sync enabled: "true"
INFO - OpenGL multi-sampling enabled.
INFO - Initializing TUIO input on port: 3333
INFO - Loading new font "fonts/Trebuchet MS.ttf" with factory:
org.mt4j.components.visibleComponents.font.fontFactories.TTFontFactory
INFO - Loading new font "SansSerif" with factory:
org.mt4j.components.visibleComponents.font.fontFactories.BitmapFontFactory
Invalid memory access of location 0x0 rip=0x7fff88ecf2c8
Original comment by michael....@gmail.com
on 2 Mar 2011 at 9:47
The one from the crash report happens at the creation of the MTTextArea where a
default font is created, called SansSerif. If I give the first font created as
a parameter to the constructor the crash does not happen.
Original comment by michael....@gmail.com
on 2 Mar 2011 at 9:51
Judging from the crash report I think I know what the problem is. You seem to
create OpenGL resources (textures for the bitmap default font) in another
thread, which is not the OpenGL thread (main mt4j thread).
OpenGL is not designed for multithreaded usage, so OpenGL funcitonalitly should
only be accessed in the thread where the OpenGL context is current. Else,
errors like this can happen which often dont give the right hint to where the
problem really lies..
So the solution would be to create the font in the main thread.
Also useful if using different threads is to use the
MTApplication.invokeLater(Runnable runnable) method to schedule a piece of code
to run in the main thread on the start of the next frame.
See also:
http://mt4j.org/mediawiki/index.php/FAQ#How_to_avoid_threading_problems_.3F
Original comment by sirhc.f...@gmail.com
on 2 Mar 2011 at 10:02
Thanks for the rapid response. I already suspected threading as it only started
when I introduced an extra thread for the retrieval of books. Apparently the
observer pattern in java uses the same thread as the notifyObservers is invoked
in and this would indeed result in the problem mentioned above.
Original comment by michael....@gmail.com
on 2 Mar 2011 at 10:05
Original comment by sirhc.f...@gmail.com
on 2 Mar 2011 at 10:34
Original issue reported on code.google.com by
michael....@gmail.com
on 28 Feb 2011 at 8:38