Title: `worker_threads.moveMessagePortToContext` results in an abort · Issue #38499 · nodejs/node · GitHub
Open Graph Title: `worker_threads.moveMessagePortToContext` results in an abort · Issue #38499 · nodejs/node
X Title: `worker_threads.moveMessagePortToContext` results in an abort · Issue #38499 · nodejs/node
Description: Version: v17.0.0-pre Platform: Linux 5.8.0-38-generic #43~20.04.1-Ubuntu SMP Tue Jan 12 16:39:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem: worker_threads.moveMessagePortToContext What steps will reproduce the bug? Setup a node i...
Open Graph Description: Version: v17.0.0-pre Platform: Linux 5.8.0-38-generic #43~20.04.1-Ubuntu SMP Tue Jan 12 16:39:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem: worker_threads.moveMessagePortToContext What step...
X Description: Version: v17.0.0-pre Platform: Linux 5.8.0-38-generic #43~20.04.1-Ubuntu SMP Tue Jan 12 16:39:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem: worker_threads.moveMessagePortToContext What step...
Opengraph URL: https://github.com/nodejs/node/issues/38499
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`worker_threads.moveMessagePortToContext` results in an abort","articleBody":"\u003c!--\r\nThank you for reporting an issue.\r\n\r\nThis issue tracker is for bugs and issues found within Node.js core.\r\nIf you require more general support please file an issue on our help\r\nrepo. https://github.com/nodejs/help\r\n\r\n\r\nPlease fill in as much of the template below as you're able.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or output of `\"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { \"x64\" } else { \"x86\" })\"` in PowerShell console (Windows)\r\nSubsystem: if known, please specify affected core module name\r\n-->\r\n\r\n* **Version**: v17.0.0-pre\r\n* **Platform**: Linux 5.8.0-38-generic #43~20.04.1-Ubuntu SMP Tue Jan 12 16:39:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux\r\n* **Subsystem**: worker_threads.moveMessagePortToContext\r\n\r\n### What steps will reproduce the bug?\r\nSetup a node instance,\r\n```\r\n» node\r\n```\r\nand run the following javascript code line by line.\r\n```\r\nworker_threads = require('worker_threads');msgChannel = new worker_threads.MessageChannel();\r\nmsgChannel.port2.close();\r\nworker_threads.moveMessagePortToContext(msgChannel.port2,{});\r\n```\r\nThen an abort occurs. \r\nNoticed that paste these codes to REPL all at once seems cannot trigger this abort. Run these codes line by line pls.\r\n\u003c!--\r\nEnter details about your bug, preferably a simple code snippet that can be\r\nrun using `node` directly without installing third-party dependencies.\r\n-->\r\n\r\n### How often does it reproduce? Is there a required condition?\r\nThis problem can always be triggered following the steps above.\r\n\r\n### What is the expected behavior?\r\nIf any error occurs, an exception or other similar error-reporting stuff should be thrown. There is no reason to abort the whole node process.\r\n\r\n\u003c!--\r\nIf possible please provide textual output instead of screenshots.\r\n-->\r\n\r\n### What do you see instead?\r\n```\r\n» node\r\nWelcome to Node.js v17.0.0-pre.\r\nType \".help\" for more information.\r\n> worker_threads = require('worker_threads');msgChannel = new worker_threads.MessageChannel();\r\nMessageChannel {\r\n port1: MessagePort [EventTarget] {\r\n active: true,\r\n refed: false,\r\n [Symbol(kEvents)]: SafeMap(2) [Map] {\r\n 'newListener' => [Object],\r\n 'removeListener' => [Object]\r\n },\r\n [Symbol(events.maxEventTargetListeners)]: 10,\r\n [Symbol(events.maxEventTargetListenersWarned)]: false,\r\n [Symbol(kNewListener)]: [Function (anonymous)],\r\n [Symbol(kRemoveListener)]: [Function (anonymous)],\r\n [Symbol(nodejs.internal.kCurrentlyReceivingPorts)]: undefined\r\n },\r\n port2: MessagePort [EventTarget] {\r\n active: true,\r\n refed: false,\r\n [Symbol(kEvents)]: SafeMap(2) [Map] {\r\n 'newListener' => [Object],\r\n 'removeListener' => [Object]\r\n },\r\n [Symbol(events.maxEventTargetListeners)]: 10,\r\n [Symbol(events.maxEventTargetListenersWarned)]: false,\r\n [Symbol(kNewListener)]: [Function (anonymous)],\r\n [Symbol(kRemoveListener)]: [Function (anonymous)],\r\n [Symbol(nodejs.internal.kCurrentlyReceivingPorts)]: undefined\r\n }\r\n}\r\n> msgChannel.port2.close();\r\nundefined\r\n> worker_threads.moveMessagePortToContext(msgChannel.port2,{});\r\n/home/zys/Toolchains/node/node[59534]: ../src/node_messaging.cc:1068:static void node::worker::MessagePort::MoveToContext(const FunctionCallbackInfo\u003cv8::Value> &): Assertion `(port) != nullptr' failed.\r\n 1: 0x3623e04 node::DumpBacktrace(_IO_FILE*) [/home/zys/Toolchains/node/node]\r\n 2: 0x37bb92e node::Abort() [/home/zys/Toolchains/node/node]\r\n 3: 0x37bb3f8 [/home/zys/Toolchains/node/node]\r\n 4: 0x38c8dac node::worker::MessagePort::MoveToContext(v8::FunctionCallbackInfo\u003cv8::Value> const&) [/home/zys/Toolchains/node/node]\r\n 5: 0x3ebd0d8 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/home/zys/Toolchains/node/node]\r\n 6: 0x3ebadb9 [/home/zys/Toolchains/node/node]\r\n 7: 0x3eb8d1d [/home/zys/Toolchains/node/node]\r\n 8: 0x5a08759 [/home/zys/Toolchains/node/node]\r\n[1] 59534 abort (core dumped) /home/zys/Toolchains/node/node\r\n```\r\n\u003c!--\r\nIf possible please provide textual output instead of screenshots.\r\n-->\r\n\r\n### Additional information\r\n\r\n\u003c!--\r\nTell us anything else you think we should know.\r\n-->\r\n","author":{"url":"https://github.com/zyscoder","@type":"Person","name":"zyscoder"},"datePublished":"2021-05-01T16:18:50Z","url":"https://github.com/nodejs/node/issues/38499"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:acb607a7-2ce7-fd06-2953-90da6cfb94ce |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFC2:30551B:6E1DF6:94B68E:6AED29CD |
| html-safe-nonce | 2a6cd51199c855368c312cf57026b8288fe71926a87075f993ce3a66e4ee5695 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkMyOjMwNTUxQjo2RTFERjY6OTRCNjhFOjZBRUQyOUNEIiwidmlzaXRvcl9pZCI6IjY3NTA4NjQzMTcxMjc4Mjc5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 16b29281d0736ca453963b4369bb12a4c24b6804b10b6b8e761c9c3c6b2002a9 |
| hovercard-subject-tag | issue:873713087 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/38499/issue_layout |
| twitter:image | https://opengraph.githubassets.com/37d7f4a3b5383758d8e345720cfdac75d5c29c584ad72c54c7e95fa0db2fbd74/nodejs/node/issues/38499 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/37d7f4a3b5383758d8e345720cfdac75d5c29c584ad72c54c7e95fa0db2fbd74/nodejs/node/issues/38499 |
| og:image:alt | Version: v17.0.0-pre Platform: Linux 5.8.0-38-generic #43~20.04.1-Ubuntu SMP Tue Jan 12 16:39:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem: worker_threads.moveMessagePortToContext What step... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zyscoder |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width