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

子线程连续2次 native 崩溃,无法捕获异常信息 #124

Open
likebamboo opened this issue Nov 22, 2022 · 2 comments
Open

子线程连续2次 native 崩溃,无法捕获异常信息 #124

likebamboo opened this issue Nov 22, 2022 · 2 comments

Comments

@likebamboo
Copy link

likebamboo commented Nov 22, 2022

  1. 打开 Demo工程:xcrash_sample
  2. 修改 MainActivity 中的 testNativeCrashInAnotherNativeThread_onClick 方法如下:
    public void testNativeCrashInAnotherNativeThread_onClick(View view) {
        XCrash.testNativeCrash(true);
        XCrash.testNativeCrash(true);
    }
  1. 移除布局文件 activity_main.xml 中的 WebView (这一步骤非常重要)
<!--    <WebView-->
<!--        android:id="@+id/webview"-->
<!--        android:layout_width="match_parent"-->
<!--        android:layout_height="wrap_content"-->
<!--        android:padding="20dp" />-->
  1. 运行之,点击【native crash (in another native thread)】按钮,应用崩溃,但是无法获取到堆栈

2022-11-27 09:44:49.497 25789-25925 xcrash                  xcrash.sample                        D  crashed APP's thread is running ...... 1
2022-11-27 09:44:49.510 25789-25928 xcrash                  xcrash.sample                        D  crashed APP's thread is running ...... 1
2022-11-27 09:44:49.521 25789-25929 libc                    xcrash.sample                        A  Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7a4735b6c0 in tid 25929 (xcrash_test_cal), pid 25789 (xcrash.sample)
2022-11-27 09:44:50.052 25789-25925 xcrash                  xcrash.sample                        D  crashed APP's thread is running ...... 2
2022-11-27 09:44:50.052 25789-25928 xcrash                  xcrash.sample                        D  crashed APP's thread is running ...... 2
2022-11-27 09:44:50.053 25789-25929 libc                    xcrash.sample                        A  crash_dump helper failed to exec
2022-11-27 09:44:50.137  1429-1652  InputDispatcher         pid-1429                             E  channel '7c7d499 xcrash.sample/xcrash.sample.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
---------------------------- PROCESS ENDED (2578
@likebamboo likebamboo changed the title 子线程连续2次 native 崩溃无法捕获异常 子线程连续2次 native 崩溃,无法捕获异常信息 Nov 22, 2022
@superoidlau
Copy link

使用华为mate 30是可以的。你再试试其他手机。

@likebamboo
Copy link
Author

我这边没有华为 mate 30, 用的是荣耀10以及OPPO reno都可以复现,上面也贴了log信息,确实是没有捕获到堆栈的

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