[RTEMS Project] #2957: Shared memory support internal locking is broken
RTEMS trac
trac at rtems.org
Tue Mar 28 19:39:49 UTC 2017
#2957: Shared memory support internal locking is broken
-----------------------------+-----------------------
Reporter: Sebastian Huber | Owner: Gedare
Type: defect | Status: assigned
Priority: normal | Milestone: 4.12
Component: cpukit | Version: 4.12
Severity: normal | Resolution:
Keywords: |
-----------------------------+-----------------------
Comment (by Gedare):
Yes: the shm code has some rather questionable design choices in its
locking patterns. Here it acquires a thread_queue and then calls a user
plugin function, in this case malloc is called which eventually leads to
the error shown.
Is there somewhere with guidance written for how to use the various lock
constructs available in RTEMS? Or what are their constraints on use.
Because I didn't even know this was a problem, and apparently did not
spend much time thinking about this while writing the code.
The shm code uses 2 locking patterns. The one causing a problem here is
the use of a thread_queue to protect the invocations to operations on the
shared-memory object. This should be some fine-grained mutex lock that
allows the operation invoked to also acquire/release internal locks such
as is needed by malloc.
The other lock used is the _Objects_Allocator_lock to protect the
integrity of the POSIX_Shm_Control Object. I think this one is fine.
--
Ticket URL: <http://devel.rtems.org/ticket/2957#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list