[RTEMS Project] #3859: No output from joel scripts in telnet

RTEMS trac trac at rtems.org
Mon Feb 10 21:59:43 UTC 2020


#3859: No output from joel scripts in telnet
-------------------------+--------------------------
 Reporter:  Chris Johns  |       Owner:  Chris Johns
     Type:  defect       |      Status:  assigned
 Priority:  normal       |   Milestone:  5.1
Component:  shell        |     Version:  5
 Severity:  normal       |  Resolution:
 Keywords:               |  Blocked By:
 Blocking:               |
-------------------------+--------------------------

Comment (by Chris Johns):

 Replying to [comment:2 Chris Johns]:
 > I have an issue on 4.11 where a printf line in changes what happens and
 I am not sure why. I need to resolve this. I will then create a 4.11 clone
 of this ticket and post a patch for that branch.

 I have chased the issue down to how we set up the re-entrant struct newlib
 uses in our threads. My changes follow what exists ...
 {{{
   FILE *input = fopen(shell_env->input, "r");
   if (input == NULL)
      error(...);
   stdin = input;
 }}}
 The only calls on `stdin` before the assignment are `fileno(stdin)` and
 this does not touch the re-entrant struct so the first call to libc after
 the assignment is `setvbuf(stdout, NULL, _IONBF, 0);` and newlib performs
 it's lazy initialisation and resets the re-entrant struct.

 This issue is present on 4.11 and 5 as far as I can see.

--
Ticket URL: <http://devel.rtems.org/ticket/3859#comment:3>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list