如何在 Android 中为子线程生成核心转储
当我使用 Android 浏览器访问网站时,浏览器被阻止。浏览器进程有两个线程,一个是主 UI 线程(tid 2050),另一个是由 UI 线程创建的工作线程(tid 2060)。我发现UI线程没问题,但是子线程被阻塞了。
我可以通过以下方式获取子线程的java堆栈信息: kill -3 2050
/data/anr/traces.txt
...
"WebViewCoreThread" prio=5 tid=9 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43d54e58 self=0x236408
| sysTid=2060 nice=0 sched=0/0 cgrp=unknown handle=2319688
at android.webkit.LoadListener.nativeAddData(Native Method)
at android.webkit.LoadListener.commitLoad(LoadListener.java:1219)
at android.webkit.LoadListener.handleMessage(LoadListener.java:208)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:621)
at java.lang.Thread.run(Thread.java:1096)
我还可以获取子线程的本机核心转储(2060)吗?
顺便说一句,当我尝试时: 杀-11 2050 我可以在 adb 日志中获取主线程(2050)的本机核心转储。 但该命令对子线程不起作用。
我将非常感谢任何建议或想法。
When I visited a website by Android browser, the browser was blocked. The browser process had two threads, one was a main UI thread(tid 2050), the other was a working thread (tid 2060) which was created by the UI thread. I found the UI thread was OK, but the child thread was blocked.
I can get the java stack information of the child thread by:
kill -3 2050
/data/anr/traces.txt
...
"WebViewCoreThread" prio=5 tid=9 NATIVE
| group="main" sCount=1 dsCount=0 s=N obj=0x43d54e58 self=0x236408
| sysTid=2060 nice=0 sched=0/0 cgrp=unknown handle=2319688
at android.webkit.LoadListener.nativeAddData(Native Method)
at android.webkit.LoadListener.commitLoad(LoadListener.java:1219)
at android.webkit.LoadListener.handleMessage(LoadListener.java:208)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:621)
at java.lang.Thread.run(Thread.java:1096)
Can I also get the native core dump of the child thread (2060)?
BTW, when I tried:
kill -11 2050
I can get native core dump of the main thread(2050) in adb log.
but the command did not work for the child thread.
I would be very thankful for any advice or ideas.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论