-
Notifications
You must be signed in to change notification settings - Fork 262
Frames of my crate disappears completely for some of the code; extreme case: add some useless code to function, then frames disappear #445
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
Comments
I don't understand what you are doing... You backtrace before you call |
@s1341 Sure! That is the strange thing. silly_function should NOT affect my backtrace printing. But it indeed does! I want to say, even doing such a seemingly unrelated thing, can cause frames to disappear. Thanks for the reply! |
|
Ah? It does not cause any stack overflows imho. I use |
I don't know then. I get backtraces when just using |
I am on armv7 (32bit). But rust should support this imho.
Have your app released to the market - i.e. I wonder whether it is ok on one phone, or ok on various kinds of phones (various version, etc)? |
I'm not writing an app. I'm mostly running tools via shell (adb). I get backtraces on a few different phones. |
Ah... Thanks |
A self-contained example that you can runrepo: https://github.com/fzyzcjy/flutter_rust_bridge/blob/experiment-backtrace/frb_example/with_flutter/README.md Please ignore those readme and other unrelated code in that example. The only useful code is only dozens of lines. Run it on android: https://github.com/fzyzcjy/flutter_rust_bridge/blob/experiment-backtrace/frb_example/with_flutter/run_android.sh Brief introduction to the useful code there
However, looking at the code below, the I know this minimal reproducible sample is not as special ("add lines of code and frames disappear"), but I cannot reproduce that on this repo (can only reproduce "frames disappear").
|
All right... I guess it is problem of inline. Adding |
Hm. Isn't "inlining can trash your backtraces" a known problem? |
EDIT: For a smaller example, see a commit below. I have added a small example that you can run.
Hi thanks for this lib! Yesterday's solution work pretty well, but then I encounter a problem. Sometimes, the stack is complete. However, it only works for some of my code, while the rest of my code cannot output full backtrace but missing many frames. An extreme example is shown below - even if I only add some dummy code that is useless, the stack trace is incomplete, and the frames of my crate just disappears completely. I mean, the unwinding step has problems - since the function address itself just disappears completely.
This is very annoying and I cannot use backtrace-rs at all in production environment if it just output no frames that I need... Any help is appreciated!
RUSTFLAGS="-Cforce-unwind-tables"
but no change.@kjvalencik Hi could you please give some suggestions? Thanks!
May also related: @bjorn3 @alexcrichton Not sure whether this is in your field; could you please also give some suggestions? Thanks!
For example, my old function:
yields stack trace (just focus on the stack trace itself, ignore other noise; the log is folded)
However, with following:
it becomes:
With the dummy function, but in debug mode: it works
The text was updated successfully, but these errors were encountered: