René's URL Explorer Experiment


Title: fix(worker): let a heap-limit terminate re-enter the inspector lock from console.log by adrian-niculescu · Pull Request #2070 · NativeScript/android · GitHub

Open Graph Title: fix(worker): let a heap-limit terminate re-enter the inspector lock from console.log by adrian-niculescu · Pull Request #2070 · NativeScript/android

X Title: fix(worker): let a heap-limit terminate re-enter the inspector lock from console.log by adrian-niculescu · Pull Request #2070 · NativeScript/android

Description: In a debug build, a worker that runs out of heap inside console.log can leave its thread deadlocked for good: the parent still gets the heap-limit error, but the worker never finishes terminating. WorkerWrapper::ConsoleLog holds inspectorMutex_ across WorkerInspectorClient::consoleLog, which allocates on the worker heap: it captures a stack trace, and building the message text converts the arguments, which can run getters. When an allocation there reaches the worker's limit, V8 runs OnNearHeapLimit synchronously on the same thread, which calls Terminate(), which takes inspectorMutex_ again to notify the inspector. The mutex is not recursive, so the thread blocks on itself. This holds while no DevTools session has enabled the Debugger domain; once one has, V8 calls its own near-heap-limit callback instead of the worker's. inspectorMutex_ is a std::recursive_mutex now: the same thread re-enters, and every other thread is excluded as before. Releasing the mutex across consoleLog instead would not be safe, because a worker callback run through __runOnMainThread logs from the main thread while the worker thread can delete the client. With OnNearHeapLimit called at that point by hand, the worker thread on main stays blocked in Terminate() under ConsoleLog, and with this change it finishes terminating. The only difference a spec could observe is a thread that never finishes, so there is none. The full device suite passes. Summary by CodeRabbit Bug Fixes Workers remain responsive when logging an object triggers additional logging during formatting. Improved reliability of worker termination and inspector operations during nested console logging. Tests Added coverage for nested logging in workers, including verification that the worker can continue running afterward.

Open Graph Description: In a debug build, a worker that runs out of heap inside console.log can leave its thread deadlocked for good: the parent still gets the heap-limit error, but the worker never finishes terminating. ...

X Description: In a debug build, a worker that runs out of heap inside console.log can leave its thread deadlocked for good: the parent still gets the heap-limit error, but the worker never finishes terminating. ...

Opengraph URL: https://github.com/NativeScript/android/pull/2070

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:8bb86714-0ccb-5869-d08e-3f64730c5f8a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE4A6:358871:172D60A:1E831D1:6B0132D4
html-safe-nonced2a2da52c5ebff05eb64ae145bc75d2475cd476a425d3430c24542b0cf2709d1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEE2OjM1ODg3MToxNzJENjBBOjFFODMxRDE6NkIwMTMyRDQiLCJ2aXNpdG9yX2lkIjoiNDY1MzU1MjI2MTkxMjQwODc4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac14791277dd05f1100d50e954bc96605282c2a55acf45e11730d84bb56ce7f527
hovercard-subject-tagpull_request:4764961927
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/android/pull/2070/files
twitter:imagehttps://avatars.githubusercontent.com/u/15037449?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/15037449?s=400&v=4
og:image:altIn a debug build, a worker that runs out of heap inside console.log can leave its thread deadlocked for good: the parent still gets the heap-limit error, but the worker never finishes terminating. ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/android git https://github.com/NativeScript/android.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id29137950
octolytics-dimension-repository_nwoNativeScript/android
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id29137950
octolytics-dimension-repository_network_root_nwoNativeScript/android
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/android/pull/2070/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2070%2Ffiles
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%2FNativeScript%2Fandroid%2Fpull%2F2070%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fandroid
Reloadhttps://github.com/NativeScript/android/pull/2070/files
Reloadhttps://github.com/NativeScript/android/pull/2070/files
Reloadhttps://github.com/NativeScript/android/pull/2070/files
NativeScripthttps://github.com/NativeScript
androidhttps://github.com/NativeScript/android
Codehttps://github.com/NativeScript/android
Issues106 (106)https://github.com/NativeScript/android/issues
Pull requests24 (24)https://github.com/NativeScript/android/pulls
Actionshttps://github.com/NativeScript/android/actions
Projectshttps://github.com/NativeScript/android/projects
Wikihttps://github.com/NativeScript/android/wiki
Security and qualityhttps://github.com/NativeScript/android/security
Insightshttps://github.com/NativeScript/android/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fandroid%2Fissues%2Fnew%2Fchoose
edusperonihttps://github.com/edusperoni
NativeScript:mainhttps://github.com/NativeScript/android/tree/main
adrian-niculescu:fix/worker-console-log-inspector-lockhttps://github.com/adrian-niculescu/NativeScript-Android/tree/fix/worker-console-log-inspector-lock
Conversation 5 https://github.com/NativeScript/android/pull/2070
Commits 4 https://github.com/NativeScript/android/pull/2070/commits
Checks 4 https://github.com/NativeScript/android/pull/2070/checks
Files changed https://github.com/NativeScript/android/pull/2070/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2070/files
fix(worker): let a heap-limit terminate re-enter the inspector lock from console.log https://github.com/NativeScript/android/pull/2070/files#top
Show all changes 4 commits https://github.com/NativeScript/android/pull/2070/files
ff1f624 fix(worker): let a heap-limit terminate re-enter the inspector lock f… adrian-niculescu Oct 6, 2026 https://github.com/NativeScript/android/pull/2070/commits/ff1f6242c7f4a6359a29349ede6fd11ceb5411b9
d37bb13 Merge branch 'main' into fix/worker-console-log-inspector-lock edusperoni Nov 11, 2026 https://github.com/NativeScript/android/pull/2070/commits/d37bb13111126006712c5600f813509d7f6309de
b7cf740 docs(worker): say which threads take the worker inspector lock and wh… edusperoni Nov 11, 2026 https://github.com/NativeScript/android/pull/2070/commits/b7cf7408dc785cc8a193bdbe9a5a31abec4c00ed
e9c093b test(worker): a console call nested in argument formatting does not d… edusperoni Nov 11, 2026 https://github.com/NativeScript/android/pull/2070/commits/e9c093b545e4adc10efc96e19e110109a9362f7f
Clear filters https://github.com/NativeScript/android/pull/2070/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2070/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2070/files
mainpage.js https://github.com/NativeScript/android/pull/2070/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
testWorkerNestedConsole.js https://github.com/NativeScript/android/pull/2070/files#diff-b963d32aaff7f56df549924a5aef27c81f4ad23e2f9e71d2056136c3f50d222c
workerNestedConsoleWorker.js https://github.com/NativeScript/android/pull/2070/files#diff-1e76ff79171c3ef75884af20c624670251d62e281101e3ef570e90fc2908303d
JsV8InspectorClient.cpp https://github.com/NativeScript/android/pull/2070/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
WorkerInspectorClient.h https://github.com/NativeScript/android/pull/2070/files#diff-2c771616a3286c8b34cb5ad61f4df81eb7dbccd076a96ed637f32a892aa865bc
WorkerWrapper.cpp https://github.com/NativeScript/android/pull/2070/files#diff-1344a5b85b9f266cab5024f2d52426ba56e3832c074d2c139fb560bcaaabfdc7
WorkerWrapper.h https://github.com/NativeScript/android/pull/2070/files#diff-94a94304b1fb4dd29852688ec48aa5583d6b2d6017d149c731cf5f191bf08a2e
test-app/app/src/main/assets/app/mainpage.jshttps://github.com/NativeScript/android/pull/2070/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
View file https://github.com/adrian-niculescu/NativeScript-Android/blob/e9c093b545e4adc10efc96e19e110109a9362f7f/test-app/app/src/main/assets/app/mainpage.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2070/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2070/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
https://github.com/NativeScript/android/pull/2070/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
test-app/app/src/main/assets/app/tests/testWorkerNestedConsole.jshttps://github.com/NativeScript/android/pull/2070/files#diff-b963d32aaff7f56df549924a5aef27c81f4ad23e2f9e71d2056136c3f50d222c
View file https://github.com/adrian-niculescu/NativeScript-Android/blob/e9c093b545e4adc10efc96e19e110109a9362f7f/test-app/app/src/main/assets/app/tests/testWorkerNestedConsole.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2070/{{ revealButtonHref }}
coderabbitaihttps://github.com/apps/coderabbitai
Nov 11, 2026https://github.com/NativeScript/android/pull/2070/files#r4543722101
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/NativeScript/android/pull/2070/files
test-app/app/src/main/assets/app/tests/workerNestedConsoleWorker.jshttps://github.com/NativeScript/android/pull/2070/files#diff-1e76ff79171c3ef75884af20c624670251d62e281101e3ef570e90fc2908303d
View file https://github.com/adrian-niculescu/NativeScript-Android/blob/e9c093b545e4adc10efc96e19e110109a9362f7f/test-app/app/src/main/assets/app/tests/workerNestedConsoleWorker.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2070/{{ revealButtonHref }}
test-app/runtime/src/main/cpp/JsV8InspectorClient.cpphttps://github.com/NativeScript/android/pull/2070/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
View file https://github.com/adrian-niculescu/NativeScript-Android/blob/e9c093b545e4adc10efc96e19e110109a9362f7f/test-app/runtime/src/main/cpp/JsV8InspectorClient.cpp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2070/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2070/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
https://github.com/NativeScript/android/pull/2070/files#diff-7cc5549c646c336c9433ef2829baa891d29a8322a7043780b8bbcbdb402daacf
test-app/runtime/src/main/cpp/WorkerInspectorClient.hhttps://github.com/NativeScript/android/pull/2070/files#diff-2c771616a3286c8b34cb5ad61f4df81eb7dbccd076a96ed637f32a892aa865bc
View file https://github.com/adrian-niculescu/NativeScript-Android/blob/e9c093b545e4adc10efc96e19e110109a9362f7f/test-app/runtime/src/main/cpp/WorkerInspectorClient.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2070/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2070/files#diff-2c771616a3286c8b34cb5ad61f4df81eb7dbccd076a96ed637f32a892aa865bc
https://github.com/NativeScript/android/pull/2070/files#diff-2c771616a3286c8b34cb5ad61f4df81eb7dbccd076a96ed637f32a892aa865bc
test-app/runtime/src/main/cpp/WorkerWrapper.cpphttps://github.com/NativeScript/android/pull/2070/files#diff-1344a5b85b9f266cab5024f2d52426ba56e3832c074d2c139fb560bcaaabfdc7
View file https://github.com/adrian-niculescu/NativeScript-Android/blob/e9c093b545e4adc10efc96e19e110109a9362f7f/test-app/runtime/src/main/cpp/WorkerWrapper.cpp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2070/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2070/files#diff-1344a5b85b9f266cab5024f2d52426ba56e3832c074d2c139fb560bcaaabfdc7
https://github.com/NativeScript/android/pull/2070/files#diff-1344a5b85b9f266cab5024f2d52426ba56e3832c074d2c139fb560bcaaabfdc7
https://github.com/NativeScript/android/pull/2070/files#diff-1344a5b85b9f266cab5024f2d52426ba56e3832c074d2c139fb560bcaaabfdc7
https://github.com/NativeScript/android/pull/2070/files#diff-1344a5b85b9f266cab5024f2d52426ba56e3832c074d2c139fb560bcaaabfdc7
https://github.com/NativeScript/android/pull/2070/files#diff-1344a5b85b9f266cab5024f2d52426ba56e3832c074d2c139fb560bcaaabfdc7
https://github.com/NativeScript/android/pull/2070/files#diff-1344a5b85b9f266cab5024f2d52426ba56e3832c074d2c139fb560bcaaabfdc7
test-app/runtime/src/main/cpp/WorkerWrapper.hhttps://github.com/NativeScript/android/pull/2070/files#diff-94a94304b1fb4dd29852688ec48aa5583d6b2d6017d149c731cf5f191bf08a2e
View file https://github.com/adrian-niculescu/NativeScript-Android/blob/e9c093b545e4adc10efc96e19e110109a9362f7f/test-app/runtime/src/main/cpp/WorkerWrapper.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2070/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2070/files#diff-94a94304b1fb4dd29852688ec48aa5583d6b2d6017d149c731cf5f191bf08a2e
https://github.com/NativeScript/android/pull/2070/files#diff-94a94304b1fb4dd29852688ec48aa5583d6b2d6017d149c731cf5f191bf08a2e
https://github.com/NativeScript/android/pull/2070/files#diff-94a94304b1fb4dd29852688ec48aa5583d6b2d6017d149c731cf5f191bf08a2e
https://github.com/NativeScript/android/pull/2070/files#diff-94a94304b1fb4dd29852688ec48aa5583d6b2d6017d149c731cf5f191bf08a2e
Please reload this pagehttps://github.com/NativeScript/android/pull/2070/files
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.