"dir | testFilter.rex"
better to use "dir | rexx testFilter.rex"
because the test opened 3 times my editor :-)
I tested on macOS, after defining a "dir" script.
All good, except the test 4b.
Press ENTER, stay blocked.
Even Ctrl-D does not unblock.
Must Ctrl-C.
(did not investigate)
The redirection with the error keyword catches the stderr of the executed command,
but does not catch the error message when the command can't be executed.
I can't debug the child rexx process, so I don't know why/where the child rexx process is blocked.
My notes:
Same problem if I replace parse pull by linein.
Testing with parse pull.
With ::options trace i in rgfNullDevice.cls
debug in xcode, edit scheme to select console = terminal.
***4b.cmd=[rexx-e".output~charout('enter text, press <enter>: ');parse pull data;if data<>'' then say '(stdout):' data;else say"]aboutto'address system cmd with input using (.nullDevice)':>I>Method"LINEIN"withscope"NullDevice.Implementation"inpackage"/Users/jlfaucher/Downloads/rexx/NullDevice/rgfNullDevice.cls".26*-*raisenotReady--return("")<I<Method"LINEIN"withscope"NullDevice.Implementation"inpackage"/Users/jlfaucher/Downloads/rexx/NullDevice/rgfNullDevice.cls".entertext,press<enter>:ENTERdoesnothing^Ddoesnothing
pause in xcode
#0 0x0000000187b0d204 in __wait4 ()
#1 0x0000000100841e90 in ioCommandHandler at /Users/Shared/local/rexx/oorexx/official/main/trunk/interpreter/platform/unix/SystemCommands.cpp:1035
#2 0x00000001007de610 in RedirectingCommandHandlerDispatcher::run at /Users/Shared/local/rexx/oorexx/official/main/trunk/interpreter/concurrency/CommandHandler.cpp:294
#3 0x00000001007aa278 in NativeActivation::run at /Users/Shared/local/rexx/oorexx/official/main/trunk/interpreter/execution/NativeActivation.cpp:1692
#4 0x00000001007e5684 in Activity::run at /Users/Shared/local/rexx/oorexx/official/main/trunk/interpreter/concurrency/Activity.cpp:3449
#5 0x00000001007ddfe4 in CommandHandler::call at /Users/Shared/local/rexx/oorexx/official/main/trunk/interpreter/concurrency/CommandHandler.cpp:143
#6 0x00000001007a0018 in RexxActivation::command at /Users/Shared/local/rexx/oorexx/official/main/trunk/interpreter/execution/RexxActivation.cpp:4368
#7 0x00000001007f9840 in RexxInstructionAddress::execute at /Users/Shared/local/rexx/oorexx/official/main/trunk/interpreter/instructions/AddressInstruction.cpp:163
RexxObjectPtrRexxEntryioCommandHandler(RexxExitContext*context,RexxStringObjectaddress,RexxStringObjectcommand,RexxIORedirectorContext*ioContext){...waitpid(pid,&status,0);<--waitinghere(A)intrc;if(WIFEXITED(status))// child process ended normal breakpoint here{rc=WEXITSTATUS(status);// set return code}else{// child process diedrc=-(WTERMSIG(status));rc==-8if(rc==1)// process was stopped{rc=-1;}}// unknown command code?// a FAILURE will be raised for any command returning 127if(rc==UNKNOWN_COMMAND){returnErrorFailure(context,commandString);}elseif(rc!=0){// for any non-zero return code we raise an ERROR conditioncontext->RaiseCondition("ERROR",context->String(commandString),<--reachhere(B)NULL,context->WholeNumberToObject(rc));returnNULLOBJECT;}returncontext->False();// zero return code}
continue execution in xcode
No longer blocked, but the console is still unresponsive.
The breakpoint (A) is triggered.
Step by step, I reach (B)
continue execution in xcode.
The program terminates, the frozen console is killed by xcode.
Relaunch, attach xcode to the child rexx.
The child process is terminated immediatly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This program crashes on macOS, does not crash on Windows.
When debugging, I see the same situation on both platforms. raise notReady returns an OREF_NULL value.
It's the same situation on Windows,
When debugging, I get Exception thrown at 0x00007FFC6C26C524 (rexx.dll) in rexx.exe: 0xC0000005: Access violation reading location 0x0000000000000018.
The fact that oorexx doesn't crash outside the debugger is a mistery.
Bonjour Jean Louis, many, many thanks for looking and debugging this, highly appreciated! Being on the road until the end of next week, I will only be able to return to this thereafter. Best regards, ---rony
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2026-07-12
Just a little remark (not had the time to place it earlier). It should never be the case that plain ooRexx code crashes the interpreter. So the question would be whether the native code should be changed to raise a condition (and the documentation would need to point out that a description and a result must be supplied raising the notReady condition?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Reserved names in Windows (like CON, PRN, AUX, etc.) are no 4-letter words. Choosing
NUL.TXTas output file name might make it hard to find."dir | testFilter.rex"better to use
"dir | rexx testFilter.rex"because the test opened 3 times my editor :-)
I tested on macOS, after defining a "dir" script.
All good, except the test 4b.
Press ENTER, stay blocked.
Even Ctrl-D does not unblock.
Must Ctrl-C.
(did not investigate)
The redirection with the error keyword catches the stderr of the executed command,
but does not catch the error message when the command can't be executed.
On macOS, where dir is not a command:
It would be good to show in the documentation how to catch this error message with NullDevice:
About the macOS problem, is it only me?
I can't debug the child rexx process, so I don't know why/where the child rexx process is blocked.
My notes:
Same problem if I replace
parse pullbylinein.Testing with
parse pull.With
::options trace iin rgfNullDevice.clsdebug in xcode, edit scheme to select console = terminal.
pause in xcode
continue execution in xcode
No longer blocked, but the console is still unresponsive.
The breakpoint (A) is triggered.
Step by step, I reach (B)
continue execution in xcode.
The program terminates, the frozen console is killed by xcode.
Relaunch, attach xcode to the child rexx.
The child process is terminated immediatly.
I tested with a simpler test case:
This program crashes on macOS, does not crash on Windows.
When debugging, I see the same situation on both platforms.
raise notReadyreturns anOREF_NULLvalue.The crash is here:
It's the same situation on Windows,
When debugging, I get
Exception thrown at 0x00007FFC6C26C524 (rexx.dll) in rexx.exe: 0xC0000005: Access violation reading location 0x0000000000000018.The fact that oorexx doesn't crash outside the debugger is a mistery.
The solution is probably given by
A result must be specified in
rgfNullDevice.clswhen raising the exception.With these changes, no more crash on macOS.
That doesn't fix the blocking problem for 4b.
Perhaps this test case is a bit convoluted.
Bonjour Jean Louis, many, many thanks for looking and debugging this, highly appreciated! Being on the road until the end of next week, I will only be able to return to this thereafter. Best regards, ---rony
Blocking problem due to Bug #2066
Just a little remark (not had the time to place it earlier). It should never be the case that plain ooRexx code crashes the interpreter. So the question would be whether the native code should be changed to raise a condition (and the documentation would need to point out that a description and a result must be supplied raising the notReady condition?