You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Console command exec should have a recursion limit when it recursively calls itself, similar to in #7969.
Actual result
In openttd-20210226-master-gaf326753a9-windows-win64:
The game crashes, presumably due to a stack overflow and/or too many file handles open. crash.dmp is generated with a file size of 0 bytes. crash.log and crash.png are not generated.
In openttd-jgrpp-0.40.3-windows-win64:
The console command aborts with ERROR: script file not found even though the file exists and was able to be accessed recursively using exec. This may be because there were too many files open by the same process at once.
Steps to reproduce
Create a file with the path C:\Users\user\Documents\OpenTTD\recursion.txt and the contents as follows:
Besides no protection for recursion, there is another issue when you run exec from a script: when ever the inner script stops, so does the outer script. Example:
test.script
echo begin
exec test2.script
echo end
test2.script
echo test2
Run a dedicated server and execute: exec test.script. Output:
begin
test2
This is because there is only a single global to indicate a script is still being parsed. So one can only use exec to hand off from one script to the other.
I am surprised nobody ever reported that issue, as it is a pretty big limitation. But maybe that says a lot about how many people use exec and scripts in general.
TrueBrain
added a commit
to TrueBrain/OpenTTD
that referenced
this issue
Mar 12, 2021
…mit to 10 deep
This means if you execute a script from a script from a script, ..
for more than 10 times, it bails out now. This should be sufficient
for even the most complex scripts.
…mit to 10 deep
This means if you execute a script from a script from a script, ..
for more than 10 times, it bails out now. This should be sufficient
for even the most complex scripts.
Version of OpenTTD
openttd-20210226-master-gaf326753a9-windows-win64
Expected result
Console command
exec
should have a recursion limit when it recursively calls itself, similar to in #7969.Actual result
In
openttd-20210226-master-gaf326753a9-windows-win64
:The game crashes, presumably due to a stack overflow and/or too many file handles open.
crash.dmp
is generated with a file size of 0 bytes.crash.log
andcrash.png
are not generated.In
openttd-jgrpp-0.40.3-windows-win64
:The console command aborts with
ERROR: script file not found
even though the file exists and was able to be accessed recursively usingexec
. This may be because there were too many files open by the same process at once.Steps to reproduce
C:\Users\user\Documents\OpenTTD\recursion.txt
and the contents as follows:(replace
user
with your Windows user name)exec C:\Users\user\Documents\OpenTTD\recursion.txt
ERROR: script file not found
.The text was updated successfully, but these errors were encountered: