1

I have a native library that has a native crash. The crash doesn't happen consistently and I can't reproduce it. I have access to Google breakpad's minidump and last few thousands LogCat lines from the users. The method doesn't crash all the time so I suspect perhaps it crashes because of specific param values that I haven't checked. Unfortunately this is a method that's called a lot so I can't log to LogCat all the time.

I understand that try/catch doesn't work for SIGSEGV. But is there a similar mechanism?

Something like this https://stackoverflow.com/a/2436368/4092412.

Motoko
  • 1,062
  • 2
  • 15
  • 32
  • You posted the only thing that might work. But the seg error message will tell you everything that does. I'm not sure what you hope to capture. – Gabe Sechan Sep 29 '21 at 00:18
  • The answers on the question you linked are utterly horrendous - don't try using any of them. Some of the comments there akin to "Calling `printf()` in a signal handler is safe!" are utterly ***WRONG***. A SEGV because of heap corruption is common, so the SEGV happens with the heap locked. And `printf()` usually uses the heap. See where that's going? Every one of the answers to that question are, to paraphrase a commenter there, ***TOYS*** not suited for real use. – Andrew Henle Sep 29 '21 at 12:59
  • I'm not a C/C++ expert. Is it possible to check if an object has been de-referenced in C++? According to this answer https://stackoverflow.com/a/28116503/4092412, I'm thinking I can try checking each variable and parameter to see which one has been de-referenced, and print to LogCat accordingly. – Motoko Sep 29 '21 at 17:47
  • Also I found out that it's not possible to check if a pointer has been dereferenced? – Motoko Sep 30 '21 at 00:20

0 Answers0