You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node::Abort() in udpSocket.send(msg, port, address) if UDP socket is connected #28126
Platform: Darwin macbook 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
Subsystem: dgram
constdgram=require('dgram');constudpSocket=dgram.createSocket({type: 'udp4'});udpSocket.connect(1234,'127.0.0.1',(error)=>{console.log('UDP socket connected (error:%s)',String(error));// This is the proper way to send data on a connected UDP socket.// udpSocket.send('foo', (error) => console.log('error:', error));// This is for non connected UDP sockets. Anyway it should NOT produce an abort.udpSocket.send('foo',1234,'127.0.0.1',(error)=>console.log('error:',error));});
To clarify, the code above creates a UDP socket, connects it, and then uses the send() API by including the remote port and address (which are useless or even invalid in a connected UDP socket).
Not sure if send() should throw due the useless/invalid presence of port and address arguments, but it should not crash.
Activity
ibc commentedon Jun 8, 2019
Note that, according to the libuv UDP handle:
However, the issue here is a CHECK(args[2]->IsUint32()) in
udp_wrap.ccthat causes the above abort.dgram: fix abort on bad args
dgram: fix abort on bad args