-
Notifications
You must be signed in to change notification settings - Fork 261
[LibOS] test program for sigsuspend and alarm #452
[LibOS] test program for sigsuspend and alarm #452
Conversation
This test program shows race condition between thread_sleep() and thread_wakeup() and DkThreadResume(thread->pal_handle). With graphene, sigsuspend doesn't return or results in assert. > assert failed shim_syscalls.c:260 preempt == get_cur_preempt() (value:0) Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
There are race condition on thread_sleep() and DkThreadResume(). To avoid it, wake up the thread. test program is can be found at gramineproject#452. NOTE: there are still other race conditions. this patch only address one of them. Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Now append_signal only send signal to the target thread. There are race condition among PalEventWait() and PalThreadResume(). So before sending host signal by DkThreadResume(), wake up the thread to avoid the race condition. The test program is at gramineproject#452 Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unclear how to incorporate this test into regression suite: the data race is non-deterministic (it takes up to several minutes on my machine to trigger the race). I suggest to move this test case under LibOS/shim/test/native
, so interested people can play with it.
Note: This data race is visible only in non-debug mode in manifest: loader.debug_type = none
.
Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion, not enough approvals from maintainers (2 more required), not enough approvals from different teams (2 more required, approved so far: ) (waiting on @yamahata)
LibOS/shim/test/regression/sigsuspend.c, line 52 at r1 (raw file):
struct timespec t = { .tv_sec = 1,
If we change from 1
to say 5
, the data race disappears but Graphene-SGX hangs deterministically. This behavior is explained in #453 (comment). We can implement a regression test by changing this line. This bug will require a separate fix (again, see the link).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test case. This also needs a python wrapper that can automatically run this test as part of 'make regression' and tell if there is a failure or success. Since this is a separate PR from the fix, my suggestion would be to go ahead and write the test and have it fail, but mask the error code until the fix lands.
After reading @dimakuv's comments, I think he is advocating we do some other fixes first.
Reviewable status: all files reviewed, 1 unresolved discussion, not enough approvals from maintainers (2 more required), not enough approvals from different teams (2 more required, approved so far: ) (waiting on @yamahata)
Now append_signal only send signal to the target thread. There are race condition among PalEventWait() and PalThreadResume(). So before sending host signal by DkThreadResume(), wake up the thread to avoid the race condition. The test program is at gramineproject#452 Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Now append_signal only send signal to the target thread. There are race condition among PalEventWait() and PalThreadResume(). So before sending host signal by DkThreadResume(), wake up the thread to avoid the race condition. The test program is at gramineproject#452 Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
There are race condition on thread_sleep() and DkThreadResume(). To avoid it, wake up the thread. test program is can be found at gramineproject#452. NOTE: there are still other race conditions. this patch only address one of them. Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Now append_signal only send signal to the target thread. There are race condition among PalEventWait() and PalThreadResume(). So before sending host signal by DkThreadResume(), wake up the thread to avoid the race condition. The test program is at gramineproject#452 Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
There are race condition on thread_sleep() and DkThreadResume(). To avoid it, wake up the thread. test program is can be found at #452. NOTE: there are still other race conditions. this patch only address one of them. Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Now append_signal only send signal to the target thread. There are race condition among PalEventWait() and PalThreadResume(). So before sending host signal by DkThreadResume(), wake up the thread to avoid the race condition. The test program is at gramineproject#452 Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Now append_signal only send signal to the target thread. There are race condition among PalEventWait() and PalThreadResume(). So before sending host signal by DkThreadResume(), wake up the thread to avoid the race condition. The test program is at gramineproject#452 Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Now append_signal only send signal to the target thread. There are race condition among PalEventWait() and PalThreadResume(). So before sending host signal by DkThreadResume(), wake up the thread to avoid the race condition. The test program is at gramineproject#452 Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Would we still need this test case now since we have LTP's |
I would suggest to close this PR. @yamahata What do you think? |
This PR is outdated, the tests work correctly on current master. |
This test program shows race condition between thread_sleep() and
thread_wakeup() and DkThreadResume(thread->pal_handle).
With graphene, sigsuspend doesn't return or results in assert.
Signed-off-by: Isaku Yamahata isaku.yamahata@gmail.com
Please fill in the following form before submitting this PR:
Affected components
A brief description of this PR (describe the reasons and measures)
How to test this PR?
no need to test because this is a test program
Please follow the coding style guidelines. Do not submit PRs which violate these rules.
*
) next to types:int* pointer;
(one pointer each line){
) begin in the same line as function names,if
,else
,while
,do
,for
,switch
,union
, andstruct
keywords.NAMED_THIS_WAY
; global variables -g_named_this_way
; others -named_this_way
.Please preserve the following checklist for reviewing:
This change is