Parsing multiple igc file in a cause mac terminal to crash
Closed this issue · 15 comments
Hello,
I try to analyse multiple igc file in a loop, causing mac os terminal to become grey and the node process crashes.
this code is being looped for around 200 flights:
console.log('before');
var score_flight = IGCParser.parse(row.V_IGC, {
lenient: true
});
console.log('parsed');
var result_ffvl = solver(score_flight, scoring.FFVL).next().value;
console.log('r1');
var result_xcontest = solver(score_flight, scoring.XContest).next().value;
console.log('r2');
It iterates over 3 flights and crashes at the fourth. console log :
before
parsed
r1
r2
before
parsed
r1
r2
before
parsed
r1
r2
before
parsed
r1
Is there something I'm not doing right?
Can you pls attach the IGC file, there is probably something in it
The code appears otherwise correct
Here it is,
I realized It is not exactly a flight. It is rather a blowback incident detected as a flight by my instrument. Maybe the lack of data...
I can't reproduce the crash? Does it always crash on this file, or is it only when it is used after the first three?
I ordered files differently and still crashing but on a different file (still the fourth). The complete flow is:
- connecting sqlite3 db containing files;
- querying db;
- for each record, process IGC data stored (including calling igc-xc-score as described before);
Might be a memory issue, the fact that terminal window becomes grey (originally black) could be a clue. I've never met such a behaviour...
Does a terminal reset fix the issue? Might be related to the ANSI control characters. Can you create a repro with all the files needed?
Nope, neither reset, neither restart. I noticed flight count may vary before crash occurs. Here is the requested repo, you should use the igc-xc-score-crash branch:
https://github.com/Djang0/IFly
Before running, you might want to adapt config.json to suit your needs. I attached a copy of sqlite db
fly.db.zip
please don't pay attention to the code, this is only a draft.
Here is a screen recording of the described behaviour:
https://youtu.be/cIJEkRY-rxA
Normal behaviour : the terminal shows db close console log.
I tried both with iTerm 2 and the built-in OSX terminal and cannot reproduce that behavior - the terminal turning grey.
However I get an exception in igc-analyzer.js
after the 3rd flight and once I short-circuited all the thermal analysis the whole program seemed to run normally.
I strongly suspect that this is some problem with the exception coming in the middle of some ANSI sequence for changing terminal colors. Can you try to redirect the output in a file with > stdout
to check if you see something in it?
I pushed a file called crash.out to my repo. It results from the following command:
node index.js > crash.out
It is indeed a case of garbled ANSI control sequence
You can see it with node index.js >& crash.out
The reason I was not reproducing it, is that I am using a git checkout. Can you try a git checkout and confirm me that it has been fixed on git? If so, I will release a 1.5.2
I'm not sure to fully understand your request. Do you want me checkout your latest github repo and replace the content of "node_modules" dir of igc-xc-score ?
Or simply recloning my own repo (I don't really get the ANSI aspect of the checkout operation)?
cd node_modules
rm -rf igc-xc-score
git clone git@github.com:mmomtchev/igc-xc-score.git
cd igc-xc-score
npm install
npm run build
Yes! I can confirm you nailed it.
however, I get this error at build time:
> igc-xc-score@1.5.1 www /Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score
> webpack && cp www/index.html www/pacman.svg dist/www
date: illegal option -- I
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/bin/cli.js:93
throw err;
^
Error: Command failed: date -I
date: illegal option -- I
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
at checkExecSyncError (child_process.js:616:11)
at Object.execSync (child_process.js:652:15)
at Object.<anonymous> (/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/webpack.config.js:8:25)
at Module._compile (/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at WEBPACK_OPTIONS (/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/bin/utils/convert-argv.js:114:13)
at requireConfig (/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/bin/utils/convert-argv.js:116:6)
at /Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/bin/utils/convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/bin/utils/convert-argv.js:121:15)
at /Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/bin/cli.js:71:45
at Object.parse (/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/yargs/yargs.js:576:18)
at /Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack-cli/bin/cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/lreenaers/Documents/code/IFly/node_modules/igc-xc-score/node_modules/webpack/bin/webpack.js:156:2)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
status: 1,
signal: null,
output: [
null,
Buffer(0) [Uint8Array] [],
Buffer(171) [Uint8Array] [
100, 97, 116, 101, 58, 32, 105, 108, 108, 101, 103, 97,
108, 32, 111, 112, 116, 105, 111, 110, 32, 45, 45, 32,
73, 10, 117, 115, 97, 103, 101, 58, 32, 100, 97, 116,
101, 32, 91, 45, 106, 110, 82, 117, 93, 32, 91, 45,
100, 32, 100, 115, 116, 93, 32, 91, 45, 114, 32, 115,
101, 99, 111, 110, 100, 115, 93, 32, 91, 45, 116, 32,
119, 101, 115, 116, 93, 32, 91, 45, 118, 91, 43, 124,
45, 93, 118, 97, 108, 91, 121, 109, 119, 100, 72, 77,
83, 93, 93, 32,
... 71 more items
]
],
pid: 60619,
stdout: Buffer(0) [Uint8Array] [],
stderr: Buffer(171) [Uint8Array] [
100, 97, 116, 101, 58, 32, 105, 108, 108, 101, 103, 97,
108, 32, 111, 112, 116, 105, 111, 110, 32, 45, 45, 32,
73, 10, 117, 115, 97, 103, 101, 58, 32, 100, 97, 116,
101, 32, 91, 45, 106, 110, 82, 117, 93, 32, 91, 45,
100, 32, 100, 115, 116, 93, 32, 91, 45, 114, 32, 115,
101, 99, 111, 110, 100, 115, 93, 32, 91, 45, 116, 32,
119, 101, 115, 116, 93, 32, 91, 45, 118, 91, 43, 124,
45, 93, 118, 97, 108, 91, 121, 109, 119, 100, 72, 77,
83, 93, 93, 32,
... 71 more items
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! igc-xc-score@1.5.1 www: `webpack && cp www/index.html www/pacman.svg dist/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the igc-xc-score@1.5.1 www script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lreenaers/.npm/_logs/2021-01-14T11_06_44_318Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! igc-xc-score@1.5.1 build: `rollup -c && npm run nexe_all && npm run www && npm run doc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the igc-xc-score@1.5.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lreenaers/.npm/_logs/2021-01-14T11_06_44_357Z-debug.log
➜ igc-xc-score git:(master) ✗
No, this is only webpack which doesn't work on OS X
Ignore the webpack, it is for the demo website
Run your application with this version
Ok, thank you.
I released an official 1.5.2