René's URL Explorer Experiment


Title: Crash in AddressToJS for udp6 socket bound to link-local address · Issue #41500 · nodejs/node · GitHub

Open Graph Title: Crash in AddressToJS for udp6 socket bound to link-local address · Issue #41500 · nodejs/node

X Title: Crash in AddressToJS for udp6 socket bound to link-local address · Issue #41500 · nodejs/node

Description: Version v17.3.1 Platform Linux darkk-ya-laptop 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem dgram What steps will reproduce the bug? Use the following four files to build the tes...

Open Graph Description: Version v17.3.1 Platform Linux darkk-ya-laptop 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem dgram What steps will reproduce the bug? Use t...

X Description: Version v17.3.1 Platform Linux darkk-ya-laptop 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem dgram What steps will reproduce the bug? Use t...

Opengraph URL: https://github.com/nodejs/node/issues/41500

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash in AddressToJS for udp6 socket bound to link-local address","articleBody":"### Version\n\nv17.3.1\n\n### Platform\n\nLinux darkk-ya-laptop 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux\n\n### Subsystem\n\ndgram\n\n### What steps will reproduce the bug?\n\nUse the following four files to build the test-case:\r\n\r\n\r\n- `dgram-udp6-address.js`:\r\n```js\r\n'use strict';\r\n\r\nconst dgram = require('dgram');\r\nconst socket = dgram.createSocket({ type: 'udp6' });\r\n\r\nconst discard_port = 9;\r\nconst global_ipv6 = '2600::';\r\n\r\n// It might be rejected if there is no route to the ip (e.g. IPv4-only network).\r\nsocket.connect(discard_port, global_ipv6, err => {\r\n  if (err === undefined) {\r\n    console.log('remoteAddress: ', socket.remoteAddress());\r\n    // The next line triggers assertion under certain conditions:\r\n    // node[631]: ../src/tcp_wrap.cc:354:v8::Local\u003cv8::Object> node::AddressToJS(node::Environment*, const sockaddr*, v8::Local\u003cv8::Object>): Assertion `(r) == (0)' failed.\r\n    console.log('address: ', socket.address());\r\n  } else {\r\n    console.log('UDP connection error', err);\r\n  }\r\n  socket.unref();\r\n});\r\n```\r\n\r\n- `Dockerfile`:\r\n```Dockerfile\r\nFROM node:17-bullseye\r\n\r\nRUN set -ex \\\r\n    && apt-get update \\\r\n    && apt-get install -y --no-install-recommends iproute2 \\\r\n    && :\r\n\r\nCOPY --chown=0:0 \\\r\n    dgram-udp6-address.js \\\r\n    test.sh \\\r\n    /\r\n```\r\n\r\n- `test.sh`:\r\n```bash\r\n#!/bin/bash\r\n\r\nset -ex\r\n\r\nip link add dummy0 type dummy\r\nip link set dummy0 up\r\nip -6 address add fe80::aaaa:bbbb:cccc:dddd dev dummy0\r\nip -6 route add default dev dummy0\r\nip addr\r\nip -6 route\r\nnode --version\r\nnode /dgram-udp6-address.js\r\n```\r\n\r\n- `run.sh`:\r\n```bash\r\n#!/bin/bash\r\n\r\nset -ex\r\n\r\ntar cz Dockerfile dgram-udp6-address.js test.sh | docker build -t dgram-udp6-address:latest -\r\n\r\nexec docker run --rm --tty -i \\\r\n    --privileged \\\r\n    --net=none \\\r\n     --sysctl net.ipv6.conf.all.disable_ipv6=0 \\\r\n    dgram-udp6-address:latest \\\r\n    /bin/bash /test.sh\r\n```\r\n\r\nThe test-case is run with `./run.sh`.\n\n### How often does it reproduce? Is there a required condition?\n\nIt's 100% reproducible with this network set-up.\r\n\r\nThis network setup simulates the **default** setup of Rostelecom ISP in St. Petersburg regarding their handling of IPv6 as seen by my Ubuntu 16.04 laptop:\r\n- the ISP-provided router announces a default gateway via link-local address `fe80::1`\r\n- local machines get link-local address\r\n- no real IPv6 connectivity is provided\r\n- the router responds with `ICMP6, destination unreachable, unreachable route` to IPv6 packets with global destination\n\n### What is the expected behavior?\n\n`node` should not crash whole app. It should rather be some kind of exception, socket error or something like that.\r\n\r\nI've noticed the behavior while developing Electron app, whole app was terminated on `socket.address()` call.\n\n### What do you see instead?\n\n```\r\n...\r\n+ node /dgram-udp6-address.js\r\nremoteAddress:  { address: '2600::', family: 'IPv6', port: 9 }\r\nnode[15]: ../src/tcp_wrap.cc:372:v8::Local\u003cv8::Object> node::AddressToJS(node::Environment*, const sockaddr*, v8::Local\u003cv8::Object>): Assertion `(r) == (0)' failed.\r\n 1: 0xb2c330 node::Abort() [node]\r\n 2: 0xb2c3ae  [node]\r\n 3: 0xc1da97 node::AddressToJS(node::Environment*, sockaddr const*, v8::Local\u003cv8::Object>) [node]\r\n 4: 0xc2f2ad void node::GetSockOrPeerName\u003cnode::UDPWrap, &uv_udp_getsockname>(v8::FunctionCallbackInfo\u003cv8::Value> const&) [node]\r\n 5: 0xd798de  [node]\r\n 6: 0xd7acff v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]\r\n 7: 0x162fff9  [node]\r\n/test.sh: line 12:    15 Aborted                 (core dumped) node /dgram-udp6-address.js\r\n```\n\n### Additional information\n\nOther affected versions are v12.22.8, v14.18.2, v16.13.1\r\n\r\nRelevant `strace` snippet is:\r\n\r\n```\r\nsocket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 17\r\nbind(17, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, \"::\", &sin6_addr), sin6_scope_id=0}, 28) = 0\r\nconnect(17, {sa_family=AF_INET6, sin6_port=htons(9), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, \"2600::\", &sin6_addr), sin6_scope_id=0}, 28) = 0\r\ngetpeername(17, {sa_family=AF_INET6, sin6_port=htons(9), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, \"2600::\", &sin6_addr), sin6_scope_id=0}, [128->28]) = 0\r\n\r\nremoteAddress:  { address: '2600::', family: 'IPv6', port: 9 }\r\n\r\ngetsockname(17, {sa_family=AF_INET6, sin6_port=htons(44890), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, \"fe80::aaaa:bbbb:cccc:dddd\", &sin6_addr), sin6_scope_id=0}, [128->28]) = 0\r\naccess(\"/proc/net\", R_OK)               = 0\r\naccess(\"/proc/net/unix\", R_OK)          = 0\r\nsocket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 20\r\nioctl(20, SIOCGIFNAME, {ifr_index=0})   = -1 ENODEV (No such device)\r\nclose(20)                               = 0\r\ngetpid()                                = 18\r\n\r\nnode[18]: ../src/tcp_wrap.cc:372:v8::Local\u003cv8::Object> node::AddressToJS(node::Environment*, const sockaddr*, v8::Local\u003cv8::Object>): Assertion `(r) == (0)' failed.\r\n```\r\n\r\nSo, the kernel returns `sin6_flowinfo=htonl(0)` for the bound socket, so the assertion is false.\r\n\r\n#39143 seems to be a similar issue on AIX.","author":{"url":"https://github.com/darkk","@type":"Person","name":"darkk"},"datePublished":"2022-01-13T13:56:15Z","url":"https://github.com/nodejs/node/issues/41500"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:47426ff2-a639-0a54-c97c-284b998ea6df
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA8FA:143C91:D07497:115523C:6AED3F7A
html-safe-noncea2fb9dec59d567ea4090aee818206c062bc0d6f60e743d5dbd75d5ca053aab36
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEZBOjE0M0M5MTpEMDc0OTc6MTE1NTIzQzo2QUVEM0Y3QSIsInZpc2l0b3JfaWQiOiIzMjcwODgzOTAyODUwMTU0MzYyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd0e2d18ec944153af18f74c2551ac536fd5e2bd501c6132c95d94686b24a5596
hovercard-subject-tagissue:1101779809
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/41500/issue_layout
twitter:imagehttps://opengraph.githubassets.com/03504a46e17e03478024ef00619a587636bdc6aaf62ba23602fae8b5f176b84d/nodejs/node/issues/41500
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/03504a46e17e03478024ef00619a587636bdc6aaf62ba23602fae8b5f176b84d/nodejs/node/issues/41500
og:image:altVersion v17.3.1 Platform Linux darkk-ya-laptop 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Subsystem dgram What steps will reproduce the bug? Use t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedarkk
hostnamegithub.com
expected-hostnamegithub.com
None26c92a9388ddfad3fa88d132b5d5f0b4747030233dcc4e5efb05f1cbae152184
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec629ad99c254d306375fc8354d04321c2c362236
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/41500#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F41500
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F41500
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/41500
Reloadhttps://github.com/nodejs/node/issues/41500
Reloadhttps://github.com/nodejs/node/issues/41500
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues656 (656)https://github.com/nodejs/node/issues
Pull requests665 (665)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/pulse
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/41500
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/41500
#41547https://github.com/nodejs/node/pull/41547
Crash in AddressToJS for udp6 socket bound to link-local addresshttps://github.com/nodejs/node/issues/41500#top
#41547https://github.com/nodejs/node/pull/41547
dgramIssues and PRs related to UDP and the dgram module.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22dgram%22
https://github.com/darkk
darkkhttps://github.com/darkk
on Jan 13, 2022https://github.com/nodejs/node/issues/41500#issue-1101779809
#242https://github.com/nodejs/node/issues/242
#39143https://github.com/nodejs/node/issues/39143
Mesteeryhttps://github.com/Mesteery
dgramIssues and PRs related to UDP and the dgram module.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22dgram%22
on Jan 13, 2022https://github.com/nodejs/node/issues/41500#event-5889921779
nodejs-github-bothttps://github.com/nodejs-github-bot
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#41547https://github.com/nodejs/node/pull/41547
on Feb 11, 2022https://github.com/nodejs/node/issues/41500#event-6050594813
nodejs-github-bothttps://github.com/nodejs-github-bot
on Feb 11, 2022https://github.com/nodejs/node/issues/41500#event-6050595077
src: don't print interface if sin6_scope_id is 0https://github.com/nodejs/node/commit/3b338cfbe9fd649ab9407b9be3661cbc8a081058
3b338cfhttps://github.com/nodejs/node/commit/3b338cfbe9fd649ab9407b9be3661cbc8a081058
benglhttps://github.com/bengl
on Feb 21, 2022https://github.com/nodejs/node/issues/41500#event-6109104992
src: don't print interface if sin6_scope_id is 0https://github.com/bengl/node/commit/6076291168fd44f4bd416870ff45e83a22f7e9ce
6076291https://github.com/bengl/node/commit/6076291168fd44f4bd416870ff45e83a22f7e9ce
src: don't print interface if sin6_scope_id is 0https://github.com/bengl/node/commit/9519f9636db71f8bc91b0ec25fb5ba64cca0d642
9519f96https://github.com/bengl/node/commit/9519f9636db71f8bc91b0ec25fb5ba64cca0d642
danielleadamshttps://github.com/danielleadams
on Apr 21, 2022https://github.com/nodejs/node/issues/41500#event-6467473370
src: don't print interface if sin6_scope_id is 0https://github.com/danielleadams/node/commit/5abf380c28b8ec73daaba96ebc8901b913d484da
5abf380https://github.com/danielleadams/node/commit/5abf380c28b8ec73daaba96ebc8901b913d484da
src: don't print interface if sin6_scope_id is 0https://github.com/nodejs/node/commit/86b9d3af98501820ecc6d99780843bf09941516f
86b9d3ahttps://github.com/nodejs/node/commit/86b9d3af98501820ecc6d99780843bf09941516f
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/41500
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/41500
dgramIssues and PRs related to UDP and the dgram module.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22dgram%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.