Old 10-14-2018, 03:41 AM   #1
InfiniteDimensionality
Human being with feelings
 
Join Date: Jun 2017
Posts: 187
Default JS "debugger" craps out

JS debugger craps out at times only showing 0 for all variables.

This seems to be related to accessing memory greater than 10^6 best I can tell.

X = 3*10^6;
X[43];

Instead of erroring it just, I guess, causes the script to crash internally(no error) and all debug values are valid.

JS really needs some type of array management...
InfiniteDimensionality is offline   Reply With Quote
Old 10-14-2018, 09:33 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

Hmm not sure what you mean by "craps out".

You can use __memtop() to see how much memory is available. Accessing out-of-bounds will lead to undefined results, however it shouldn't crash or prevent the debugger from working.
Justin is offline   Reply With Quote
Old 10-15-2018, 04:21 AM   #3
InfiniteDimensionality
Human being with feelings
 
Join Date: Jun 2017
Posts: 187
Default

Quote:
Originally Posted by Justin View Post
Hmm not sure what you mean by "craps out".

You can use __memtop() to see how much memory is available. Accessing out-of-bounds will lead to undefined results, however it shouldn't crash or prevent the debugger from working.

Several times when I was working with arrays and accessed large amounts(since there is no manager I just tried to use random values spaced out). I set a few too high, I guess, and all the variables in the watch list would turn to 0. The only way to fix it was to change the memory location to something lower and restart reaper.

I thought I read that each fx has 8M elements of memory. I tried +10^6 and such and this is when it crapped out. I'm not sure if the elements are words, byte, bits, etc....
InfiniteDimensionality is offline   Reply With Quote
Old 10-15-2018, 04:28 AM   #4
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,775
Default

Quote:
Originally Posted by InfiniteDimensionality View Post
I'm not sure if the elements are words, byte, bits, etc....
As EEL only features a single type of data "elements" this does not matter.

-Michael
mschnell is online now   Reply With Quote
Old 10-15-2018, 09:53 AM   #5
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

Quote:
Originally Posted by InfiniteDimensionality View Post
Several times when I was working with arrays and accessed large amounts(since there is no manager I just tried to use random values spaced out). I set a few too high, I guess, and all the variables in the watch list would turn to 0. The only way to fix it was to change the memory location to something lower and restart reaper.
If all the variables go to 0, it might be that your code didn't compile properly. JSFX should be immune to runtime errors that cause things to stop working (though if you find a way to reproduce an issue please do let us know because it should be fixable if so).
Justin is offline   Reply With Quote
Old 10-15-2018, 12:56 PM   #6
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,775
Default

Justin,

as I have your attention here:

I found that (at least in one of my JSFXes) all or some variables go to zero when the Reaper Window gets out of the Windows GUI feature and gets in focus again.

Is this intended or a glitch ?

-Michael
mschnell is online now   Reply With Quote
Old 10-15-2018, 02:21 PM   #7
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

Quote:
Originally Posted by mschnell View Post
Justin,

as I have your attention here:

I found that (at least in one of my JSFXes) all or some variables go to zero when the Reaper Window gets out of the Windows GUI feature and gets in focus again.

Is this intended or a glitch ?

-Michael
When REAPER decides to reset the plug-in (e.g. on playback start or when changing sample rates or reinitializing the audio device), it will zero everything out and call your @init code etc. You can disable this using ext_noinit=1 in @init.
Justin is offline   Reply With Quote
Old 10-15-2018, 03:59 PM   #8
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,775
Default

This is obvious e.g. when playback or rendering is started.

While I don't understand the reason why Reaper should decide to re-init plugins on events resulting from loosing / getting the GUI focus, it's good to know that is seems to be an intended and controllable behavior.

-Michael
mschnell is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.