Segfault at instance creation #755
-
I am trying out rust and ash to do some graphics, but after programming a bit, my program segfaulted. Removing more and more code while testing with valgrind finally showed me I get an invalid read at instance creation:
If I run this program (just a main calling the test function) with valgrind, I get the following result:
The segfault only gets noticed once in a while, so to increase the odds of valgrind finding it, I ran valgrind with My question: What could have gone wrong? Am I incorrectly using the Default functionality here? (Which would be weird because it also segfaulted without using the Default) Or could this be a driver issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think the code you pasted above should work fine. Judging by the backtrace, it looks like this is happening inside Why is your code not present in the backtrace you quoted? Can you get a more complete backtrace? Can you reproduce the issue with a debug libc? |
Beta Was this translation helpful? Give feedback.
Running valgrind with the
--num-calls=50
instead of the default 12 got me a longer stack trace, resulting in the following output: valgrind-memcheck_v18.txtI accidentally found out that an older version of valgrind has a bug in which stack traces are incorrectly shown which is solved in newer versions. I then saw I was indeed using an older version (version 3.18), so I updated the valgrind to 3.20. The funny thing is that suddenly valgrind did not find a segfault anymore!
I am wondering whether the initial memcheck contained a false positive, or if the newer version does not catch the error. I do know my original code, not the minimum reproducible code I've provided here, does in fact ha…