New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing assertion while reading/appending dwarf #5553
Removing assertion while reading/appending dwarf #5553
Conversation
This bug has previously been reported as #3999 as well as several duplicates, but we haven't had any suggestions for how to fix it before. Thanks for this PR! I don't know whether removing this assert is correct. It might be! But I think the effect is that the As noted in other issues about this bug:
|
Minimal repro:
Steps to Reproduce
|
Can't we just print a warning, remove the assertion and exit the function? |
@alexcrichton and @fitzgen, do either of you have opinions on this suggestion? If you can spare some more time to investigate this bug, I'd be happier if we better understood its cause.
At that point there's a somewhat complex interaction between the I think a good first troubleshooting step would be to assert that Then we could check why these ranges are out of order. I think the only possibilities are either that Either way we'd know more than we know now and be closer to fixing this particular bug. |
I am generally very suspicious of sweeping-the-bugs-under-the-rug kind of thing. If it was a bug that was purely within the DWARF transform, then I would be more amenable to it since that code as-is has no future and needs a rewrite, but since it looks like this is bottoming out in Cranelift, I think it would be better to debug the Cranelift issue like you laid out. |
I personally know so little about the DWARF transformations Wasmtime does that I don't think I'd have much to offer over what @jameysharp has already mentioned. |
The dwarf parser in chrome doesn't fail on it. Speculations (I know little about all this yet): |
That sounds possible to me but, like you, I know little about all of this. I think it's unlikely, if I'm reading the Wasmtime/Cranelift source correctly. I think the point of the |
fwiw, when I kicked on this a little bit, |
I've asked @thaystg to have a look at this again if she has time, @jameysharp, per our conversation the other day about debugging with the crew. |
Same here, removing the assertion did not fix the problem, but changing the if statement above to continue if |
I'm pretty sure that can make it impossible to single step at several places and will cause incorrect assignments from machine instructions to source lines. |
I was able to both single step and set breakpoints, and I didn't observe any strange instruction to source line assignments. Now I know absolutely nothing about dwarf, and I'm sure you're right that there will be bugs. But from my perspective an unstable debugger is better than no debugger at all. At least for the time being. |
In the time since this PR was opened I think #6931 addresed the underlying issue. I think this is no longer necessary so I'm going to close this, but please let me know if I'm wrong. |
While loading dwarf from this wasm file attached here in dotnet.zip, I got this error:
thread 'main' panicked at 'assertion failed: range_start < range_end', crates\cranelift\src\debug\transform\expression.rs:689:13
I tried to remove the assert and check if without it the debugging experience on lldb works correctly and as far as I saw in my tests, everything is working fine after removing the assert.
dotnet.zip
If you think this is not the correct fix, please let me know, I can close the PR and open an issue.