-
Notifications
You must be signed in to change notification settings - Fork 573
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
ASSERT core/dynamo.c:1139 on running sol on Ubuntu #1216
Comments
From zhao...@google.com on July 18, 2013 14:33:07 It seems caused by one thread is sending the suspend signal while the target thread is performing a poll system call and cannot handle the signal. |
From bruen...@google.com on July 19, 2013 07:32:29 More details: we have an inlined SYS_poll, but the kernel points the pc 0x4ec515a7: mov %rax,(%rsp) So we want to consider that case to be safe for suspending. The argument is |
A related issue here is our own signals interrupting auto-restart syscalls at attach time, where our #1145 auto-restart emulation does not come into play as we're interrupting native code. A simple proposal here is to set SA_RESTART on our own handler. This will cause the kernel to adjust the sigcontext to restore the original xax and shift the PC back by 2. This should solve the attach-time problem, and should also help with in-cache and gencode cases. There should be no downside, assuming DR can handle "before do_syscall": if that's not considered a safe point and we assume that thread will make progress we could have a problem. I think the reason #1145 didn't use SA_RESTART was a mis-understanding of when the kernel adjusts the PC: if the kernel adjusts on sigreturn then it messes with cases where DR changes the PC. But the kernel adjusts prior to setting up the frame. |
From zhao...@google.com on July 18, 2013 11:42:26
What steps will reproduce the problem? 1. in Ubuntu 13.04: ./bin64/drrun -debug -c ./api/samples/bin/libbbcount.so -- sol
2. close the windows when it shows up What is the expected output? What do you see instead? stop the app successfully, but I saw assert failure
<Stopping application /usr/games/sol (14617)>
^T<CURIOSITY : loop_count < max_loops in file /home/dynamorio/Workspace/DynamoRIO/dynamorio/core/synch.c line 1361
version 4.0.2186, custom build
-client_lib '/home/dynamorio/Workspace/DynamoRIO/builds/build_x64_dbg/./api/samples/bin/libbbcount.so;0;' -code_api -stack_size 56K -max_elide_jmp 0 -max_elide_call 0 -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct
0x0000000049a66680 0x00000000711fef65
0x0000000049a66750 0x000000007108aefa
0x0000000049a66780 0x000000007108b02c
0x0000000049a667b0 0x000000007108b1d6
0x0000000049a667e0 0x0000000071298564
0x0000000049a667f8 0x00000000499d5e40
/home/dynamorio/Workspace/DynamoRIO/builds/build_x64_dbg/./api/samples/bin/libbbcount.so=0x0000000072000000
/lib/x86_64-linux-gnu/libc.so.6=0x00007fdb30364000
/lib64/ld-linux-x86-64.so.2=0x00007fdb3013f000>
<Application /usr/games/sol (14617). Internal Error Internal DynamoRIO Error: /home/dynamorio/Workspace/DynamoRIO/dynamorio/core/dynamo.c:1139 ok
(Error occurred @164694 frags)
version 4.0.2186, custom build
-client_lib '/home/dynamorio/Workspace/DynamoRIO/builds/build_x64_dbg/./api/samples/bin/libbbcount.so;0;' -code_api -stack_size 56K -max_elide_jmp 0 -max_elide_call 0 -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct
0x0000000049a665f0 0x0000000071111db9
0x0000000049a66750 0x000000007108af31
0x0000000049a66780 0x000000007108b02c
0x0000000049a667b0 0x000000007108b1d6
0x0000000049a667e0 0x0000000071298564
0x0000000049a667f8 0x00000000499d5e40
/home/dynamorio/Workspace/DynamoRIO/builds/build_x64_dbg/./api/samples/bin/libbbcount.so=0x0000000072000000
/lib/x86_64-linux-gnu/libc.so.6=0x00007fdb30364000
/lib64/ld-linux-x86-64.so.2=0x00007fdb3013f000>
It runs fine if without client.
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1216
The text was updated successfully, but these errors were encountered: