-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when using Java interface on Windows #690
Comments
Thanks for the report. @ShukantPal please look into this? |
By trampled, do you mean libktx is corrupting the original byte array? This would seem like a bug in the encoder, but I can try debugging when I have time @MarkCallow. |
I assume that's what @robnugent is saying.
Yes it would but we have many native tests of the ASTC encoder and we don't see these crashes. Mind you we aren't doing 500 iterations. The person most familiar with the ASTC encoder is on vacation until the start of May and since the test case is Java, please try debugging when you have time. |
Mark - yes - apologies for not being clear - that's what I meant - or more accurately, it's probably the JVM's control structures pertaining to the byte array that have been corrupted. I put a dignostic message in Java_org_khronos_ktx_KtxTexture_setImageFromMemory() thus:
and in free_buffer_list() thus:
Which gives me the following two lines of output before the crash inside ReleaseByteArrayElements():
So valid values are being given to the ReleaseByteArrayElements call, i.e. the same ones obtained from the prior GetByteArrayElements() call, which should have no reason to fail. I hope this helps - many thanks for looking into this, and thanks again for providing this software in the first place. |
In case it helps, here's a tweak of my original testcase that uses multiple threads and random texture sizes. This crashes quicker for me, even if the number of threads is set to 1, including in Windows/ARM64 where my previous test did not reliably fail.
|
Hello,
First off, many thanks for providing toktx and the Java interface. I'm using this to compress about 12,000 GIS related textures to ASTC format, but I'm seeing a persistent crash in KtxTexture2.destroy().
I've done my best to reduce this to a simple testcase. Here it is:
On my Windows x64 box, this reliably crashes after about 400-500 iterations:
The stack trace in the hotspot dump file is:
I managed to put some printfs in the native code, and it seems to be crashing inside the call to ReleaseByteArrayElements in KtxTexture.free_buffer_list(). The argment passed to ReleaseByteArrayElements look good and match those from the corresponding getByteArrayElements() so I suspect storage is getting trampled during execution of the encoder.
Two other comments:
Many thanks in advance if you are able to look into this.
Regards,
Rob
The text was updated successfully, but these errors were encountered: