Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'Symbol(kNativeFields)' using http2 session removeAllListeners #29457

Closed
crystalin opened this issue Sep 5, 2019 · 2 comments
Labels
http2 Issues or PRs related to the http2 subsystem.

Comments

@crystalin
Copy link

  • Version: 12.10 (12.9) but not 12.7
  • Platform: Linux and Mac (didn't try Window)

When using the removeAllListeners on a http2 stream inside an on("close"...) generates this error

TypeError: Cannot read property 'Symbol(kNativeFields)' of undefined
    at ClientHttp2Stream.streamListenerRemoved (internal/http2/core.js:453:21)
    at ClientHttp2Stream.emit (events.js:209:13)
    at ClientHttp2Stream.EventEmitter.emit (domain.js:476:20)
    at ClientHttp2Stream.removeListener (events.js:347:18)
    at ClientHttp2Stream.Readable.removeListener (_stream_readable.js:893:47)
    at ClientHttp2Stream.removeAllListeners (events.js:418:14)
    at ClientHttp2Stream.Readable.removeAllListeners (_stream_readable.js:909:51)
    at ClientHttp2Stream.removeAllListeners (events.js:407:16)
    at ClientHttp2Stream.Readable.removeAllListeners (_stream_readable.js:909:51)

The code generating it is:

... // creating http2 session and a http2 client stream
stream.on("close", () => {
  stream.removeAllListeners();
@addaleax addaleax added the http2 Issues or PRs related to the http2 subsystem. label Sep 5, 2019
@addaleax
Copy link
Member

addaleax commented Sep 5, 2019

Thanks for the bug report. This shouldn’t be too hard to fix, but a full reproduction would still be appreciated (just calling stream.removeAllListeners() inside its "close" event doesn’t seem sufficient).

@addaleax
Copy link
Member

addaleax commented Sep 5, 2019

Ah, nvm, it just needs an additional listener for priority or frameError to be present beforehand.

addaleax added a commit to addaleax/node that referenced this issue Sep 5, 2019
Do not crash when the session is no longer available.

Fixes: nodejs#29457
@Trott Trott closed this as completed in e585caa Sep 8, 2019
addaleax added a commit to addaleax/node that referenced this issue Sep 19, 2019
Do not crash when the session is no longer available.

Fixes: nodejs#29457

PR-URL: nodejs#29459
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
addaleax added a commit to addaleax/node that referenced this issue Sep 19, 2019
Do not crash when the session is no longer available.

Fixes: nodejs#29457

PR-URL: nodejs#29459
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
targos pushed a commit that referenced this issue Sep 20, 2019
Do not crash when the session is no longer available.

Fixes: #29457

PR-URL: #29459
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BethGriggs pushed a commit that referenced this issue Sep 25, 2019
Do not crash when the session is no longer available.

Fixes: #29457

PR-URL: #29459
Backport-PR-URL: #29618
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BridgeAR pushed a commit that referenced this issue Sep 25, 2019
Do not crash when the session is no longer available.

Fixes: #29457

PR-URL: #29459
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BethGriggs pushed a commit that referenced this issue Oct 1, 2019
Do not crash when the session is no longer available.

Fixes: #29457

PR-URL: #29459
Backport-PR-URL: #29619
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants