User:Philosopher/Nasal FGCommand crashes: Difference between revisions

Jump to navigation Jump to search
m
minimal test case
(→‎Current status: good idea H, that seems right!)
m (minimal test case)
Line 144: Line 144:
         argv=<error reading variable: Cannot access memory at address 0x4>)
         argv=<error reading variable: Cannot access memory at address 0x4>)
         at /home/flight/FG/fgfs/flightgear/src/Main/bootstrap.cxx:278
         at /home/flight/FG/fgfs/flightgear/src/Main/bootstrap.cxx:278
</syntaxhighlight>
=== Minimal test case to produce crash ===
<syntaxhighlight lang="nasal">
# Stress test
var FILE = "/Users/philosopher/Dropbox/Mihihehe/crash_index.log";
var namespace = nil;
var run = func(times=300008) {
var f = io.open(FILE, 'w');
io.seek(f, 0, io.SEEK_SET);
for (var i=0; i<times; i+=1) {
        io.write(f, i~"");
        io.seek(f, 0, io.SEEK_SET);
props.runBinding(g);
}
io.write(f, "");
io.close(f);
};
var g = props.Node.new().getNode("binding", 1);
g.setValues({
"command": "nasal",
"module": "__test_tmp",
"script": "3",
"setting": rand(),
});
var _t = systime();
run(); namespace = nil;
printf("binding running succeeded (took %03f seconds)", systime()-_t);
</syntaxhighlight>
</syntaxhighlight>
395

edits

Navigation menu