coregrind/m_debuginfo/storage.c has asserts that lineno >= 0. For some strange reason, when we (the developers of Julia) build julia against LLVM 3.7 (svn), it reports at times a line number of -1. We've yet to figure out why, but in the meantime we've patched valgrind so that it provides a warning instead of exiting. I am filing this bug to offer this patch upstream. I think a warning in this case makes sense -- after all, valgrind already provides a warning for a huge lineno (greater than MAX_LINENO), and nothing is lost by continuing when a negative line number is reported. There is a second place in the same file that asserts lineno >= 0. I've been unable to trigger this code path, but could patch it as well to give a warning. Reproducible: Always Steps to Reproduce: 1. Compile Julia master (https://github.com/JuliaLang/julia) against LLVM svn (3.7) 2. Run julia under nulgrind Actual Results: valgrind: m_debuginfo/storage.c:535 (vgModuleLocal_addLineInfo): Assertion 'lineno >= 0' failed. (and exit in failure) Expected Results: Provide a warning I will upload a patch as soon as I figure out how.
Created attachment 92880 [details] Patch to change assertion to warning
Is there a corresponding LLVM bug? Surely, a negative line number does not sound right. Or does LLVM use negative line numbers on purpose to refer to special source locations such as builtin macros or the command line?
Committed, r15544. Thanks for the patch.
Created attachment 96955 [details] Remove other lineno>=0 assertion. Similar to the original report, I've also been running into a negative lineno assertion, using valgrind from SVN trunk with Julia using LLVM 3.7. I assume the remaining `lineno >= 0` assertion (for inlined calls) needs to be axed as well? Attached is a small patch.
Transformed the other assert for negative line number in a complain once + refactorisation of the checking committed in revision 15780. Thanks for the patch