JNI Application best practices

4 views
Skip to first unread message

Logan Riggs

unread,
Jun 10, 2025, 2:29:24 PMJun 10
to Google Breakpad Development
Hi,

I have a Java app which uses JNI/C++ and I would like to use crashpad to get minidumps for native crashes. I have this working but ran into a problem. 

I get a minidump but no useable stack when I start the crashpad handler from a JNI function call, and then later another JNI function crashes. I get a dump and useable stack if I use the same code to start the handler in the same JNI function which crashes.

Is there any reason starting the handler in one function and crashing in another wouldn't work? The CrashpadClient is a global static variable. Why is it creating a minidump without a useable stack (after providing symbols)? 

The other apporach I tried was starting the handler from a simple C++ app and then starting my Java process from the same app. This works fine, and I use the get socket method to link/register them via setting an environment variable which the JNI code can access. 

I noticed that when I don't register the handler in the second approach I get a minidump with no useable stack like in my two function JNI example.

Is there a best practice for using crashpad with JNI applications?

Thanks,
Logan
Reply all
Reply to author
Forward
0 new messages