-
Notifications
You must be signed in to change notification settings - Fork 57
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
In multithreaded programs,some threads "Verifying safety for pid xxxxx" FAILED ! #46
Comments
Did For some applications there is always a Whether it is your case would be a lot easier to say by looking at the patch. If you can share the patch please do it here. At least, please provide the full log. |
Thanks paboldin, just like what you say:For some applications there is always a loop function that loops forever until application exits. It is always on the stack thus, and can't be properly patched. there is a thread always on the loop attached to 15 thread(s): 74232, 74233, 74234, 74235, 74236, 74237, 74238, 74239, 74253, 74257, 74258, 74259, 74260, 74261, 74262 |
It is impossible to patch the function that executes main loop because it is always on the stack and there is (almost) no way to patch this correctly. We apply a patch to function by re-writing its first instructions with a The easiest solution here is to patch one of the functions the event loop calls, if it is possible, and remove patch from the loop function, so there is no conflicts. If you can -- simplify your patch to the point where it is only a single 'printf' statement in each block and provide it here, through git repo or privately via E-mail. |
Hi paboldin, thank you for your reply, but i have a question that why i need to "Verifying safety for pid xxxx... " , even the thread doesn't call the function which should be patched ? |
I can't be sure that no thread calls the target function. From what I see the original comment the code thinks there is a target function on the stack. If you can, please provide at least the following outputs, here or privately: It will help me to see if there the patch really contains the target function. Preferable, just show me the patch. |
Hi Boldin, l'm so sorry for not provide enough information, thanks for you
patience, the following files:one
is my original codes, another is my patch.
and i made a mistake for what i said, i anslysis my code, find the
thread really call the function which need patched, by call one
function,and the
function call the patched function.
a little while ago, i make a try, in the loop, i added a code*
'sleep(100)'*, and patched success, it seems that the loop is too busy to
exit, so do you
have any idea about this situation ?
Pavel Boldin <notifications@github.com> 于2019年10月24日周四 下午9:04写道:
… I can't be sure that no thread calls the target function. From what I see
the original comment the code thinks there is a target function on the
stack.
If you can, please provide at least the following outputs, here or
privately:
$ strings PATCHFILE
$ diff -u lib/librte_vhost/.kpatch_fd_man*original.s
lib/librte_vhost/.kpatch_fd_man*patched.s
It will help me to see if there the patch really contains the target
function.
Preferable, just show me the patch.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#46?email_source=notifications&email_token=ANP7EIDKSN64HSUKKZHOLGDQQGMNFA5CNFSM4JBJLNBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECE6JGA#issuecomment-545907864>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANP7EIFN5EUZIXON5ZJY7Q3QQGMNFANCNFSM4JBJLNBA>
.
|
The files you've sent are not being displayed at github, please send them to me via boldin.pavel@gmail.com. The problem here may be with the inlined functions. When code declares function as a This might be your case as well. But, again, I will need both the patch and the binary patch to be sure. |
Verifying safety for pid 88521...
Stacktrace to verify safety for pid 88521:
[0x7fa5c32aea3d] __poll_nocancel+0x24
[0x7fa5c9d3a11f] fdset_event_dispatch+0x6f
[0x7fa5c9d3b270] rte_vhost_driver_session_start+0x10
[0x559bb0d2860b] _init+0x176513
kpatch_patch.c(201): safety check failed for 7fa5c9d39fb0
kpatch_patch.c(497): Patching xxxx.so failed, unapplying partially applied patch
Finished ptrace detaching.Failed to apply patch './libshared.kpatch'
kpatch_patch.c(588): Failed to apply patch './libshared.kpatch'
The text was updated successfully, but these errors were encountered: