Environment: oorexx 4.0.1 under Debian
I wrote a program "setauth" which expects a list of files amongst its
arguments.
I ran it with the command: setauth g+r *
It was OK, until I encountered a directory containing 6222 files, then
I got a Segmentation Fault when my code tried to parse the arguments.
Linux would have expanded that "*" into a list of all the files in the
current directory, and presumably this was such a long string that it
caused REXX to Segmentation Fault. Not good, but then things got
odd...
I wondered how long the argument had to be to cause the Segmentation
fault, so I wrote this program: (called "test")
#!/usr/bin/rexx --
If arg(1) <> '' then exit
Call SysFileTree '/data/webdata/customer/*','F.','O'
List = ''
Do I = 1 to F.0
List = List || F.I' '
Say I f.0 length(list)
'rexx test' strip(list)
If rc <> 0 then call exit 'Error' RC
End
Call exit
Exit:
If arg(1) <> '' then say arg(1)
Exit
When I run this I reach this point:
218 6222 8282
219 6222 8317
Error 11
So, when the argument length is somewhere between 8283 and 8317
characters, rexx gives a RC=11 (Control Stack Full)
To date, Control Stack Full has always meant that I've run out of
stack when recursively calling a routine.
Can someone explain why I got a "Control Stack Full"?
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk