Hi,
REAPER v6.47, Apple Mac M-1, (repro made on 3 different M-1, not reproducible on Intel mac and Windows)
I able able to make REAPER freeze forever (or at least for every long time) with a simple loop ExecProcess call.
The problem occurs when the ExecProcess return message are long. It seems that the memory used by this messages isn't cleaned in between each ExecProcess call from a script. No matter if the function is defer or not, it will hang at some point.
Here my test code:
Code:
function RunCommand( str )
if OS == "Win64" or OS == "Win32" then
str = 'cmd.exe /C "' .. str .. '"'
else
str = '/bin/sh -c "' .. str .. '"'
end
return reaper.ExecProcess( str, 0 ):sub(3)
end
command = "'/opt/homebrew/bin/aubiopitch' '/Users/apple/Desktop/Souz-L (17)_12 render 016.wav' -p yinfast -s -90 -l 0.2 -B 4096 -H 512 -u cent"
for i = 0, 500 do
a = RunCommand( command )
end
You can install aubio from
Homebrew for testing and test on a 5s audio file, or replace aubio by any command which would output lots of data.
Loop 20 times was good, 80 was stuck forever.
sockmonkey who kindly and patiently helped me debug figured out redirecingt stdout and stderr to /dev/null" make it doesn't hand anymore.
It is just adding this at end of the command:
I think the limit is machine dependent but I'm not sure, but it seems fixed by machine (the script started to crash each time at the same loop iteration).
It is kinda complex to explain all this, so let me know if you need more infos / details.
Thanks for taking a look !