Skip to content
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

Native crash doesn't give stack trace in Android #2576

Open
RenjieTang opened this issue Sep 28, 2022 · 2 comments
Open

Native crash doesn't give stack trace in Android #2576

RenjieTang opened this issue Sep 28, 2022 · 2 comments

Comments

@RenjieTang
Copy link
Contributor

RenjieTang commented Sep 28, 2022

Steps to reproduce:

  1. Add a ASSERT(false) in Envoy, for example at https://github.com/envoyproxy/envoy/blob/main/source/common/upstream/upstream_impl.cc#L920
  2. Build the Envoy-mobile sample app ./bazelw mobile-install //examples/java/hello_world:hello_envoy
  3. Run the app with adb logcat on.

What's expected:
adb prints a crash stack trace.

What happened instead:
No stack trace, only have a general process died log:

09-28 13:10:20.768  1671  5051 I ActivityManager: Process io.envoyproxy.envoymobile.helloenvoy (pid 10684) has died: fg  TOP 
09-28 13:10:20.768  1671  2379 I libprocessgroup: Successfully killed process cgroup uid 10251 pid 10684 in 0ms
09-28 13:10:20.769  1671  5051 W ActivityTaskManager: Force removing ActivityRecord{f4df7a5 u0 io.envoyproxy.envoymobile.helloenvoy/.MainActivity t64}: app died, no saved state
09-28 13:10:20.771   923   923 I Zygote  : Process 10684 exited due to signal 6 (Aborted)
09-28 13:10:20.772  1671  5051 W InputManager-JNI: Input channel object '4b4d0 io.envoyproxy.envoymobile.helloenvoy/io.envoyproxy.envoymobile.helloenvoy.MainActivity (client)' was disposed without first being removed with the input manager!
@jpsim
Copy link
Contributor

jpsim commented Sep 29, 2022

I believe you need to build with debug mapping files?

Check out https://github.com/envoyproxy/envoy-mobile/compare/generate-symbol-mapping-files for some work @Augustyniak was doing in this area.

We definitely get stack traces from Envoy Mobile native crashes in Bugsnag for the Lyft apps.

@RenjieTang
Copy link
Contributor Author

Thanks JP!
After compiling with dbg mode ./bazelw mobile-install --config=dbg-android //examples/java/hello_world:hello_envoy, now I get

09-29 15:56:48.602 28444 28467 F spdlog  : [2022-09-29 15:56:48.602][28467][critical][assert] [external/envoy/source/common/upstream/upstream_impl.cc:1051] assert failure: false.
09-29 15:56:48.602 28444 28467 F spdlog  : [2022-09-29 15:56:48.602][28467][critical][backtrace] [external/envoy/source/server/backtrace.h:104] Caught Aborted, suspect faulting address 0x6f1c
09-29 15:56:48.602 28444 28467 F spdlog  : [2022-09-29 15:56:48.602][28467][critical][backtrace] [external/envoy/source/server/backtrace.h:91] Backtrace (use tools/stack_decode.py to get line numbers):
09-29 15:56:48.602 28444 28467 F spdlog  : [2022-09-29 15:56:48.602][28467][critical][backtrace] [external/envoy/source/server/backtrace.h:92] Envoy version: 0/1.24.0-dev/redacted/DEBUG/BoringSSL

It feels like backtrace.h intercepts the stack trace. How may I recover the full stack trace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants