[RTEMS Project] #3870: libc_reent set up is broken
RTEMS trac
trac at rtems.org
Wed Feb 12 06:20:05 UTC 2020
#3870: libc_reent set up is broken
-------------------------+---------------------
Reporter: Chris Johns | Owner: (none)
Type: defect | Status: new
Priority: high | Milestone: 5.1
Component: score | Version: 5
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: 3859 |
-------------------------+---------------------
Comment (by Chris Johns):
Looking into the test failure it would seems `stdout` is not overwritten
in RTEMS 5's newlib. I wonder if this issue has been fixed.
The following trace shows this...
{{{
]] 3 0x20162b0 0 0x2017f70
]] 4 0x20162b0 0 0x201b328
]] 5 0x20162b0 1 0x201b328
}}}
The columns are an `id`, the `_reent` pointer, `_reent->__sdidinit` and
`_reent->_stdout`.
Id 3 is before the open in the test, 4 is after the open and 5 is after an
`fflush(stdout)`.
As you can see `__sdidinit` is true after the `fflush` call and `stdout`
is still the new file pointer.
I change `setvbuf` to `fflush` and the test passed with the correct file
pointer.
I have tested adding a call to `__sinit` in `newlib_create_hook` and it
fixes the issue. I will reassign this bug to 4.11 and post a patch.
--
Ticket URL: <http://devel.rtems.org/ticket/3870#comment:8>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list