A few more findings:
It isn’t specifically DoesNotUnderstandError – if I throw any error at that point in the code, it also crashes. But, even more bizarre, if I insert a this.dumpBackTrace somewhere before the error (which I did because I wanted to see what the call stack looks like from the OSC response), then it doesn’t crash, and I get the full call stack from the error dump…? That is weird.
The full stack, it turns out, isn’t so deep: 12 frames outside protect, 19 inside. Kinda… trivial…? Why is it crashing?
So the f test can’t be exactly the same. My live-set crash happens very quickly without a large memory spike, consistent with a stack trace of only 30-ish frames. f is chewing up RAM and taking a fairly long time at it.
In the f test, every level of recursion adds 4 stack frames. There are 3 frames at the beginning (Process:interpretPrintCmdLine, Interpreter:interpretPrintCmdLine and a < closed FunctionDef > generated by the interactive compiler), and 3 frames for Error-throw at the end. So f.(22) incurs 3 + (22*4) + 3 = 88+6 = 94 frames. If that’s taking 9+ GB of RAM, it’s … like… 90MB per frame? No way. So there is something wrong in getBackTrace for sure. Probably somebody at some point should valgrind that, though it’s probably only obliquely related to my original case.
Puzzled.
hjh
ERROR: bindBP preemptively throwing other error [hjh: that's my test error]
PROTECTED CALL STACK:
a FunctionDef 0x7831d9433418
sourceCode = "{ |bp, adverb, parms|
var index = ~getIndexFromAdverb.(adverb, 0, \\fader),
// hjh: the '.chan' call was failing
mixer = Error(\"bindBP preemptively throwing other error\").throw, // bp.v.chan,
newMap;
if(mixer.isNil) {
mixer = bp.event[\\voicer]; // mixer as temp here
if(mixer.notNil) { mixer = mixer.asMixer }; // mixer is really a Voicer at the start of this!
};
if(parms.isNil) {
parms = () // setMute: false
};
// may be multiple mixers
// note: 'do' handles [mixer, mixer...], and mi...etc..."
arg bp = BP('nonexistent')
arg adverb = 12
arg parms = nil
var index = 12
var mixer = nil
var newMap = nil
a FunctionDef 0x598fa0872500
sourceCode = "<an open Function>"
a FunctionDef 0x598fa0870540
sourceCode = "<an open Function>"
Function:prTry 0x598f9fa7d100
arg this = a Function
var result = nil
var thread = a Thread
var next = a Function
var wasInProtectedFunc = true
Function:protect 0x598f9fa7c680
arg this = a Function
arg handler = a Function
var result = nil
Proto:use 0x598fa086ffc0
arg this = a Proto
arg func = a Function
arg failSilentlyAfterFree = false
var result = nil
var saveEnvir = Environment[(pingCond -> a CondVar), (tempoCtl -> a GenericGlobalControl), (mainFx -> false), (focusWatcher -> a SimpleController), (mylib -> a SynthDescLib),
(hwOut -> class MixerChannel('hwOut', localhost, 2, 2)), (saveAddr -> a NetAddr(127.0.0.1, 57110)), (editor -> a Proto), (debugAddr -> a DebugNetAddr(127.0.0.1, 57110)), (rvb -> Synth('cll_freeverb2' : 1001)),
(longrvbmc -> class MixerChannel('longrvb', localhost, 2, 2)), (timer -> a DDWTimer), (shortrvb -> Synth('cll_freeverb2' : 1002)), (longr...etc...
Proto:doesNotUnderstand 0x598fa0871dc0
arg this = a Proto
arg selector = bindBP
arg args = nil
var result = [BP('nonexistent'), 12, nil]
var item = nil
Object:chuck 0x598fa1d7b900
arg this = BP('nonexistent')
arg dest = a Proto
arg adverb = 12
arg parms = nil
a FunctionDef 0x598fa49dfe28
sourceCode = "<an open Function>"
a FunctionDef 0x598fa0de11c0
sourceCode = "<an open Function>"
Function:prTry 0x598f9fa7d100
arg this = a Function
var result = nil
var thread = a Thread
var next = a Function
var wasInProtectedFunc = true
Function:protect 0x598f9fa7c680
arg this = a Function
arg handler = a Function
var result = nil
Environment:use 0x598fa0de0d40
arg this = Environment[(pingCond -> a CondVar), (tempoCtl -> a GenericGlobalControl), (mainFx -> false), (focusWatcher -> a SimpleController), (mylib -> a SynthDescLib),
(hwOut -> class MixerChannel('hwOut', localhost, 2, 2)), (saveAddr -> a NetAddr(127.0.0.1, 57110)), (editor -> a Proto), (debugAddr -> a DebugNetAddr(127.0.0.1, 57110)), (rvb -> Synth('cll_freeverb2' : 1001)),
(longrvbmc -> class MixerChannel('longrvb', localhost, 2, 2)), (timer -> a DDWTimer), (shortrvb -> Synth('cll_freeverb2' : 1002)), (longr...etc...
arg function = a Function
var result = nil
var saveEnvir = a Proto
a FunctionDef 0x598fa49e02e8
sourceCode = "{
var sceneIndex = ~scene;
var scenes = ~scenes;
[~scene, ~scenes[~scene * 2]].debug(\"updateScene, calling func for\");
topEnvironment.use { scenes[sceneIndex * 2 + 1].value };
~updateSceneDisplay.();
}"
var sceneIndex = 21.0
var scenes = [dummy, a Function, harmonics, a Function, alias, a Function, intro2, a Function, fmOvertones, a Function, distbell, a Function, thinkick, a Function, kalimba, a Function, guzheng, a Function, piano, a Function, ice, a Function, pmGrain, a Function, pulses, a Function, pulses2, a Function, bass, a Function, dxbass, a Function, drums1-retro, a Function, drums2-amb, a Function, drums3-tek, a Function, pad, a Function, wbass, a Function, testcrash, a Function]
a FunctionDef 0x598fa49e1128
sourceCode = "{ |index|
~scene = index;
~updateScene.();
currentEnvironment
}"
arg index = 21.0
a FunctionDef 0x598fa49e2688
sourceCode = "<an open Function>"
arg msg = [/sceneMenu, 22.0]
var i = 21.0
a FunctionDef 0x598f9fa81640
sourceCode = "<an open Function>"
a FunctionDef 0x598fa0870540
sourceCode = "<an open Function>"
Function:prTry 0x598f9fa7d100
arg this = a Function
var result = nil
var thread = a Thread
var next = nil
var wasInProtectedFunc = false
CALL STACK:
Exception:reportError
arg this = <instance of Error>
Nil:handleError
arg this = nil
arg error = <instance of Error>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of Error>
Object:throw
arg this = <instance of Error>
Function:protect
arg this = <instance of Function>
arg handler = <instance of Function>
var result = <instance of Error>
Proto:use
arg this = <instance of Proto>
arg func = <instance of Function>
arg failSilentlyAfterFree = false
var result = nil
var saveEnvir = <instance of Environment>
OSCMessageDispatcher:value
arg this = <instance of OSCMessageDispatcher>
arg msg = [*2]
arg time = 109.674036664
arg addr = <instance of NetAddr>
arg recvPort = 57120
< FunctionDef in Method Collection:collectInPlace >
arg item = <instance of OSCMessageDispatcher>
arg i = 0
ArrayedCollection:do
arg this = [*2]
arg function = <instance of Function>
var i = 0
Collection:collectInPlace
arg this = [*2]
arg function = <instance of Function>
FunctionList:value
arg this = <instance of FunctionList>
arg args = [*4]
arg kwargs = [*0]
var res = nil
Main:recvOSCmessage
arg this = <instance of Main>
arg time = 109.674036664
arg replyAddr = <instance of NetAddr>
arg recvPort = 57120
arg msg = [*2]