LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Just_A_Fork on September 11, 2017, 02:38:44

Title: stbi_load() sending error for unknown reason
Post by: Just_A_Fork on September 11, 2017, 02:38:44
I don't know why but keep getting this error (hs_err_pid6886.log) from java every time I run Main. if I comment it out it doesn't send the error if I comment it out so I'm pretty sure it's the problem. I think it might be a memory leak but if so I have no clue on how to fix it

note that I am using a mac to write this and I want it to be able to run on a mac. also, I am very new to lwjgl though I do have a little experience with c++ but only messing around.
Title: Re: stbi_load() sending error for unknown reason
Post by: spasi on September 11, 2017, 06:52:47
IntBuffer.allocate is being used in Sprite.java, which creates an IntBuffer backed by a Java heap array. This is not supported in LWJGL, off-heap buffers are required. Please read the Memory FAQ (https://github.com/LWJGL/lwjgl3-wiki/wiki/1.3.-Memory-FAQ) for more details and the recommended allocation strategies.
Title: Re: stbi_load() sending error for unknown reason
Post by: Cornix on September 11, 2017, 09:17:26
There are a lot of threads all with the same problem recently. Would it be possible to detect such a situation programmatically within LWJGL3 and print an appropriate error message?
Title: Re: stbi_load() sending error for unknown reason
Post by: spasi on September 11, 2017, 10:50:53
This error, and many more, are covered by LWJGLX/debug (https://github.com/LWJGLX/debug).
Title: Re: stbi_load() sending error for unknown reason
Post by: Cornix on September 11, 2017, 13:17:34
Well, in that case I guess its just laziness.
Title: Re: stbi_load() sending error for unknown reason
Post by: spasi on September 11, 2017, 15:03:00
What is lazy exactly?
Title: Re: stbi_load() sending error for unknown reason
Post by: Cornix on September 11, 2017, 15:03:45
I meant laziness from the users who rather ask in the forums instead of using the Debug build to find out what went wrong immediately.

There isnt much you can do about lazy users.
Title: Re: stbi_load() sending error for unknown reason
Post by: Just_A_Fork on September 11, 2017, 17:28:52
Quote from: spasi on September 11, 2017, 06:52:47
IntBuffer.allocate is being used in Sprite.java, which creates an IntBuffer backed by a Java heap array. This is not supported in LWJGL, off-heap buffers are required. Please read the Memory FAQ (https://github.com/LWJGL/lwjgl3-wiki/wiki/1.3.-Memory-FAQ) for more details and the recommended allocation strategies.

thank you so much it's working well now