#1615 closed defect (fixed)

_POSIX_Keys_Run_destructors() is broken

Reported by: Sebastian Huber Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: score Version: 4.10
Severity: normal Keywords:
Cc: Blocked By:


Problem 1:

According to The Open Group we have:

At thread exit, if a key value has a non-NULL destructor pointer, and the thread has a non-NULL value associated with that key, the value of the key is set to NULL, and then the function pointed to is called with the previously associated value as its sole argument.

The current implementation does not set the value to NULL before calling the destructor and thus calls it multiple times with the same value.

Problem 2:

The current implementation stops the iteration after some time. This may lead to resource leaks. If continuous iterations produce an infinite loop this is better than the silent error suppression.

Attachments (1)

keyrundestructors.patch (3.2 KB) - added by Sebastian Huber on Jul 13, 2010 at 10:42:11 AM.

Download all attachments as: .zip

Change History (2)

Changed on Jul 13, 2010 at 10:42:11 AM by Sebastian Huber

Attachment: keyrundestructors.patch added


comment:1 Changed on Aug 9, 2010 at 7:14:10 AM by Sebastian Huber

Resolution: fixed
Status: newclosed

Committed to 4.10 branch and CVS head.

Note: See TracTickets for help on using tickets.