Menu

#2066 ADDRESS with input, child process blocked on stdin when stdin is not ready

5.3.0
open
nobody
None
none
5
2026-06-19
2026-06-18
jfaucher
No

When the file input.txt is not empty, ADDRESS is not blocked.

When the file input.txt is empty:

  • On macOS and Linux , ADDRESS is blocked.
  • On Windows, no problem.
file = "input.txt"
say "address with input using" file
cmd='rexx -e ".output~charout(''enter text, press <enter>: '');parse pull data;if data<>'''' then say ''(stdout):'' data;else say"'
address system cmd with input  using (.stream~new(file))

Related

Bugs: #2066

Discussion

  • jfaucher

    jfaucher - 2026-06-18

    platform/windows/SystemCommands.cpp
    the pipe is always closed when leaving InputWriterThread::dispatch.

    platform/unix/SystemCommands.cpp
    the pipe is closed only when the buffer is not empty.
    If the pipe is always closed, no more blocking.

     
  • jfaucher

    jfaucher - 2026-06-18
    • status: open --> pending
     
  • jfaucher

    jfaucher - 2026-06-18

    Revision: 13168

     
  • jfaucher

    jfaucher - 2026-06-18
    • status: pending --> open
     
    • Per Olov Jonsson

      Remember to check the Windows WMs tests, they time out so you cannot see if they fail. There are already unresolved problems for W7 and W8 so please have a look for any commits that touches Windows, it is not sufficient to check native W11.
      Von meinem iPhone gesendet
      P.O. Jonsson

      Am 18.06.2026 um 17:43 schrieb jfaucher jfaucher@users.sourceforge.net:

      - status: pending --> open
      - Comment:

      I reopen because make portable on Arch Linux and Manjaro crashed.
      Since the previous builds on these platforms did not crash, I reasonably suspect that the issue is related to the fix I applied for bug #2066.
      I don't see any address with input instruction in createPortable.rex, so I guess I will need to run this script with trace commands...

      Other platforms are ok.


      [bugs:#2066] ADDRESS with input, child process blocked on stdin when stdin is not ready

      Status: open
      Group: 5.3.0
      Created: Thu Jun 18, 2026 08:32 AM UTC by jfaucher
      Last Updated: Thu Jun 18, 2026 12:05 PM UTC
      Owner: nobody

      When the file input.txt is not empty, ADDRESS is not blocked.

      When the file input.txt is empty:
      * On macOS and Linux , ADDRESS is blocked.
      * On Windows, no problem.

      ~~~
      file = "input.txt"
      say "address with input using" file
      cmd='rexx -e ".output~charout(''enter text, press <enter>: '');parse pull data;if data<>'''' then say ''(stdout):'' data;else say"'
      address system cmd with input using (.stream~new(file))
      ~~~</enter>


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/oorexx/bugs/2066/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #2066

  • jfaucher

    jfaucher - 2026-06-18

    I reopen because make portable on Arch Linux and Manjaro crashed.
    Since the previous builds on these platforms did not crash, I reasonably suspect that the issue is related to the fix I applied for bug #2066.
    I don't see any address with input instruction in createPortable.rex, so I guess I will need to run this script with trace commands...

    Other platforms are ok.

     
    • jfaucher

      jfaucher - 2026-06-19

      After reverting the fix applied yesterday, make portable on Arch Linux and Manjaro is still crashing.
      So the root cause of the crash for these platforms is not the fix.

      But...
      ooRexx-OpenBSD7-test, which crashed yesterday with the fix applied, is not crashing today after the revert.

      I will not reapply this fix until the situation becomes more clear for these platforms.

       
      • Rene Vincent Jansen

        $ sample $(pgrep -n rexx) 5 -mayDie
        Sampling process 78142 for 5 seconds with 1 millisecond of run time between samples
        Sampling completed, processing symbols...
        Sample analysis of process 78142 written to file /tmp/rexx_2026-06-19_172957_Wcm4.sample.txt

        Analysis of sampling rexx (pid 78142) every 1 millisecond
        Process: rexx [78142]
        Path: /Users/USER/*/rexx
        Load Address: 0x104454000
        Identifier: rexx
        Version: 0
        Code Type: ARM64
        Platform: macOS
        Parent Process: rexx [78141]
        Target Type: live task

        Date/Time: 2026-06-19 17:29:57.431 +0200
        Launch Time: 2026-06-19 17:29:46.152 +0200
        OS Version: macOS 26.5.1 (25F80)
        Report Version: 7
        Analysis Tool: /usr/bin/sample

        Physical footprint: 4640K
        Physical footprint (peak): 4640K
        Idle exit: untracked


        Call graph:
        4345 Thread_38798624 DispatchQueue_1: com.apple.main-thread (serial)
        4345 start (in dyld) + 6992 [0x18283fe00]
        4345 main (in rexx) + 464 [0x104455b28]
        4345 RexxStart (in librexx.4.dylib) + 212 [0x1047d4980]
        4345 ActivityDispatcher::invoke(_RXSYSEXIT, char const) (in librexx.4.dylib) + 40 [0x10480af44]
        4345 Activity::run(ActivityDispatcher&) (in librexx.4.dylib) + 204 [0x10480eac0]
        4345 NativeActivation::run(ActivityDispatcher&) (in librexx.4.dylib) + 80 [0x1047ef320]
        4345 RexxStartDispatcher::run() (in librexx.4.dylib) + 636 [0x1048161b4]
        4345 RoutineClass::runProgram(Activity, RexxString, RexxString, RexxObject, unsigned long, ProtectedObject&) (in librexx.4.dylib) + 60 [0x1047b4c5c]
        4345 RexxActivation::run(RexxObject
        , RexxString, RexxObject, unsigned long, RexxInstruction, ProtectedObject&) (in librexx.4.dylib) + 924 [0x1047e2c8c]
        4345 RexxInstructionParse::execute(RexxActivation, ExpressionStack) (in librexx.4.dylib) + 196 [0x104830808]
        4345 Activity::pullInput(RexxActivation) (in librexx.4.dylib) + 272 [0x10481514c]
        4345 Activity::lineIn(RexxActivation
        ) (in librexx.4.dylib) + 224 [0x1048152c4]
        4345 RexxObject::messageSend(RexxString, RexxObject, unsigned long, ProtectedObject&) (in librexx.4.dylib) + 236 [0x1047aa34c]
        4345 RexxObject::processUnknown(RexxErrorCodes, RexxString
        , RexxObject, unsigned long, ProtectedObject&) (in librexx.4.dylib) + 264 [0x1047aa9fc]
        4345 RexxActivation::run(RexxObject, RexxString, RexxObject
        , unsigned long, RexxInstruction, ProtectedObject&) (in librexx.4.dylib) + 924 [0x1047e2c8c]
        4345 RexxInstructionForward::execute(RexxActivation
        , ExpressionStack) (in librexx.4.dylib) + 1052 [0x10482e740]
        4345 RexxActivation::forward(RexxObject
        , RexxString, RexxClass, RexxObject, unsigned long, bool) (in librexx.4.dylib) + 364 [0x1047e445c]
        4345 RexxObject::messageSend(RexxString*, RexxObject
        , unsigned long, ProtectedObject&) (in librexx.4.dylib) + 364 [0x1047aa3cc]
        4345 NativeActivation::run(MethodClass, NativeMethod, RexxObject, RexxString, RexxObject, unsigned long, ProtectedObject&) (in librexx.4.dylib) + 232 [0x1047ee95c]
        4345 stream_linein (in librexx.4.dylib) + 40 [0x104862504]
        4345 stream_linein_impl(RexxMethodContext_
        , void
        , long long, unsigned long) (in librexx.4.dylib) + 76 [0x104862574]
        4345 StreamInfo::readVariableLine() (in librexx.4.dylib) + 116 [0x104861808]
        4345 SysFile::gets(char, unsigned long, unsigned long&) (in librexx.4.dylib) + 84 [0x1048546a8]
        4345 SysFile::read(char
        , unsigned long, unsigned long&) (in librexx.4.dylib) + 400 [0x1048541b8]
        4345 read (in libsystem_kernel.dylib) + 8 [0x182bba91c]

        on macOS, so I can confirm your example hangs on read of stdin. Is the EOL somehow filtered out?

        On 19 Jun 2026, at 17:08, jfaucher jfaucher@users.sourceforge.net wrote:

        After reverting the fix applied yesterday, make portable on Arch Linux and Manjaro is still crashing.
        So the root cause of the crash for these platforms is not the fix.

        But...
        ooRexx-OpenBSD7-test, which crashed yesterday with the fix applied, is not crashing today after the revert.

        I will not reapply this fix until the situation becomes more clear for these platforms.

        [bugs:#2066] https://sourceforge.net/p/oorexx/bugs/2066/ ADDRESS with input, child process blocked on stdin when stdin is not ready

        Status: open
        Group: 5.3.0
        Created: Thu Jun 18, 2026 08:32 AM UTC by jfaucher
        Last Updated: Thu Jun 18, 2026 03:43 PM UTC
        Owner: nobody

        When the file input.txt is not empty, ADDRESS is not blocked.

        When the file input.txt is empty:

        On macOS and Linux , ADDRESS is blocked.
        On Windows, no problem.
        file = "input.txt"
        say "address with input using" file
        cmd='rexx -e ".output~charout(''enter text, press <enter>: '');parse pull data;if data<>'''' then say ''(stdout):'' data;else say"'
        address system cmd with input using (.stream~new(file))
        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/oorexx/bugs/2066/</enter>

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         

        Related

        Bugs: #2066

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB