René's URL Explorer Experiment


Title: node:test aborts in InternalCallbackScope::Close after listen EPERM · Issue #65667 · nodejs/node · GitHub

Open Graph Title: node:test aborts in InternalCallbackScope::Close after listen EPERM · Issue #65667 · nodejs/node

X Title: node:test aborts in InternalCallbackScope::Close after listen EPERM · Issue #65667 · nodejs/node

Description: Version Reproduced with v24.20.0 and v26.7.0. Platform Linux 7.1.9-arch1-2 x86_64, glibc 2.44. Subsystem test_runner, async_hooks, platform What steps will reproduce the bug? When bind(2) returns EPERM during a node:test test, Node can a...

Open Graph Description: Version Reproduced with v24.20.0 and v26.7.0. Platform Linux 7.1.9-arch1-2 x86_64, glibc 2.44. Subsystem test_runner, async_hooks, platform What steps will reproduce the bug? When bind(2) returns E...

X Description: Version Reproduced with v24.20.0 and v26.7.0. Platform Linux 7.1.9-arch1-2 x86_64, glibc 2.44. Subsystem test_runner, async_hooks, platform What steps will reproduce the bug? When bind(2) returns E...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"node:test aborts in InternalCallbackScope::Close after listen EPERM","articleBody":"### Version\n\nReproduced with v24.20.0 and v26.7.0.\n\n### Platform\n\nLinux 7.1.9-arch1-2 x86_64, glibc 2.44.\n\n### Subsystem\n\ntest_runner, async_hooks, platform\n\n### What steps will reproduce the bug?\n\nWhen `bind(2)` returns `EPERM` during a `node:test` test, Node can abort in `InternalCallbackScope::Close()` instead of reporting the listen error. The larger JS body appears to matter for timing. A much smaller `server.listen()` test reports `listen EPERM` normally.\n\nSave this as `deny-bind.c`:\n\n```c\n#define _GNU_SOURCE\n#include \u003cerrno.h>\n#include \u003csys/socket.h>\n\nint bind(int socket, const struct sockaddr *address, socklen_t address_len) {\n  errno = EPERM;\n  return -1;\n}\n```\n\nSave this as `repro.mjs`:\n\n```js\nimport { test } from 'node:test';\nimport assert from 'node:assert/strict';\nimport { randomUUID } from 'node:crypto';\nimport { mkdtemp, readFile, rm } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { tmpdir } from 'node:os';\nimport { createServer } from 'node:http';\nimport { spawn } from 'node:child_process';\n\nconst sourceId = randomUUID();\nconst stamp = '2026-08-30T12:00:00.000Z';\nconst item = { id: randomUUID(), version: 1, title: 'x', description: '', expected: '', steps: '', actual: '', evidence: '', author: '', team: '', area: '', feature: '', pagePath: '/reports', kind: 'issue', impact: 'high', status: 'new', priority: 'unassigned', owner: '', resolution: '', release: 'test', browser: '', viewport: '', createdAt: stamp, updatedAt: stamp, comments: [], history: [] };\nconst envelope = (changes = [{ sequence: 1, item }], overrides = {}) => ({ schemaVersion: 1, mode: 'changes', sourceId, after: 0, nextCursor: 1, hasMore: false, exportedAt: stamp, changes, ...overrides });\n\nfunction run(args, token = 'test-key'.padEnd(40, 'x')) {\n  return new Promise((resolve) => {\n    const child = spawn(process.execPath, ['-e', 'process.exit(0)', ...args], {\n      env: { ...process.env, FEEDBACK_SYNC_TOKEN: token, FEEDBACK_REMOTE_URL: '' },\n    });\n    let output = '';\n    child.stdout.on('data', (b) => { output += b; });\n    child.stderr.on('data', (b) => { output += b; });\n    child.on('close', (code) => resolve({ code, output }));\n  });\n}\n\ntest('reproducer', async () => {\n  const directory = await mkdtemp(join(tmpdir(), 'feedback-cli-'));\n  let failSecond = true;\n  let redirect = false;\n  const server = createServer((request, response) => {\n    if (redirect) { response.writeHead(302, { location: 'https://example.com' }); response.end(); return; }\n    const after = Number(new URL(request.url, 'http://localhost').searchParams.get('after'));\n    if (after === 1 && failSecond) { response.writeHead(503); response.end(); return; }\n    response.setHeader('content-type', 'application/json');\n    response.end(JSON.stringify(after === 0 ? envelope(undefined, { hasMore: true }) : after === 1 ? envelope([{ sequence: 2, item: { ...item, version: 2, status: 'planned' } }], { after: 1, nextCursor: 2 }) : envelope([], { after: 2, nextCursor: 2 })));\n  });\n  await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));\n  const url = `http://127.0.0.1:${server.address().port}`;\n  const args = ['--url', url, '--allow-http', '--out', directory];\n  try {\n    assert.equal((await run(['--url', url, '--out', directory])).code, 1);\n    assert.equal((await run(args)).code, 1);\n    assert.equal(JSON.parse(await readFile(join(directory, 'feedback.json'))).cursor, 1);\n    failSecond = false;\n    assert.equal((await run(args)).code, 0);\n    assert.equal((await run(args)).code, 0);\n    redirect = true;\n    assert.equal((await run(args)).code, 1);\n  } finally {\n    await new Promise((resolve) => server.close(resolve));\n    await rm(directory, { recursive: true, force: true });\n  }\n});\n```\n\nCompile the interceptor and run the test:\n\n```bash\ncc -shared -fPIC -o deny-bind.so deny-bind.c\nLD_PRELOAD=\"$PWD/deny-bind.so\" node --test --test-isolation=none repro.mjs\n```\n\nThis reproduced on every attempted run with both listed Node versions. It also occurs with the default process isolation, where the test child aborts and the parent reports a failed test.\n\n### How often does it reproduce? Is there a required condition?\n\nEvery run with the reproducer above on this machine. `bind()` must fail with `EPERM`. The original occurrence was inside a restricted environment where loopback binding was denied. When binding is permitted, the same test passes.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe test runner should report `Error: listen EPERM: operation not permitted 127.0.0.1` and exit with a normal test failure. A smaller `server.listen()` test under the same interceptor already behaves this way.\n\n### What do you see instead?\n\nThe process aborts with exit status 134:\n\n```text\nAssertion failed: (env_->execution_async_id()) == (0)\n\n1: node::Assert(node::AssertionInfo const&)\n2: node::InternalCallbackScope::Close()\n3: node::InternalCallbackScope::~InternalCallbackScope()\n4: node::PerIsolatePlatformData::RunForegroundTask(...)\n5: node::PerIsolatePlatformData::FlushForegroundTasksInternal()\n6: uv_run\n7: node::SpinEventLoopInternal(node::Environment*)\n8: node::NodeMainInstance::Run()\n9: node::Start(int, char**)\n```\n\nOn v24.20.0 the assertion is at `src/api/callback.cc:165`; on v26.7.0 it is at line 185.\n\n### Additional information\n\nThis may be related to #38155, but that older case involved `async-hook-domain` monkey-patching. This reproducer uses only built-in Node modules and the test runner.\n\nNo core dump is attached because cores may contain private process memory.\n","author":{"url":"https://github.com/Fuucodi0X","@type":"Person","name":"Fuucodi0X"},"datePublished":"2026-08-30T14:34:11Z","url":"https://github.com/nodejs/node/issues/65667"}

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:a0e0c6a0-ed3e-96bb-e98e-83b90ddbb055
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC990:1A50E8:97776:CDCF7:6AED32F0
html-safe-nonce59e26bdee87f4b5f3aeb9ee8c3b0a4436f8e000c1fe0aa0771e0e6c5ce4ccc05
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTkwOjFBNTBFODo5Nzc3NjpDRENGNzo2QUVEMzJGMCIsInZpc2l0b3JfaWQiOiI2NjU0NjU5NDQ0NTM0MTQyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac41bdcb8406d089ee8c2b7f407a152403f435e457d790206b98597f4eeeda80c1
hovercard-subject-tagissue:5292604008
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/65667/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3d4286b95d2ee99e37ded7791002b3b53cd35caac459633db8d69ae6137be5ac/nodejs/node/issues/65667
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3d4286b95d2ee99e37ded7791002b3b53cd35caac459633db8d69ae6137be5ac/nodejs/node/issues/65667
og:image:altVersion Reproduced with v24.20.0 and v26.7.0. Platform Linux 7.1.9-arch1-2 x86_64, glibc 2.44. Subsystem test_runner, async_hooks, platform What steps will reproduce the bug? When bind(2) returns E...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameFuucodi0X
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-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/65667#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F65667
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%2F65667
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/65667
Reloadhttps://github.com/nodejs/node/issues/65667
Reloadhttps://github.com/nodejs/node/issues/65667
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
#66308https://github.com/nodejs/node/pull/66308
node:test aborts in InternalCallbackScope::Close after listen EPERMhttps://github.com/nodejs/node/issues/65667#top
#66308https://github.com/nodejs/node/pull/66308
https://github.com/Fuucodi0X
Fuucodi0Xhttps://github.com/Fuucodi0X
on Aug 30, 2026https://github.com/nodejs/node/issues/65667#issue-5292604008
#38155https://github.com/nodejs/node/issues/38155
marcopiraccinihttps://github.com/marcopiraccini
on Sep 26, 2026https://github.com/nodejs/node/issues/65667#event-31890090729
fs: do not swallow exceptions thrown by completion callbackshttps://github.com/marcopiraccini/node/commit/84f74cee954aa02164b74748ee26c5f0f70af016
84f74cehttps://github.com/marcopiraccini/node/commit/84f74cee954aa02164b74748ee26c5f0f70af016
marcopiraccinihttps://github.com/marcopiraccini
on Oct 26, 2026https://github.com/nodejs/node/issues/65667#event-34254687735
fs: do not swallow exceptions thrown by completion callbackshttps://github.com/marcopiraccini/node/commit/cd266d27dd8083a66b623616ad4e5c8a75347404
cd266d2https://github.com/marcopiraccini/node/commit/cd266d27dd8083a66b623616ad4e5c8a75347404
nodejs-github-bothttps://github.com/nodejs-github-bot
on Oct 29, 2026https://github.com/nodejs/node/issues/65667#event-34565344718
fs: do not swallow exceptions thrown by completion callbackshttps://github.com/nodejs/node/commit/c9f1d2d31976eb04c69606074127724502abb4e9
c9f1d2dhttps://github.com/nodejs/node/commit/c9f1d2d31976eb04c69606074127724502abb4e9
nodejs-github-bothttps://github.com/nodejs-github-bot
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#66308https://github.com/nodejs/node/pull/66308
on Oct 29, 2026https://github.com/nodejs/node/issues/65667#event-34565345002
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/65667
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/65667
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.