View Issue Details

IDProjectCategoryView StatusLast Update
00009881003.1(2013)/Issue7+TC1System Interfacespublic2016-07-14 15:34
ReporterFlorian Weimer Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionDuplicate 
NameFlorian Weimer
OrganizationRed Hat
User Reference
Sectionpthread_mutex_lock
Page Numberunknown
Line Numberunknown
Interp Status---
Final Accepted Text
Summary0000988: Additional error condition for pthread_mutex_lock, pthread_mutex_trylock
DescriptionOn Linux, a process can only reliably lock ROBUST_LIST_LIMIT mutexes at the same time. This means that pthread_mutex_lock and pthread_mutex_trylock should fail if this limit is exceeded. The current specification does not document this error condition.

(It is not possible to check this limit at pthread_mutex_init time because the mutex could have been created by another process.)
Desired ActionSpecify EAGAIN as an error code for this failure.
TagsNo tags attached.

Relationships

duplicate of 0000354 Closedajosey 1003.1(2008)/Issue 7 limit on the number of owned robust mutexes 

Activities

shware_systems

2015-10-08 12:56

reporter   bugnote:0002860

That is something for LINUX to address, as POSIX does not appear to impose that restriction. It makes allowance for it by EAGAIN in pthread_mutex_init(), as to how many can be owned, but does not impose a per process limit on how many can be referenced by sharing. The implicit limit on that is available memory, that I can see.

Florian Weimer

2015-10-08 13:22

reporter   bugnote:0002861

Unfortunately, pthread_mutex_init is not the only way to add mutexes to a process which can be locked later. If we do not check the limit at lock time, we would have to check at mmap time if the mapping contains any robust mutexes, and proactively fail mmap if the implementation limit is exceeded.

shware_systems

2015-10-08 14:01

reporter   bugnote:0002862

I would say it is more on those other ways to respect any implementation-defined limits of this nature, if they are populating the per-process structures with data directly. After a mmap() the process still has to init references to locks in that address space; wouldn't trying to reuse another process's handle directly count against that previous process, not the one doing the new map?

jilles

2015-10-08 22:08

reporter   bugnote:0002867

This seems to be a duplicate of #354.

shware_systems

2015-10-09 11:15

reporter   bugnote:0002868

Mostly... The resolution of #354 is per-system, not per-process, though, and by the wording it's a may fail error, depending on implementation model. I don't have the 2008 pdf handy to compare line numbers. The Rationale also could have something that explains that it may not occur on all platforms, so this could be a child issue.

Issue History

Date Modified Username Field Change
2015-10-08 12:15 Florian Weimer New Issue
2015-10-08 12:15 Florian Weimer Name => Florian Weimer
2015-10-08 12:15 Florian Weimer Organization => Red Hat
2015-10-08 12:15 Florian Weimer Section => pthread_mutex_lock
2015-10-08 12:15 Florian Weimer Page Number => unknown
2015-10-08 12:15 Florian Weimer Line Number => unknown
2015-10-08 12:56 shware_systems Note Added: 0002860
2015-10-08 13:22 Florian Weimer Note Added: 0002861
2015-10-08 14:01 shware_systems Note Added: 0002862
2015-10-08 22:08 jilles Note Added: 0002867
2015-10-09 08:30 geoffclare Relationship added duplicate of 0000354
2015-10-09 11:15 shware_systems Note Added: 0002868
2016-07-14 15:34 Don Cragun Interp Status => ---
2016-07-14 15:34 Don Cragun Status New => Closed
2016-07-14 15:34 Don Cragun Resolution Open => Duplicate