Why does valgrind crash
-
I have an app that seems to run fine compiled normally, and with debug. However, when I run it from valgrind I get error:
17:35:07: Process exited with return value Process crashedI tried running with Valgrind+GDB but it stops at a line outside of my code. The GDB stops on function ??, with one more line in the backtrace ??, and the first at address 0x50ccb9c. The valgrind window shows "(action on error) vgdb me ..."
I have ensured I have the latest valgrind and gdb installed. I'm stuck...how do I find the line causing the crash?
-
I have an app that seems to run fine compiled normally, and with debug. However, when I run it from valgrind I get error:
17:35:07: Process exited with return value Process crashedI tried running with Valgrind+GDB but it stops at a line outside of my code. The GDB stops on function ??, with one more line in the backtrace ??, and the first at address 0x50ccb9c. The valgrind window shows "(action on error) vgdb me ..."
I have ensured I have the latest valgrind and gdb installed. I'm stuck...how do I find the line causing the crash?
-
@JoeCFD It works perfectly if run only from gdb. If I run only with valgrind it crashes, and if with valgrind+gdb it crashes. So valgrind is exposing some flaw...
I tried to run gdb with record (to play backwards) but it fails due to unsupported instruction.
This seems to be a Heisenberg bug
-
@JoeCFD It works perfectly if run only from gdb. If I run only with valgrind it crashes, and if with valgrind+gdb it crashes. So valgrind is exposing some flaw...
I tried to run gdb with record (to play backwards) but it fails due to unsupported instruction.
This seems to be a Heisenberg bug
-
@JoeCFD It's part of a larger system...so not a simple build and test. But I'll try compiling and valgrind on another OS in case that makes a difference
@ocgltd
I don't know if this will help, but there are clearly "issues" from time to time with valgrind changing behaviour. Just the other day I "valgrinded" a program of mine which opens the Linux "select directory dialog box". The first time it let me select directories; after that most of the time it would show the directories as before in the dialog but everything was disabled and I could not select them. No problem outside of valgrind, and I am 100% sure it was not my code. So, for whatever, reason, here at least valgrind incorrectly caused a behaviour change. I'm not sure whether I have had it "crash" on me, it might have done. So just saying, it's not perfect. -
@ocgltd
I don't know if this will help, but there are clearly "issues" from time to time with valgrind changing behaviour. Just the other day I "valgrinded" a program of mine which opens the Linux "select directory dialog box". The first time it let me select directories; after that most of the time it would show the directories as before in the dialog but everything was disabled and I could not select them. No problem outside of valgrind, and I am 100% sure it was not my code. So, for whatever, reason, here at least valgrind incorrectly caused a behaviour change. I'm not sure whether I have had it "crash" on me, it might have done. So just saying, it's not perfect.I found a clue here:
Debugging Code that Uses QRegularExpression QRegularExpression internally uses a just in time compiler (JIT) to optimize the execution of the matching algorithm. The JIT makes extensive usage of self-modifying code, which can lead debugging tools such as Valgrind to crash. You must enable all checks for self-modifying code if you want to debug programs using QRegularExpression (for instance, Valgrind's --smc-check command line option). The downside of enabling such checks is that your program will run considerably slower. To avoid that, the JIT is disabled by default if you compile Qt in debug mode. It is possible to override the default and enable or disable the JIT usage (both in debug or release mode) by setting the QT_ENABLE_REGEXP_JIT environment variable to a non-zero or zero value respectively.I'll refine my question and post something new! and more focused!