jfrimmel/cargo-valgrind

cargo valgrind unexpectedly crashed (but may be misbehaving instrumented program)

barafael opened this issue · 7 comments

Reporting this here, since cargo-valgrind asked me nicely to do so.

Project: https://github.com/barafael/crisp/tree/cargo-valgrind-bug. There is a note in main.rs with a possibly related call to free.

Gist of trace (because it's too long for GitHub issue): https://gist.github.com/barafael/8360ad9aa31fc747fd53568be2bb35cc

Steps to reproduce

  • Clone project on branch cargo-valgrind-bug
  • Run cargo valgrind run
  • Enter * 1 2
  • Hit CTRL-C

Note, I just found out it's actually a double free at lval_del(tree). Suppose I can close the issue? Undefined behaviour in the observed program is not a bug in cargo-valgrind, is it :D

Thanks for opening this issue. You've done everything right: even if your program has an issue, cargo valgrind should handle it gracefully and tell you the error 😉
Thanks for the reproducer as well, I'll try to publish a fix soon1.

Footnotes

  1. just for your information: you can also attach the output as a file or use the following HTML tags to make the output collapsible: <details><summary>Click to expand!</summary>Content with linebreaks</details>. But the Gist is, of course fine as well.

Could you try out the release 2.1.0? This nicht contain the fix for your issue.

hmm, I cannot reproduce the issue anymore with any of the previous versions or the current version. I'm seeing the expected output from valgrind, instead.

So, it seems this issue is resolved now? That would be very nice! Regardless, I'll do some more testing on the weekend when I have some time :)

I have again installed version 2.0.3, with which I had originally observed this issue. However, now I fail to reproduce it. Perhaps, clang and valgrind versions play a role? The observed program was anyway exhibiting undefined behaviour... What do you think, can we close this issue? Seems to me yes.

Yeah, you're right, let's close this issue then. GitHub makes it easy to reopen it, should the issue arise again. In this case: feel free to re-open.

Thanks!