#1247 closed defect (fixed)
RTEMS does not implement locks needed by multithreaded newlib
Reported by: | strauman | Owned by: | Chris Johns |
---|---|---|---|
Priority: | highest | Milestone: | 5.1 |
Component: | fs | Version: | 4.5 |
Severity: | critical | Keywords: | |
Cc: | chrisj@… | Blocked By: | |
Blocking: |
Description (last modified by Gedare Bloom)
multi-threaded newlib protects a number of internal data structures
(as of newlib-1.15 these comprise:
- global list of FILE objects
- stdio FILE object initializer
- individual FILEs [since FILEs with the exception of stdin/stdout/stderr are per-process entities]
- global hash table used by telldir/seekdir
- individual DIR structures (opendir/readdir)
- atexit list
- list of environment variables
- global timezone variable
)
using mutexes. It expects the OS to implement these locks but defaults
to not using locking if the OS does not provide an implementation.
Currently, RTEMS does *not* provide its own implementation of 'sys/lock.h'
and therefore vital data structures in newlib are currently *unprotected*
(with the exception of environment variables -- 'envlock.c' had been
added to RTEMS a while ago but since then, newlib has introduced more
locks and a general OS interface which - once implemented - will obsolete
'envlock.c').
Note that while semantics of having no protection for individual FILE
objects may be tolerable, having no protection for global newlib data
structures such as lists of FILEs is not acceptable.
I am currently working on an implementation which should be available shortly.
Attachments (4)
Change History (14)
Changed on 08/23/07 at 23:53:38 by strauman
Attachment: | PR#1247-rtems-newlibc-locking.diff added |
---|
Changed on 08/23/07 at 23:55:18 by strauman
Attachment: | PR#1247-newlib-1.15.0-locking.diff added |
---|
Patch to newlibc for newlib to use RTEMS locks
comment:1 Changed on 08/23/07 at 23:56:34 by strauman
attachments.ispatch: | 0 → 1 |
---|---|
attachments.mimetype: | text/x-patch → text/plain |
Changed on 03/06/08 at 21:47:00 by strauman
Attachment: | PR#1247-rtems-newlibc-locking-1.diff added |
---|
Implements locks needed by newlib
comment:2 Changed on 03/06/08 at 21:47:00 by strauman
attachments.isobsolete: | 0 → 1 |
---|
Changed on 03/07/09 at 00:18:24 by strauman
Attachment: | PR#1247-newlib-1.16.0-locking-crt0add.diff added |
---|
*NEWLIB* - patch adding stubs to crt0.c required for RTEMS autoconf tests
comment:3 Changed on 03/07/09 at 00:18:24 by strauman
This patch (to *newlib*) is required (in addition to the previously posted newlib patch) to help RTEMS autoconf tests. These tests try to link specific functions from newlib in order to determine if newlib provides them. Some functions require the newlib locks, however, and linkage would fail unless stubs for the locking routines are present in crt0. Such stubs are what this patch provides.
comment:4 Changed on 06/04/10 at 20:54:02 by Chris Johns
Component: | cpukit → filesystem |
---|---|
Milestone: | 4.7 → 4.11 |
Owner: | changed from Joel Sherrill to Chris Johns |
Status: | new → assigned, chrisj@rtems.org |
Version: | 4.7 → HEAD |
comment:5 Changed on 11/24/14 at 18:58:28 by Gedare Bloom
Version: | HEAD → 4.11 |
---|
Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11
comment:6 Changed on 02/10/15 at 15:16:33 by Gedare Bloom
Description: | modified (diff) |
---|
Sebastian/Chris: Is this still a valid problem?
comment:8 Changed on 07/31/15 at 05:32:11 by Sebastian Huber
Milestone: | 4.11.1 → 4.12 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Version: | 4.11 → 4.5 |
It is fixed with this commit in Newlib:
It requires an RTEMS version [9e9e61d27d146e2ca83d5b0f590683a3f605c3f1/rtems] or later.
comment:9 Changed on 05/11/17 at 07:31:02 by Sebastian Huber
Milestone: | 4.12 → 4.12.0 |
---|
comment:10 Changed on 11/09/17 at 06:27:14 by Sebastian Huber
Milestone: | 4.12.0 → 5.1 |
---|
Milestone renamed
Implements locks needed by newlib