Login  Register

Re: NullPointerException from native method

Posted by Sven Gothel on Apr 12, 2023; 9:25pm
URL: https://forum.jogamp.org/NullPointerException-from-native-method-tp4042433p4042438.html

w/o looking at the dispatch generated code, it highly likely is a java object reference being null
while trying to use it (dereference). Otherwise we would have a SIGSEGV not a Java NPE.

Hence .. possible you pass 'null' to the CL method?

Now looking at the generated C code, we dereference all buffers if not null,
i.e. calling `GetDirectBufferAddress()` if( NULL != ... ).

Then we have one C assert on the native function pointer (disabled)
and call into (*ptr_clEnqueueNDRangeKernel)(...).
This latter call can't make a Java NPE, hence it must be one of the buffer usage earlier.

If you have a small reproducing test case, I like to have a look at it.