Opened 11 years ago

Closed 11 years ago

#1642 closed bug (fixed)

the posix test pthread_key_delete_2-1 can not terminate normally

Reported by: kaoutsis Owned by: axeld
Priority: normal Milestone: R1
Component: System/ Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


source file is: src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_key_delete/2-1.c

after some tracing i came to the conclusion that the program control stops inside in the pthread_key_delete:

void dest_func(void *p)
	/* Delete the key and check if an error has occured */
	if(pthread_key_delete(key) != 0)

if i comment the if statement, the program terminates.

Another way that i found to make the control to get out of the pthread_key_delete function (leaving the fragment of the code to its original state - no comments) is, while the program is blocked (possibly by the pthread_mutex_lock see pthread_key.c in src/system/libroot/posix/pthread/pthread_key.c) to resize the terminal window a little bit! after that the program terminates successfully :-)

Change History (2)

comment:1 Changed 11 years ago by bonefish

Our pthread key implementation deadlocks here. It holds a mutex for the key list while calling the key value destructors (when the thread exists) and from the destructor function in the test program the pthread_key_delete() is called, which tries to lock the same mutex.

comment:2 Changed 11 years ago by axeld

Component: - GeneralSystem/
Resolution: fixed
Status: newclosed

Fixed in hrev25000, our pthread key implementation works now lockless.

Note: See TracTickets for help on using tickets.