Fantom's tester holds two copies of jsi, libjsi.so and the one Hermes's host build compiles into libhermesvm.so (ASan: odr-violation)
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- cmake, cpp, docker, react-native
- Área
- build-system
Línea de trabajo
Start from hermes-engine/build.gradle.kts and configureBuildForHermesCommandLineArgs, which should pass -DHERMES_BUILD_SHARED_JSI=True for host build like Android. Reproduce via ./fantom/reproduce.sh asan-jsi-twice in the Docker reproducer. Done means the tester runs under ASan without the odr-violation on jsi globals.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Fantom's tester links React Native's jsi target (ReactCommon/jsi, a shared library) and libhermesvm.so. Hermes's host build, configureBuildForHermesCommandLineArgs in hermes-engine/build.gradle.kts, passes no HERMES_BUILD_SHARED_JSI, so Hermes compiles jsi.cpp from the same JSI_DIR into libhermesvm.so and exports it, and the tester's process holds two copies of jsi's code and globals. The Android build passes -DHERMES_BUILD_SHARED_JSI=True and links one shared jsi.
Built with Hermes and the tester under AddressSanitizer, the tester stops before its first test on an odr-violation for jsi's globals, defined once in libhermesvm.so and once in the tester's libjsi.so.
Steps to reproduce
git clone https://github.com/YevheniiKotyrlo/react-native-fantom-reproducer && cd react-native-fantom-reproducer./fantom/reproduce.sh asan-jsi-twice(needs Docker). It clonesreact/react-nativeatmain, addsfolly/memory/SanitizeLeak.cppto the tester's folly (#59668), builds Hermes and 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:
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
The flags reach Hermes's CMake as well as the tester's, so both are instrumented.
Expected: one copy of jsi in the tester's process, so View-itest.js runs its tests under AddressSanitizer.
Seen: the tester stops before its first test on an AddressSanitizer odr-violation for typeinfo name for facebook::jsi::JSError, defined in both libhermesvm.so and the tester's 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
==7959==ERROR: AddressSanitizer: odr-violation (0x75bdfd4d9a40):
[1] size=24 'typeinfo name for facebook::jsi::JSError' /react-native/packages/react-native/ReactCommon/jsi/jsi/jsi.cpp in /react-native/packages/react-native/ReactAndroid/hermes-engine/build/hermes/lib/libhermesvm.so
[2] size=24 'typeinfo name for facebook::jsi::JSError' /react-native/packages/react-native/ReactCommon/jsi/jsi/jsi.cpp in /react-native/private/react-native-fantom/build/tester/ReactCommon/jsi/libjsi.so
These globals were registered at these points:
[1]:
#0 0x5784ae158509 in __asan_register_globals /home/runner/work/llvm-project/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:431:3
#1 0x5784ae159639 in __asan_register_elf_globals /home/runner/work/llvm-project/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:414:3
#2 0x75bdfdefe47d (/lib64/ld-linux-x86-64.so.2+0x647d) (BuildId: e6d3f5d4f2a24a5464ab59ae321b9474d70410f8)
[2]:
#0 0x5784ae158509 in __asan_register_globals /home/runner/work/llvm-project/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:431:3
#1 0x5784ae159639 in __asan_register_elf_globals /home/runner/work/llvm-project/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:414:3
#2 0x75bdfdefe47d (/lib64/ld-linux-x86-64.so.2+0x647d) (BuildId: e6d3f5d4f2a24a5464ab59ae321b9474d70410f8)
==7959==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'typeinfo name for facebook::jsi::JSError' at /react-native/packages/react-native/ReactCommon/jsi/jsi/jsi.cpp in /react-native/packages/react-native/ReactAndroid/hermes-engine/build/hermes/lib/libhermesvm.so
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/react-native-fantom-reproducer
Screenshots and Videos
No response
- Lenguaje dominante
- C++
- Estrellas
- 127k
- Forks
- 25.5k
- Merge medio
- 3 d 18 h
- PR fusionados (30 d)
- 188
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react/react-native
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
react/react-native#59945 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
react/react-native#59944 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
react/react-native#59942 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
react/react-native#59939 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
react/react-native#59929 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de react/react-native
Issues similares
-
test(tools): two testkit cache tests fail unless GOCACHE and GOMODCACHE are in the environmentAbiertobacklog
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
EchoTools/nevr-runtime#2385 ·
Los mantenedores suelen responder en 1 día
-
type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
tensorflow/tflite-micro#3995 ·
Los mantenedores suelen responder en 1 día
-
CPU update 1.31xAbiertospeed-report
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
mw00/project-maya#961 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
not for AI lovers
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
OSGeo/gdal#15515 · 1 comentario ·
Los mantenedores suelen responder en 1 día