OP-Engineering/op-sqlite

Metro reload crashes - segfault

Closed this issue · 4 comments

Describe the bug
When a db connection has a updateHook(), and you reload in metro the whole app crashes from a segfault.

Versions:

  • OS and version: android 14
  • op-sqlite version: latest 2.0.9
  • RN version: 0.73.1 and 0.72.6

Reproducible example
https://github.com/Zoxive/op-sqlite/tree/UpdateHookCrashes

(Idk why cpp/sqlite3.h shows up in the diff, i tried creating the branch 2 times.. did it both times)

Basically just need a updateHook registered, and in metro if you press "R" to cause a reload it crashes.

Tested it on device, and in android simulator.

I get a very rough stacktrace in sentry:

Screenshot 2024-01-01 at 4 30 59 PM

libop-sqlite +0x06d44c <unknown> libop-sqlite +0x05d110 opsqlite::registerUpdateHook libop-sqlite +0x06d0ac <unknown> libhermes_executor +0x3e269c <unknown> libhermes_executor +0x3e25c4 std::__ndk1::function<T>::operator() libhermes_executor +0x3e2530 facebook::jsi::DecoratedHostFunction::operator() libhermes_executor +0x3e24b8 <unknown> libhermes_executor +0x3e2404 std::__ndk1::__invoke_void_return_wrapper<T>::__call<T> libhermes_executor +0x3e2340 <unknown> libhermes_executor +0x3e10d0 std::__ndk1::__function::__func<T>::operator()

Thanks for creating the reproduction, super helpful. It's fixed on 2.0.10

same on 3.0.4

@talaikis can you create a reproduction so I can take a look? In the sample app everything is working

@talaikis can you create a reproduction so I can take a look? In the sample app everything is working

Seems solved after deleted gradle cache.