René's URL Explorer Experiment


Title: fix: proxy generation races and naming bugs by edusperoni · Pull Request #2117 · NativeScript/android · GitHub

Open Graph Title: fix: proxy generation races and naming bugs by edusperoni · Pull Request #2117 · NativeScript/android

X Title: fix: proxy generation races and naming bugs by edusperoni · Pull Request #2117 · NativeScript/android

Description: Description Fixes the items of #2019 that #2116 does not cover: two races in runtime class generation that any app using workers can hit, and five smaller defects on the same path. Races Shared scratch state in the runtime class generator. Dump kept its method-descriptor buffer and the interface list of an interface implementation in static fields. Every runtime (main and each worker) has its own generator, so two threads generating at once interleaved on them and could write wrong descriptors or the wrong interface into a class, with no error. Both are now per call. A new JVM test generates 13 classes on 8 threads and compares the bytes with sequential output. On the unfixed code it failed in two of two runs: once by hanging, once with a NullPointerException inside the dex writer. After the fix it passes in about a second, 15 of 15 runs. A new spec has three workers and the main runtime generate six classes each at the same moment, then calls every overridden method from Java. ConcurrentModificationException while looking up a class. ClassStorageServiceImpl.retrieveClass iterated the class-loader set without its lock while another runtime could add a loader. The set is now copy-on-write, so iteration works on a snapshot and no lock is held across loadClass. A new unit test threw ConcurrentModificationException before the fix. Smaller defects Jar path. replace(".dex", ".jar") rewrote every occurrence in the path, not the suffix. The path starts with the app's data directory, so an application id with a segment starting with dex (for example com.example.dexter) sent every jar to a directory that does not exist. Failed class lookups were cached as null. After one failed lookup, a class that appeared later (generated or injected) was returned as a new JNI global reference that was never stored or freed, leaking one global reference per lookup. A miss is no longer cached. Prefix check. ClassResolver tested com.tns.gen and DexFactory tested com.tns.gen.; both now use one constant. A name such as com.tns.generated.Foo is looked up as a named class first and then generated as one, which is what DexFactory already did with it. com.tns.tests. exclusion removed. It has been unreachable since the prefix became com.tns.gen in 2015, so this changes no behaviour. Dotted extend() names are validated. Base.extend("a.b.C", ...) and @JavaProxy("a.b.C") skipped validation entirely. A name with an empty part, or with a character a dex class name cannot contain, now throws a JS error that names it. A part that is legal in dex but not a Java identifier (leading digit, -) still works and logs a warning, because the static binding generator can never compile such a class. / is still accepted as a separator, as ClassResolver already reads it as .. The name-validation specs, disabled since the suite started running the static binding generator, are back, with call sites the generator does not parse. Not included The truncated-jar and single-read items and Interface.extend on a nested interface: fixed in #2116. Two runtimes resolving the same unnamed class at once (an interface's shared class, or one call site in code both run) still both generate it and write the same dex and jar. #2116 makes those writes atomic. Only the main runtime injects into the app class loader, and the process-wide class cache keeps whichever class was published first, so what remains is duplicated work. A named proxy colliding with a derived anonymous name still fails with a bare ClassNotFoundException; that path belongs to the explicit-name handling #2116 changes. Verification Full suite on an API 33 arm64 phone: 1611 specs, 0 failures (1600 on main plus 11 new). :runtime:testDebugUnitTest: 32 tests, 0 failures. A trial merge with #2116's branch has no conflicts; the two can merge in either order. Only API 33 was tested locally. Related Pull Requests Addresses the remaining items of #2019. Together with #2116 this covers the whole issue, so it can be closed when both are merged. #2116 Does your pull request have unit tests? Yes: DumpConcurrencyTest and a concurrency case in ClassLoadersCollectionImplTest (JVM), plus test-app specs for dotted extend names and for concurrent generation across the main runtime and workers. Summary by CodeRabbit Bug Fixes Improved reliability when Java proxies are generated concurrently. Class-loading and proxy generation now handle missing classes and class names more consistently. Dotted class names with invalid characters or empty parts are rejected; some names unsupported by static generation remain available at runtime. Tests Added coverage for concurrent proxy generation, class loading, and stable proxy output.

Open Graph Description: Description Fixes the items of #2019 that #2116 does not cover: two races in runtime class generation that any app using workers can hit, and five smaller defects on the same path. Races Shared sc...

X Description: Description Fixes the items of #2019 that #2116 does not cover: two races in runtime class generation that any app using workers can hit, and five smaller defects on the same path. Races Shared sc...

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

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:9faa5cc5-db23-f686-e77c-604cdac1567b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8762:311640:1624CF0:1C2A5CA:6B0135A2
html-safe-nonce6a709e1b59437d056098ef6a92d7c8130c3c1ac6ce22cf94397ce48c82f22610
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzYyOjMxMTY0MDoxNjI0Q0YwOjFDMkE1Q0E6NkIwMTM1QTIiLCJ2aXNpdG9yX2lkIjoiMzYzMDkyNjE0OTM3MjE2MzQ5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0f421de79d285398bb329c28c23b50e4bcaed459144982eab73c40c8647fa291
hovercard-subject-tagpull_request:5350704091
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/2117/files
twitter:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
og:image:altDescription Fixes the items of #2019 that #2116 does not cover: two races in runtime class generation that any app using workers can hit, and five smaller defects on the same path. Races Shared sc...
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/2117/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fpull%2F2117%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%2F2117%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/2117/files
Reloadhttps://github.com/NativeScript/android/pull/2117/files
Reloadhttps://github.com/NativeScript/android/pull/2117/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
mainhttps://github.com/NativeScript/android/tree/main
fix/proxy-dex-generation-followupshttps://github.com/NativeScript/android/tree/fix/proxy-dex-generation-followups
Conversation 1 https://github.com/NativeScript/android/pull/2117
Commits 7 https://github.com/NativeScript/android/pull/2117/commits
Checks 8 https://github.com/NativeScript/android/pull/2117/checks
Files changed https://github.com/NativeScript/android/pull/2117/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2117/files
fix: proxy generation races and naming bugs https://github.com/NativeScript/android/pull/2117/files#top
Show all changes 7 commits https://github.com/NativeScript/android/pull/2117/files
3b1f8c8 fix(DexFactory): derive the jar path by replacing only the .dex suffix edusperoni Nov 17, 2026 https://github.com/NativeScript/android/pull/2117/commits/3b1f8c808344c172ea0119f1ae21d6d65d7c829f
d49d86b fix(JEnv): do not cache a class that failed to resolve edusperoni Nov 17, 2026 https://github.com/NativeScript/android/pull/2117/commits/d49d86bc460a955089ec9f8d5059bbe5033cf8e3
24fad74 fix(bindings): keep proxy generator scratch state per call edusperoni Nov 17, 2026 https://github.com/NativeScript/android/pull/2117/commits/24fad7492b41934cd72840257a9bd159302b4f75
7b7e1ae fix(classloading): iterate class loaders without racing their registr… edusperoni Nov 17, 2026 https://github.com/NativeScript/android/pull/2117/commits/7b7e1aede9a319d237dc61de709c9fba1a9eeb86
1149832 fix(ClassResolver): test binding class names with DexFactory's prefix edusperoni Nov 17, 2026 https://github.com/NativeScript/android/pull/2117/commits/1149832811fc6c3c88cd34a33d1b6c434e38a7a3
e939ce1 fix(MetadataNode): validate dotted extend() names edusperoni Nov 17, 2026 https://github.com/NativeScript/android/pull/2117/commits/e939ce1b25cd8f7b591ba8367dc4e187dfac9903
95dc967 test: generate proxies in several runtimes at once edusperoni Nov 17, 2026 https://github.com/NativeScript/android/pull/2117/commits/95dc96711227b5809788ef0801bc6a054efaccaf
Clear filters https://github.com/NativeScript/android/pull/2117/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2117/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2117/files
mainpage.js https://github.com/NativeScript/android/pull/2117/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
extendClassNameTests.js https://github.com/NativeScript/android/pull/2117/files#diff-25d41262aae4e968511bb407b7a362ecfc8dc5145ab798d6e79a6b32a01ee3a0
proxyGenerationJob.js https://github.com/NativeScript/android/pull/2117/files#diff-960374f5346cefbe14f9531eefbcd11765aa4368b326c5d92e31f7165e6d9558
proxyGenerationWorker.js https://github.com/NativeScript/android/pull/2117/files#diff-41539b467d46bd079c15dcb653d23dcea0b2f42e37d37932613c93c81deca835
testConcurrentProxyGeneration.js https://github.com/NativeScript/android/pull/2117/files#diff-a8731d597c079f36b82649c4815c19827b35871e465490d05fe706d2a9918c55
Dump.java https://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
JEnv.cpp https://github.com/NativeScript/android/pull/2117/files#diff-73f675d8548b1b431bfd52b52b051f173bdf8408f03caf73f00891debdb15641
MetadataNode.cpp https://github.com/NativeScript/android/pull/2117/files#diff-6f6c5b64f60875e24b75b8a21b3164f114822aa7e5add5755f072f36403f7f8b
ClassResolver.java https://github.com/NativeScript/android/pull/2117/files#diff-a03c6b27202904e7ea193baccbb06cac1dda824f8ccc45f501eb7289817f3299
DexFactory.java https://github.com/NativeScript/android/pull/2117/files#diff-7f8ef213b415ed89638d410cdc1813a95a7aafb2b6ae962e4862099ae1a8f95d
ClassLoadersCollectionImpl.java https://github.com/NativeScript/android/pull/2117/files#diff-b29a6b7cb4da16954faf51a7f33fc0541f668875092a0a2daa589171745a08f8
DumpConcurrencyTest.java https://github.com/NativeScript/android/pull/2117/files#diff-823e3688e804268bcdabf7067bbf4ff4125fc11a49ee9b3214acb9a272fb068e
ClassLoadersCollectionImplTest.java https://github.com/NativeScript/android/pull/2117/files#diff-7f3e9dbfc144c59bd9254434b6833b9941ddf1dc63b3c6c8ac283d97433d132b
test-app/app/src/main/assets/app/mainpage.jshttps://github.com/NativeScript/android/pull/2117/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
View file https://github.com/NativeScript/android/blob/95dc96711227b5809788ef0801bc6a054efaccaf/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/2117/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2117/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
https://github.com/NativeScript/android/pull/2117/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
https://github.com/NativeScript/android/pull/2117/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
https://github.com/NativeScript/android/pull/2117/files#diff-b7fd6c22bfc29391e9e3ed935d6c6194b1ad595c7592690229952b5ddb99c0d5
test-app/app/src/main/assets/app/tests/extendClassNameTests.jshttps://github.com/NativeScript/android/pull/2117/files#diff-25d41262aae4e968511bb407b7a362ecfc8dc5145ab798d6e79a6b32a01ee3a0
View file https://github.com/NativeScript/android/blob/95dc96711227b5809788ef0801bc6a054efaccaf/test-app/app/src/main/assets/app/tests/extendClassNameTests.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2117/{{ revealButtonHref }}
test-app/app/src/main/assets/app/tests/proxyGenerationJob.jshttps://github.com/NativeScript/android/pull/2117/files#diff-960374f5346cefbe14f9531eefbcd11765aa4368b326c5d92e31f7165e6d9558
View file https://github.com/NativeScript/android/blob/95dc96711227b5809788ef0801bc6a054efaccaf/test-app/app/src/main/assets/app/tests/proxyGenerationJob.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2117/{{ revealButtonHref }}
test-app/app/src/main/assets/app/tests/proxyGenerationWorker.jshttps://github.com/NativeScript/android/pull/2117/files#diff-41539b467d46bd079c15dcb653d23dcea0b2f42e37d37932613c93c81deca835
View file https://github.com/NativeScript/android/blob/95dc96711227b5809788ef0801bc6a054efaccaf/test-app/app/src/main/assets/app/tests/proxyGenerationWorker.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2117/{{ revealButtonHref }}
test-app/app/src/main/assets/app/tests/testConcurrentProxyGeneration.jshttps://github.com/NativeScript/android/pull/2117/files#diff-a8731d597c079f36b82649c4815c19827b35871e465490d05fe706d2a9918c55
View file https://github.com/NativeScript/android/blob/95dc96711227b5809788ef0801bc6a054efaccaf/test-app/app/src/main/assets/app/tests/testConcurrentProxyGeneration.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2117/{{ revealButtonHref }}
test-app/runtime-binding-generator/src/main/java/com/tns/bindings/Dump.javahttps://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
View file https://github.com/NativeScript/android/blob/95dc96711227b5809788ef0801bc6a054efaccaf/test-app/runtime-binding-generator/src/main/java/com/tns/bindings/Dump.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/android/pull/2117/{{ revealButtonHref }}
https://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
https://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
https://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
https://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
https://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
https://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
https://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
https://github.com/NativeScript/android/pull/2117/files#diff-aac54fe1bd2d0c924d4676ef5fc0dcc1f3c5d1e212a4b6c160ceb0c9c88b83e5
Please reload this pagehttps://github.com/NativeScript/android/pull/2117/files
Please reload this pagehttps://github.com/NativeScript/android/pull/2117/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.