-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
stack traces are broken when debug info is disabled, per design #42776
Comments
Looks like debug info was disabled, so we can't be expected to give good results when that was removed |
What is PackageCompiler doing wrong that results in the debug info being disabled? |
FWIW, the REPL-frame-scrubbing code is located in This is something I addressed in my https://github.com/BioTurboNick/AbbreviatedStackTraces.jl package, and I believe it can be done by amending the test as follows:
|
@BioTurboNick's solution works for me! I can't do a full test though because I haven't been able to build julia from source. Just reading the code, the logic seems foolproof though. Also worth noting that AbbreviatedStackTraces already handles sysimages gracefully (I'll be putting this in my startup file!) |
Hi @vtjnash, it sounds like you don't think this should be fixed in Julia. Can you give us any hints on what PackageCompiler can do to keep debug info enabled? Or even, how can you tell that debug info is disabled? |
I can tell it is disabled since it does not print any debug info. I assume you turned it off somewhere, since it doesn't look like PackageCompiler uses the |
Gosh, I'm sorry if this is just user error, but I don't think I've used the g flag either. What information is missing in my stack trace? I just went through the above steps again explicitly passing -g 2 (which should be more verbose than the default right?) and I get nearly exactly the same output. The only difference is that the first line of the stack trace is attributed to
To be clear, when you run my example, you get a short stack trace? I've replicated this on both mac and linux so it's not super likely to be an OS thing... |
Yes, the difference in the stack trace shows that it has gone from disabled to enabled. I get a short stack trace, testing my source build on linux with julia master. |
FWIW a similar issue was reported to me from someone else using PackageCompiler, which is why my package was able to address it. So something is going on somewhere... Like vtjnash, I don't see your issue on my Windows system with that example, with Julia 1.6.3. Also WSL with a 4-day-old master branch. Debug info that's missing includes inlined frames (which is why |
Ah, I think I cut off the stack trace in an unfortunate position. Here are a few more lines
So, I do still have missing line numbers, even when explicitly passing -g 2 when building and using the sysimage. However, given that neither of you can reproduce this problem, it seems like this is probably some weird idiosyncratic thing with my system (although perhaps not entirely unique to me). Given that Nick's package solves the issue for me, perhaps it's not worth putting more time into this. |
When passing a --sysimage argument (generated by PackageCompiler.jl), stack traces have many (at least nine) extraneous lines for
REPL
andBase
code. In practice, this means one usually has to scroll to see the relevant part of an error message, which has a substantial negative impact on workflow.Here is without a sysimage
and with a sysimage (an "empty" one, generated with
create_sysimage([], sysimage_path="17.so")
This example was generated with v1.7.0-rc2, but it's the same in v1.6.0.
I was planning to try to address this in
Base._simplify_include_frames
(context: JuliaLang/PackageCompiler.jl#517 and #41566) but I realized that it isn't specific toinclude
. I assume there is some similar code somewhere else that usually removes the extraneous REPL and Base lines, but doesn't work with a sysimage. I couldn't find it in errorshow.jl though.I'd like to debug/fix this, but it would help to know where to start. I scanned through errorshow.jl and couldn't find anything relevant. Maybe @c42f or @KristofferC might have an idea?
The text was updated successfully, but these errors were encountered: