davidmarkclements / 0x

🔥 single-command flamegraph profiling 🔥
MIT License
3.23k stars 106 forks source link

RangeError: Invalid string length #272

Closed smcgivern closed 1 year ago

smcgivern commented 1 year ago

I've seen https://github.com/davidmarkclements/0x/issues/63, but this seems more severe as it happens for me even on a very basic script:

$ cat foo.js
console.log('hi');
$ node -v
v18.15.0
$ 0x -v
0x 5.5.0
$ DEBUG=0x* 0x -o foo.js
🔥  Profilinghi
Fatal error in process observed by 0x. Incomplete V8 isolate log is readable for debugging at /Users/smcgivern/Code/tmp/isolate-0x128040000-49108-49108-v8.log
RangeError: 
🚫  Invalid string length
    at log (/Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/node_modules/single-line-log/index.js:28:55)
    at /Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/cmd.js:137:30
    at v8 (/Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/platform/v8.js:118:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async zeroEks (/Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/index.js:46:43)
    at async cmd (/Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/cmd.js:98:21)
  0x RangeError: 
  0x 🚫  Invalid string length
  0x     at log (/Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/node_modules/single-line-log/index.js:28:55)
  0x     at /Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/cmd.js:137:30
  0x     at v8 (/Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/platform/v8.js:118:3)
  0x     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  0x     at async zeroEks (/Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/index.js:46:43)
  0x     at async cmd (/Users/smcgivern/.asdf/installs/nodejs/18.15.0/lib/node_modules/0x/cmd.js:98:21) +0ms

Am I doing something obviously wrong here? Full log attached, if it helps.

isolate-0x128040000-49108-49108-v8.log

smcgivern commented 1 year ago

Ha, this is because I'm using a weird shell + terminal emulator (eshell). https://www.gnu.org/software/emacs/manual/html_mono/eshell.html#Visual-Commands describes the problem here. Never mind, thanks for the great tool!