René's URL Explorer Experiment


Title: ArgConverter::SetValue: invalid pointer for a JS number or boolean in an object slot, and a leaked adapter for a plain object from an unowned method · Issue #572 · NativeScript/ios · GitHub

Open Graph Title: ArgConverter::SetValue: invalid pointer for a JS number or boolean in an object slot, and a leaked adapter for a plain object from an unowned method · Issue #572 · NativeScript/ios

X Title: ArgConverter::SetValue: invalid pointer for a JS number or boolean in an object slot, and a leaked adapter for a plain object from an unowned method · Issue #572 · NativeScript/ios

Description: Summary ArgConverter::SetValue writes the result of a JS-implemented method, getter or block into the native return slot. For some combinations of JS value and native return type it writes nothing, or writes something that is not a valid...

Open Graph Description: Summary ArgConverter::SetValue writes the result of a JS-implemented method, getter or block into the native return slot. For some combinations of JS value and native return type it writes nothing,...

X Description: Summary ArgConverter::SetValue writes the result of a JS-implemented method, getter or block into the native return slot. For some combinations of JS value and native return type it writes nothing,...

Opengraph URL: https://github.com/NativeScript/ios/issues/572

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ArgConverter::SetValue: invalid pointer for a JS number or boolean in an object slot, and a leaked adapter for a plain object from an unowned method","articleBody":"## Summary\n\n`ArgConverter::SetValue` writes the result of a JS-implemented method, getter or block into the native return slot. For some combinations of JS value and native return type it writes nothing, or writes something that is not a valid value of that type, and native code then reads it.\n\n| JS result | Native return type | What is written |\n|---|---|---|\n| number | object (`id`, a class, `instancetype`) | nothing: the slot keeps whatever it held |\n| `true` | object | the integer 1, which native code treats as an object pointer |\n| `false` | object | 0, which reads as nil |\n| string | `instancetype` | nothing |\n\nA string returned for an `id` or class-typed result is converted to an `NSString`, and `null`/`undefined` zero the slot; those are fine.\n\n```js\nconst X = NSObject.extend({\n  description() { return 42; },   // NSString* expected: the slot is not written\n});\n```\n\nThe caller then messages a garbage pointer, or `0x1`. This is a mistake in the JS implementation, but the runtime should fail predictably and not hand native code an arbitrary pointer.\n\n## A plain JS object from a method that doesn't own its return leaks its adapter\n\nA related gap in the same function. For a plain JS object (or an array, function or Date) returned where an object is expected, `SetValue` creates a `DictionaryAdapter` with `alloc`/`init` and writes it at +1. A `CFAutorelease(adapter)` next to it is commented out.\n\nThat +1 is right when the method owns its return (the `copy`, `mutableCopy` and `new` families, initializers), and since #569 those are balanced. For any other method the native caller doesn't own the result and never releases it, so the adapter is never freed and its `Persistent` keeps the JS object alive:\n\n```js\nconst X = NSObject.extend({ makeThing() { return {}; } }, {\n  exposedMethods: { makeThing: { returns: NSObject } },\n});\n// a native caller of -makeThing: the adapter and the object it wraps are never freed\n```\n\nSeen with a `WeakRef` on the returned object, which never clears after a native `performSelector:` call.\n\nThe fix is to hand the adapter over at +0 (autoreleased) when the method doesn't own its return. `SetValue` already reports whether it wrote an object the caller doesn't own; it would need to distinguish \"wrote a +1 object\" from \"wrote nothing\" so the caller can autorelease in the unowned case.\n\n## Suggested fix\n\nIn `ArgConverter::SetValue`, for object return types:\n\n- box a JS number or boolean as an `NSNumber`, as argument marshalling already does for a number passed to an object parameter (`Interop::SetFFIParams`), or write nil if boxing is not wanted there;\n- convert a string for `instancetype` as for `id`, or write nil;\n- in every other case that has no conversion, zero the slot.\n\nThe function has a `TODO` about reusing `Interop::SetFFIParams`; sharing that logic would fix all of these at once.\n\nWhatever is boxed is returned at +0, so it also has to go through the owned-result retain added in #569 (`ArgConverter::RetainOwnedResult`), which today only recognises wrapped objects and strings.\n\n## Tests to add\n\n- A JS method declared to return an object that returns a number, `true`, and `false`: a native caller gets an `NSNumber` (or nil), never an invalid pointer. Run under AddressSanitizer.\n- A JS initializer (`instancetype`) that returns a string: the native caller gets nil or an `NSString`, not an unwritten slot.\n- The same through an owned-return method (`copyWithZone:`), checking the count of the boxed result.\n- A JS method that doesn't own its return, returning a fresh plain object to a native caller: a `WeakRef` on the object clears once the caller's autorelease pool drains.\n\nFound while reviewing #569; not reproduced in a spec yet, because in Debug builds some of these paths assert first.\n\n","author":{"url":"https://github.com/edusperoni","@type":"Person","name":"edusperoni"},"datePublished":"2026-11-15T16:12:10Z","url":"https://github.com/NativeScript/ios/issues/572"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a692cf2c-bcbc-4214-ff6f-bcb792d51ee0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEC86:2454CC:160C473:1BFC089:6B01357D
html-safe-nonce938d73207189ebe8702d602953f3eaa5a95d6fff06691385f8cacd0157bdf7c0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzg2OjI0NTRDQzoxNjBDNDczOjFCRkMwODk6NkIwMTM1N0QiLCJ2aXNpdG9yX2lkIjoiNTk5MzI4OTUwNjU2NzA0MjQyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac61c85dd48a668142590516090cd1794327748e6904fc3b0292eb91eb305a67ed
hovercard-subject-tagissue:6406314860
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/NativeScript/ios/572/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0dc299817264a0daf99a6f8aa8e5316ddbf33aa56165910b9283869d6b0b8381/NativeScript/ios/issues/572
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0dc299817264a0daf99a6f8aa8e5316ddbf33aa56165910b9283869d6b0b8381/NativeScript/ios/issues/572
og:image:altSummary ArgConverter::SetValue writes the result of a JS-implemented method, getter or block into the native return slot. For some combinations of JS value and native return type it writes nothing,...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameedusperoni
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/ios git https://github.com/NativeScript/ios.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id172934359
octolytics-dimension-repository_nwoNativeScript/ios
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id172934359
octolytics-dimension-repository_network_root_nwoNativeScript/ios
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/NativeScript/ios/issues/572#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fios%2Fissues%2F572
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%2Fios%2Fissues%2F572
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=NativeScript%2Fios
Reloadhttps://github.com/NativeScript/ios/issues/572
Reloadhttps://github.com/NativeScript/ios/issues/572
Reloadhttps://github.com/NativeScript/ios/issues/572
NativeScripthttps://github.com/NativeScript
ioshttps://github.com/NativeScript/ios
Codehttps://github.com/NativeScript/ios
Issues56 (56)https://github.com/NativeScript/ios/issues
Pull requests42 (42)https://github.com/NativeScript/ios/pulls
Actionshttps://github.com/NativeScript/ios/actions
Projectshttps://github.com/NativeScript/ios/projects
Security and qualityhttps://github.com/NativeScript/ios/security
Insightshttps://github.com/NativeScript/ios/insights
https://github.com/NativeScript/ios
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/ios/issues/572
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/ios/issues/572
ArgConverter::SetValue: invalid pointer for a JS number or boolean in an object slot, and a leaked adapter for a plain object from an unowned methodhttps://github.com/NativeScript/ios/issues/572#top
https://github.com/edusperoni
edusperonihttps://github.com/edusperoni
on Nov 15, 2026https://github.com/NativeScript/ios/issues/572#issue-6406314860
#569https://github.com/NativeScript/ios/pull/569
#569https://github.com/NativeScript/ios/pull/569
#569https://github.com/NativeScript/ios/pull/569
edusperonihttps://github.com/edusperoni
on Nov 15, 2026https://github.com/NativeScript/ios/issues/572#event-36205469483
Sign up for freehttps://github.com/signup?return_to=https://github.com/NativeScript/ios/issues/572
Sign in to commenthttps://github.com/login?return_to=https://github.com/NativeScript/ios/issues/572
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.