02-15-2022, 04:50 PM
|
#1 |
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 11,104
|
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: Code:
>/dev/null 2>&1 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 !
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - ReaComics - Donation Last edited by X-Raym; 02-20-2022 at 04:17 AM. |
|
|
02-16-2022, 01:57 AM
|
#2 |
|
Human being with feelings
Join Date: Sep 2021
Location: Berlin
Posts: 2,723
|
Just jumping in to clarify a couple of things that we tried:
The only thing not tried (so far, AFAIK) is using something like os.execute() in lua to do this. Without knowing the internals of reaper.ExecProcess(), it's hard to speculate what could be going wrong, but it does feel like there's some buffer overflowing after some arbitrary limit. |
|
|
02-16-2022, 05:12 AM
|
#3 |
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 17,784
|
How long is the output of that command?
|
|
|
02-16-2022, 05:20 AM
|
#4 |
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 11,104
|
Here is a log output of our test file:
https://gist.github.com/X-Raym/846d6...9ed64adfe55673 (this one is way longer than 5s by the way, so make reaper crash more easily) In this case, 55889 characters, 57.5 KB; for 3001 lines.
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - ReaComics - Donation Last edited by X-Raym; 02-16-2022 at 05:25 AM. |
|
|
02-16-2022, 06:16 AM
|
#5 |
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 17,784
|
[edit] I can reproduce this, looking into it.
|
|
|
02-16-2022, 11:46 AM
|
#6 |
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,840
|
Sorry to hijack the thread but since you are there, I have managed many times in the past to break ExecProcess on Windows.. If you pass it 5-6 times a wrong command, then it breaks and does not work again, even if you pass it the correct one, until you restart Reaper...
|
|
|
02-16-2022, 11:49 AM
|
#7 |
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 11,104
|
@amagalma
This would deserve a custom thread indeed :P For sure, you can prepare code for testing! @schwa Thanks for working on this!
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - ReaComics - Donation |
|
|
02-16-2022, 12:27 PM
|
#8 |
|
Human being with feelings
Join Date: Sep 2021
Location: Berlin
Posts: 2,723
|
|
|
|
02-20-2022, 04:18 AM
|
#9 |
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 11,104
|
Seems solved in v6.48 according to the M1 user who has this issue. Many thx!
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - ReaComics - Donation |
|
|
![]() |
| Thread Tools | |
|
|