Skip to content

Commit 4eb4473

Browse files
ShuaiYuan21Yogaraj-Alamenda
authored andcommitted
Fix Nginx worker process core dump in QAT_SW with pkill/killall.
Nginx worker process doesn't exit normally with pkill/killall scenario resulting in core dump. thread_local_destructor is called explicitly in engine finish and key is deleted within engine_finish. Signed-off-by: Yuan, Shuai <shuai.yuan@intel.com> Signed-off-by: Yogaraj Alamenda <yogarajx.alamenda@intel.com>
1 parent 573fe48 commit 4eb4473

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

qat_sw_init.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
mb_thread_data* mb_check_thread_local(void)
9090
{
9191
mb_thread_data *tlv = (mb_thread_data *)pthread_getspecific(mb_thread_key);
92-
9392
if (tlv != NULL) {
9493
return tlv;
9594
}
@@ -531,6 +530,10 @@ void mb_thread_local_destructor(void *tlv_ptr)
531530
} else {
532531
DEBUG("tlv NULL\n");
533532
}
533+
534+
if (pthread_key_delete(mb_thread_key) != 0) {
535+
WARN("Failed to delete pthread key.\n");
536+
}
534537
}
535538

536539
int multibuff_init(ENGINE *e)
@@ -566,6 +569,7 @@ int multibuff_init(ENGINE *e)
566569
int multibuff_finish_int(ENGINE *e, int reset_globals)
567570
{
568571
int ret = 1;
572+
mb_thread_data *tlv;
569573

570574
DEBUG("---- Multibuff Finishing...\n\n");
571575

@@ -575,8 +579,8 @@ int multibuff_finish_int(ENGINE *e, int reset_globals)
575579
}
576580

577581
PRINT_RDTSC_AVERAGES();
578-
579-
ret = pthread_key_delete(mb_thread_key) == 0;
582+
tlv = (mb_thread_data *)pthread_getspecific(mb_thread_key);
583+
mb_thread_local_destructor(tlv);
580584

581585
return ret;
582586
}

0 commit comments

Comments
 (0)