libjsi.so links folly and double-conversion statically, so Fantom's tester holds two copies of each (ASan: odr-violation)
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- cmake, cpp, react-native
- 領域
- build-system
研究方向
Start in ReactCommon/jsi/CMakeLists.txt, where jsi is built shared and linked against static folly_runtime and double-conversion; compare that with how private/react-native-fantom/tester/third-party/folly/CMakeLists.txt links its own copies. Reproduce with the provided reproduce.sh asan-jsi-duplicates-folly or the listed gradle/yarn commands, then decide whether the tester should link a static jsi or avoid duplicate static dependencies. Done means the ASan build runs View-itest.js without the odr-violation while preserving the tester's intended sanitizer coverage.
由索引模型根據 Issue 內容生成。
描述
Description
ReactCommon/jsi/CMakeLists.txt builds jsi as a shared library and links folly_runtime into it, and with folly double-conversion, both static. Fantom's tester links folly_runtime and double-conversion statically itself, and libjsi.so beside them, so its process holds two copies of each, their globals included.
Built under AddressSanitizer, with Hermes left uninstrumented, the tester stops before its first test on an odr-violation for double-conversion's PowersOfTenCache::kDecimalExponentDistance, defined once in fantom_tester and once in libjsi.so. With jsi built static in the tester there is one copy, and the tester runs its tests under AddressSanitizer.
Steps to reproduce
git clone https://github.com/YevheniiKotyrlo/react-native-fantom-reproducer && cd react-native-fantom-reproducer./fantom/reproduce.sh asan-jsi-duplicates-folly(needs Docker). It clonesreact/react-nativeatmain, addsfolly/memory/SanitizeLeak.cppto the tester's folly (#59668), builds Hermes without the sanitizer, then the tester under AddressSanitizer, and runspackages/react-native/Libraries/Components/View/__tests__/View-itest.js.
The same on a checkout of main, with folly/memory/SanitizeLeak.cpp added to folly_runtime_SRC in private/react-native-fantom/tester/third-party/folly/CMakeLists.txt:
./gradlew :private:react-native-fantom:prepareHermesDependencies
export CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
export CXXFLAGS="-fsanitize=address -fno-omit-frame-pointer -Wno-error=deprecated-literal-operator"
export LDFLAGS="-fuse-ld=lld -fsanitize=address"
yarn workspace @react-native/fantom build
yarn fantom packages/react-native/Libraries/Components/View/__tests__/View-itest.js
Hermes is built first so the sanitizer flags reach only the tester; with Hermes instrumented too, the first report is #59669 instead.
Expected: one copy of folly_runtime and double-conversion in the tester's process, so View-itest.js runs its tests under AddressSanitizer, as it does with jsi built static in the tester.
Seen: the tester stops before its first test on an AddressSanitizer odr-violation for double_conversion::PowersOfTenCache::kDecimalExponentDistance, defined in both fantom_tester and libjsi.so (the log under Stacktrace or Logs).
React Native Version
0.88.0 (reproduced on main at 54905a2)
Affected Platforms
Build - Linux
Output of npx @react-native-community/cli info
System:
OS: Linux 6.18 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (24) x64 AMD Ryzen 9 9950X3D 16-Core Processor
Memory: 116.43 GB / 125.63 GB
Shell:
version: 5.1.16
path: /bin/bash
Binaries:
Node:
version: 22.14.0
path: /usr/local/bin/node
Yarn:
version: 1.22.22
path: /usr/local/bin/yarn
npm:
version: 10.9.2
path: /usr/local/bin/npm
Watchman: Not Found
SDKs:
Android SDK:
API Levels:
- "37"
Build Tools:
- 37.0.0
Android NDK: 28.2.13676358
IDEs:
Android Studio: Not Found
Languages:
Java:
version: 17.0.20.1
path: /usr/bin/javac
Ruby:
version: 3.0.2
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react: Not Found
react-native: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
==8078==ERROR: AddressSanitizer: odr-violation (0x59f24c526260):
[1] size=4 'double_conversion::PowersOfTenCache::kDecimalExponentDistance' /react-native/packages/react-native/ReactAndroid/build/third-party-ndk/double-conversion/double-conversion/cached-powers.h:40 in /react-native/private/react-native-fantom/build/tester/fantom_tester
[2] size=4 'double_conversion::PowersOfTenCache::kDecimalExponentDistance' /react-native/packages/react-native/ReactAndroid/build/third-party-ndk/double-conversion/double-conversion/cached-powers.h:40 in /react-native/private/react-native-fantom/build/tester/ReactCommon/jsi/libjsi.so
These globals were registered at these points:
[1]:
#0 0x59f24c93e489 in __asan_register_globals /home/runner/work/llvm-project/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:431:3
#1 0x59f24c93f5b9 in __asan_register_elf_globals /home/runner/work/llvm-project/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:414:3
#2 0x73f2a0b5deba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29eba) (BuildId: 6a6cb5a80fd5e5bb5bf3aeaa111add98e88843a5)
[2]:
#0 0x59f24c93e489 in __asan_register_globals /home/runner/work/llvm-project/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:431:3
#1 0x59f24c93f5b9 in __asan_register_elf_globals /home/runner/work/llvm-project/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:414:3
#2 0x73f2a1b2a47d (/lib64/ld-linux-x86-64.so.2+0x647d) (BuildId: e6d3f5d4f2a24a5464ab59ae321b9474d70410f8)
==8078==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'double_conversion::PowersOfTenCache::kDecimalExponentDistance' at /react-native/packages/react-native/ReactAndroid/build/third-party-ndk/double-conversion/double-conversion/cached-powers.h:40 in /react-native/private/react-native-fantom/build/tester/fantom_tester
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/react-native-fantom-reproducer
Screenshots and Videos
No response
- 主要語言
- C++
- 星號
- 127k
- 分支
- 25.4k
- 平均合併
- 2 天 9 小時
- 30 天內合併 PR
- 91
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
react/react-native 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
react/react-native#59722 ·
維護者通常 2 天內回覆
-
Android: new WebSocket() crashes the app for a URL that OkHttp or java.net.URI rejects可能已有人在做 @sorinc03 今天認領。 未關閉🌐Networking Needs: Author Feedback Needs: Repro Platform: Android
難度 2/5 1-3 小時 新手友好度 72/100
react/react-native#59704 · 1 則留言 ·
維護者通常 2 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
react/react-native#59694 ·
維護者通常 2 天內回覆
-
Android autolinking keeps a stale autolinking.json when only bun.lock changes, since bun.lock isn't in the default lockFiles可能已有人在做 @lazerg 於 2 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 85/100
react/react-native#59693 ·
維護者通常 2 天內回覆
-
Image.resolveAssetSource's TypeScript declaration drops the null it returns for an unknown asset可能已有人在做 @Hassan1305 於 2 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
react/react-native#59648 · 1 則留言 ·
維護者通常 2 天內回覆
查看 react/react-native 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 66/100
FujiNetWIFI/fujinet-firmware#2261 ·
維護者通常 1 天內回覆
-
bug difficulty: easy good first issue help wanted
難度 2/5 1-3 小時 新手友好度 78/100
nagisa-kamishiro/rosehip#73 ·
維護者通常 1 天內回覆
-
mode_has_nan gives MSVC warning C4702 (unreachable code)可能已有人在做 @ibmibmibm 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 62/100
pocoproject/poco#5626 ·
維護者通常 2 天內回覆