|
|
|
08-05-2018, 05:03 PM
|
#1
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
ReaScript Bug that makes Lua hanging...
I've found a bug which hangs Lua for a script that contains the following line:
Code:
retval, String = reaper.BR_Win32_GetPrivateProfileString("Reaper", nil, "UltraschallNups", IniFile)
I've tested in on Windows 7 with Reaper 5.78 and 5.941 with SWS2.9.7 and SWS 2.9.8(beta).
I had such a behavior in the past with
Code:
reaper.BR_Win32_WritePrivateProfileString("", nil, "", reaper.GetResourcePath().."\reaper.ini")
as well, but that seem to work for quite a while again.
I reported the latter line to SWS a while ago, but CFillion couldn't reproduce it: https://github.com/reaper-oss/sws/issues/956
so maybe, it's a nil-type-conversion problem somewhere in Reaper?
Last edited by Meo-Ada Mespotine; 08-05-2018 at 05:50 PM.
|
|
|
08-05-2018, 05:59 PM
|
#2
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
No hanging here (Windows 8 x64, Reaper 5.941).
Just to confirm, is the first example the code you're using? If so, it's wrong - should be Section, Key, String (nil), INI.
Why are you trying to read and write nil keys in the INI file anyway?
|
|
|
08-05-2018, 06:34 PM
|
#3
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
This is really odd. Now, that I try the same lines again, they work.
An hour earlier and over the whole day today, I successfully triggered the bug time and again and eventually could bring it down to the nil-parameter-problem.
I even triggered it in 5.78 again a few minutes ago but not in 5.941, where I successfully triggered it before...
For some unknown reasons, this seems not to happen all the time.. O_O
The line I included is just a simplified problematic line. The point in reporting the bug is, that the script should stop always with a error, that I tried to give nil as a parameter, but instead, Lua hangs for that script making the script unrunnable from that point on...
This makes debugging stuff sometimes a nightmare...
Last edited by Meo-Ada Mespotine; 08-05-2018 at 06:51 PM.
|
|
|
08-05-2018, 06:39 PM
|
#4
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Ok, this is the whole script, that triggered the bug all the time. I tried to write me a script, that checks, if the action-list I dumped with the SWS-dumpactionlist-action, contains new actions in the new Reaper-version.
The script "BuggyScript.lua" is a simplified version. Put it into scripts and put Test.ini
Test.txt into the app-directory of Reaper(I tested it with the portable version).
Run the script and bang: Lua hangs, means, the script can't be run a second time.
http://www.phantastika.org/stuf/BuggyScript.zip
Edit:
Last edited by Meo-Ada Mespotine; 08-05-2018 at 06:49 PM.
|
|
|
08-05-2018, 08:25 PM
|
#5
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
Alright, with that I do get a crash - no hang, just an immediate "Reaper has stopped working".
Next question: Why are you playing around in the app folder? You're probably running into system permission issues, if nothing else, and the files you're looking at don't live there anyway. I think you want reaper.GetResourcePath().
|
|
|
08-05-2018, 09:32 PM
|
#6
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
In portable installations, the App-directory and the resource-directory of Reaper are the same, hence it didn't matter whether I would use reaper.GetExePath() or reaper.GetResourcePath() in my script.
In "standard"-installations you're right, reaper.GetResourcePath() would be the right choice after all.
I'm using tons of portable installations for development and testing different versions of Reaper. Haven't used a "standard"-installation in ages...
|
|
|
08-13-2018, 07:14 AM
|
#8
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
@cfillion
Thanks for your fix.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 02:36 AM.
|