mirror of
https://github.com/DynamoRIO/dynamorio.git
synced 2026-10-12 10:09:50 +00:00
i#2075 flaky pthread_exit test: relax vmm_heap_exit check.
Adds flag dynamo_thread_init_during_process_exit to indicate if the process exits during any threads init. Relax vmm_heap_exit check if dynamo_thread_init_during_process_exit is true. Review-URL: https://codereview.appspot.com/319770043
This commit is contained in:
@@ -2065,6 +2065,9 @@ remove_thread(IF_WINDOWS_(HANDLE hthread) thread_id_t tid)
|
||||
/* this bool is protected by reset_pending_lock */
|
||||
DECLARE_FREQPROT_VAR(static bool reset_at_nth_thread_triggered, false);
|
||||
|
||||
#ifdef DEBUG
|
||||
bool dynamo_thread_init_during_process_exit = false;
|
||||
#endif
|
||||
/* thread-specific initialization
|
||||
* if dstack_in is NULL, then a dstack is allocated; else dstack_in is used
|
||||
* as the thread's dstack
|
||||
@@ -2112,6 +2115,8 @@ dynamo_thread_init(byte *dstack_in, priv_mcontext_t *mc
|
||||
/* under current implementation of process exit, can happen only under
|
||||
* debug build, or app_start app_exit interface */
|
||||
while (dynamo_exited) {
|
||||
/* FIXME i#2075: free the dstack. */
|
||||
DODEBUG({dynamo_thread_init_during_process_exit = true; });
|
||||
/* logging should be safe, though might not actually result in log
|
||||
* message */
|
||||
DODEBUG_ONCE(LOG(GLOBAL, LOG_THREADS, 1,
|
||||
|
||||
@@ -444,6 +444,8 @@ extern bool dynamo_exited; /* has dynamo exited? */
|
||||
extern bool dynamo_exited_and_cleaned; /* has dynamo component cleanup started? */
|
||||
#ifdef DEBUG
|
||||
extern bool dynamo_exited_log_and_stats; /* are stats and logfile shut down? */
|
||||
/* process exit in middle of any thread init? */
|
||||
extern bool dynamo_thread_init_during_process_exit;
|
||||
#endif
|
||||
extern bool dynamo_resetting; /* in middle of global reset? */
|
||||
extern bool dynamo_all_threads_synched; /* are all other threads suspended safely? */
|
||||
|
||||
@@ -1400,6 +1400,10 @@ vmm_heap_exit()
|
||||
detach
|
||||
*/
|
||||
ASSERT(IF_WINDOWS(doing_detach || ) /* not deterministic when detaching */
|
||||
/* FIXME i#2075: if a thread is being initialized during the
|
||||
* process exit, the thread will not free its dstack.
|
||||
*/
|
||||
IF_DEBUG(dynamo_thread_init_during_process_exit || )
|
||||
heapmgt->vmheap.num_free_blocks == heapmgt->vmheap.num_blocks
|
||||
- unfreed_blocks ||
|
||||
/* >=, not ==, b/c if we hit the vmm limit the cur dstack
|
||||
|
||||
Reference in New Issue
Block a user