Skip to content

Compile folly's SanitizeLeak.cpp in Fantom's tester - #59674

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
lazerg:fix/issue-59668-folly-sanitize-leak
Oct 30, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
lazerg:fix/issue-59668-folly-sanitize-leak

Conversation

@lazerg

@lazerg lazerg commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Summary:

Fantom's tester doesn't link when it's built with AddressSanitizer. Under -fsanitize=address, folly headers like small_vector.h and Singleton.h call folly::detail::annotate_object_leaked_impl and annotate_object_collected_impl, and only folly/memory/SanitizeLeak.cpp defines them. Fantom's folly build compiles SanitizeAddress.cpp and SanitizeThread.cpp but not that file, so the link fails on both symbols.

This adds folly/memory/SanitizeLeak.cpp to folly_runtime_SRC, which the RCT-Folly podspec already compiles. Without ASan the file only defines those functions, nothing calls them.

Fixes #59668

Changelog:

[INTERNAL] [FIXED] - Fix Fantom tester link under AddressSanitizer by compiling folly's SanitizeLeak.cpp

Test Plan:

I couldn't run the full Fantom build here, so I checked the link against folly v2024.11.18.00 (the version Fantom pins) with clang and -fsanitize=address. A small program using folly::small_vector, linked with the folly_runtime sources it needs, fails with undefined annotate_object_leaked_impl / annotate_object_collected_impl. Adding SanitizeLeak.cpp makes it link and run.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 30, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 30, 2026
@meta-codesync

meta-codesync Bot commented Oct 30, 2026

Copy link
Copy Markdown

@javache has imported this pull request. If you are a Meta employee, you can view this in D128600166.

@meta-codesync
meta-codesync Bot merged commit a5e2042 into react:main Oct 30, 2026
102 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @lazerg in a5e2042

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fantom's tester does not link under AddressSanitizer: its folly build omits SanitizeLeak.cpp

3 participants