Closed heapwolf closed 4 years ago
From using latest swarm? Haven’t seen that no
yeah, latest swarm
Do you have an example or something like that to help me debug?
im on node 12.16.2
. @indutny was also able to confirm that he has seen this before but was not able to reproduce reliably.
Clone this repo, npm install, and then in one terminal window run INST=0 ./bin/peerchan.js
, and in a second, INST=1 ./bin/peerchan.js
.
Click on the blue line at the bottom of the window to focus if its not already focused. That's where you enter text. Type /id user1
in the first window, and /id user2
in the second.
Type /r
in the second window to request an invite to the chat in the fist window.
Copy to clipboard is a little squirrely, so you may need to use your mouse to select the invite text. But paste /a user2 8fbc1...
into the first window.
Chat with yourself for a bit and at some point it should crash...
Amazing, thanks @heapwolf - will try to repro today. Is this crashing for you on mac or linux?
Its crashing on both. I feel like ive narrowed it down (possibly?) when I issue the command /r
the copy button wasn't working, so I tried it again, this would have caused to invites to be waited on... hmm, still investigating it, but if im careful not to do that it's not crashing.
Good info, I didn’t get to it today but first on the list tmw
I wonder if _onclose()
can be called in utp-native
before .bind()
somehow?
@heapwolf can repro
I figured it out! Our error logic forwarding logic had a mistake, and @heapwolf's program is shallowing uncaughts.
@heapwolf this is the uncaught that leads to the abort
TypeError: Cannot destructure property 'trusteeName' of 'currentInvite' as it is undefined.
at Button.<anonymous> (/Users/maf/dev/node_modules/utp-native/foo/peerchan/src/views/invite.js:47:22)
at Button.EventEmitter._emit (/Users/maf/dev/node_modules/utp-native/foo/peerchan/node_modules/neo-blessed/lib/events.js:98:20)
at Button.EventEmitter.emit (/Users/maf/dev/node_modules/utp-native/foo/peerchan/node_modules/neo-blessed/lib/events.js:117:12)
at Program.<anonymous> (/Users/maf/dev/node_modules/utp-native/foo/peerchan/node_modules/neo-blessed/lib/widgets/screen.js:508:34)
at Program.emit (events.js:310:20)
at Program._bindMouse (/Users/maf/dev/node_modules/utp-native/foo/peerchan/node_modules/neo-blessed/lib/program.js:703:10)
at Program.<anonymous> (/Users/maf/dev/node_modules/utp-native/foo/peerchan/node_modules/neo-blessed/lib/program.js:566:10)
at Program.emit (events.js:310:20)
at /Users/maf/dev/node_modules/utp-native/foo/peerchan/node_modules/neo-blessed/lib/program.js:418:15
at Array.forEach (<anonymous>)
(It obvs shouldn't abort Node.js, i'll fix that part)
For reference here is a simple repro case
const utp = require('utp-native')
const s= utp()
s.bind(0)
s.on('message', function () {
throw new Error('crash')
})
setInterval(function () {
const size = 4096
s.send(Buffer.alloc(size), 0, size, s.address().port, '127.0.0.1')
}, 100)
process.on('uncaughtException', function (err) {
console.log(err)
})
Current utp-native expects you to crash on uncaughts which is why I haven't seen this before I guess. Submitting a patch shortly
utp fix: https://github.com/mafintosh/utp-native/commit/0c7174904db3b8c804afa250c9ba6263077bdc25
will make a new release tmw
Fantastic resolution time. Thank you, @mafintosh !
Fix released with prebuilds
(gonna close this, @heapwolf feel free to comment if it works)
@mafintosh right on! you rock! 🎉
Has anyone seen this error with utp-native?