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

Fix bugs in signal processing functions #24

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Mr-JingShi
Copy link
Contributor

@Mr-JingShi Mr-JingShi commented Jul 6, 2023

Patrons在信号处理这块有点问题:
xhook和Patrons都针对SIGSEGV做了特殊处理,用来防止自己的core dump扩散到外面。外面的信号被xhook或者Patrons捕获到时会调用sigaction把old信号处理函数重新注册成新的信号处理函数(等同放弃了自己的信号保护机制),

按代码信号处理函数注册时机来说,如果Patrons代码块的信号处理函数捕获到xhook代码块的SIGSEGV,Patrons代码块判断不是自己内部的便放弃了自己的信号处理函数并把xhook的信号处理函数注册成新的信号处理函数,最终会触发了xhook的信号处理函数,程序不会崩溃,程序执行一段时间后,如果Patrons代码块发出了SIGSEGV信号,SIGSEGV信号会被xhook的信号处理函数处理,程序就崩溃了。并没有做到杜绝因为Patrons崩溃而造成APP崩溃。

参考Android处理方案,直接调用旧的信号处理函数即可。
https://cs.android.com/android/platform/superproject/+/master:external/gwp_asan/gwp_asan/optional/segv_handler_posix.cpp
image

回归机型:
Android 12
ONEPLUS LE2110
SAMSUNG SM-A217F

Android 11
XIAOMI M2102J2SC
OPPO CPH2067
GOOGLE Pixel 4 XL

Android 10
BLACKSHARK SHARK KLE-A0
HUAWEI ANA-NX9
SAMSUNG SM-A202F

Android 9
XIAOMI MI 8
VIVO V1809A
MOTOROLA moto g(6)

Android 8.1
XIAOMI POCOPHONE F1
HUAWEI COR-AL10
MEIZU M1816

Android 8.0
MOTOROLA moto e5 play
HUAWEI AUM-L33
HUAWEI BLA-L29

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


chengjian.scj seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

2 participants