[Solved] Errors when using newer version of LWJGL 3

Started by bobjob, July 09, 2017, 05:29:15

Previous topic - Next topic

spasi

Ouch. That shouldn't happen.

First thing we can try is earlier jemalloc versions. Could you please try jemalloc.dylib from the LWJGL 3.1.0 and 3.1.1 releases? You can download it from here, using the "Click to browse..." functionality. Use -Dorg.lwjgl.system.jemalloc.libname=<path_to_jemalloc.dylib> to override the library to load and -Dorg.lwjgl.util.DebugLoader=true to verify that the correct one is being loaded.

If you could also share a minimal program that reproduces the issue, it would be very useful.

bobjob

I downloaded the dylib files via browsing from the download page:

3.1.2
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loading library: /Volumes/Backup/lwjgl/3.1.2/libjemalloc.dylib
[LWJGL] 	Success
[LWJGL] MemoryUtil allocator: JEmallocAllocator

I can confirm the bug.

3.1.1
[LWJGL] Loading library: /Volumes/Backup/lwjgl/3.1.1/libjemalloc.dylib
[LWJGL] 	Success
[LWJGL] MemoryUtil allocator: JEmallocAllocator

I could NOT confirm the bug exists.

3.1.0
[LWJGL] Loading library: /Volumes/Backup/lwjgl/3.1.0/libjemalloc.dylib
[LWJGL] 	Success
[LWJGL] MemoryUtil allocator: JEmallocAllocator

I also could NOT observe the bug with this version

I will attempt to create a small program that that loads and unloads 2 seperate font files one on the main thread while the other loads on a background thread (both looping) to try reproduce the error.

bobjob

I was able to produce a simple program that loads 2 fonts at the same time.

QuoteHardware Overview:

  Model Name:   MacBook Pro
  Model Identifier:   MacBookPro12,1
  Processor Name:   Intel Core i5
  Processor Speed:   2.7 GHz
  Number of Processors:   1
  Total Number of Cores:   2
  L2 Cache (per Core):   256 KB
  L3 Cache:   3 MB
  Memory:   8 GB
  Boot ROM Version:   MBP121.0167.B24
  SMC Version (system):   2.28f7

The error would only occur when using the 3.1.2 version of jemalloc

Please note: this zip contains two ttf (font) files. It is a heavily stripped down version of my code. if its not clean enough I should be able to add comments and fix it. All of the relevant code should be in Program.java file and the draw2DOverlay() method body (inside Program.java)

spasi

Minor status update: I have reproduced it (only on macOS with jemalloc 3.1.2). Will post again when I have a better understanding of the issue.

spasi

Looks like building jemalloc without --enable-tls and --enable-lazy-lock fixes it.

spasi

Sorry for the delay, 3.1.3 #5 is now available with a, hopefully, fixed jemalloc build. Could you please give it a try?

bobjob

Brilliant, I was not able to observe the bug in that latest version.

Thanks spasi. Im always impressed by the way you have a nack for fixing code.