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
Darwin Russells-MacBook-Pro-314.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
Subsystem:
@libp2p/webrtc, AddressManagerInit, and packages/libp2p/src/transport-manager
I accidentally had two /webrtc entries in my listen: array passed to createLibp2p. It took me way too long to figure out what was actually happening. Note that this does not happen for duplicate TCP listen addresses.
The error that surfaces is
╰─ ✔ ❯ node src/listener.js
Listener ready, listening on:
file:///Users/sgtpooki/code/work/protocol.ai/test/SgtPooki/js-libp2p-examples/node_modules/libp2p/dist/src/transport-manager.js:115
return Array.of(...this.listeners.values()).flat();
^
RangeError: Maximum call stack size exceeded
at [Symbol.iterator] (<anonymous>)
at DefaultTransportManager.getListeners (file:///Users/sgtpooki/code/work/protocol.ai/test/SgtPooki/js-libp2p-examples/node_modules/libp2p/dist/src/transport-manager.js:115:22)
at WebRTCPeerListener.getAddrs (file:///Users/sgtpooki/code/work/protocol.ai/test/SgtPooki/js-libp2p-examples/node_modules/@libp2p/webrtc/dist/src/private-to-private/listener.js:18:14)
at file:///Users/sgtpooki/code/work/protocol.ai/test/SgtPooki/js-libp2p-examples/node_modules/@libp2p/webrtc/dist/src/private-to-private/listener.js:20:25
at Array.map (<anonymous>)
at WebRTCPeerListener.getAddrs (file:///Users/sgtpooki/code/work/protocol.ai/test/SgtPooki/js-libp2p-examples/node_modules/@libp2p/webrtc/dist/src/private-to-private/listener.js:20:14)
at file:///Users/sgtpooki/code/work/protocol.ai/test/SgtPooki/js-libp2p-examples/node_modules/@libp2p/webrtc/dist/src/private-to-private/listener.js:20:25
at Array.map (<anonymous>)
at WebRTCPeerListener.getAddrs (file:///Users/sgtpooki/code/work/protocol.ai/test/SgtPooki/js-libp2p-examples/node_modules/@libp2p/webrtc/dist/src/private-to-private/listener.js:20:14)
at file:///Users/sgtpooki/code/work/protocol.ai/test/SgtPooki/js-libp2p-examples/node_modules/@libp2p/webrtc/dist/src/private-to-private/listener.js:20:25
Node.js v18.16.1
Darwin Russells-MacBook-Pro-314.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
@libp2p/webrtc
,AddressManagerInit
, andpackages/libp2p/src/transport-manager
Severity:
Medium
Description:
Possibly fixed by #2133
I accidentally had two
/webrtc
entries in mylisten:
array passed tocreateLibp2p
. It took me way too long to figure out what was actually happening. Note that this does not happen for duplicate TCP listen addresses.The error that surfaces is
Which seems to stem from here:
https://github.com/libp2p/js-libp2p/blob/7ae6063dfbc754f95a2c4bd0a6bd146f2989a5f5/packages/libp2p/src/transport-manager.ts#L152C3-L154
Steps to reproduce the error:
You can reproduce this on my branch of a js-libp2p-examples fork, https://github.com/SgtPooki/js-libp2p-examples/tree/bug/repro-dupe-listen-max-call-stack. See the tiny diff of changes required to repro the error here: libp2p/js-libp2p-examples@8abf359
Steps to reproduce:
The text was updated successfully, but these errors were encountered: