-
Type: Task
-
Resolution: Gone away
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
?
-
7417
-
Not Needed
SDK and version
SDK : CPP
Version: realm-core-13.26.0
Observations
- How frequent do the crash occur? Every time
- Does it happen in production or during dev/test? dev/test
- Can the crash be reproduced by you? yes
- Can you provide instructions for how we can reproduce it? yes
Crash log / stacktrace
build.debug/_deps/cpprealm-src/realm-core/src/realm/util/functional.hpp:93: [realm-core-13.26.0] Assertion failed: static_cast<bool>(*this)
./realm_rs(+0x8aa868) [0x596d2192b868]
./realm_rs(+0x8aaafb) [0x596d2192bafb]
./realm_rs(+0x8aa9a3) [0x596d2192b9a3]
./realm_rs(+0x23e2c4) [0x596d212bf2c4]
./realm_rs(+0x23c2d9) [0x596d212bd2d9]
./realm_rs(+0xbde06) [0x596d2113ee06]
./realm_rs(+0xbde9d) [0x596d2113ee9d]
./realm_rs(+0xbdc1b) [0x596d2113ec1b]
./realm_rs(+0xbda2f) [0x596d2113ea2f]
./realm_rs(+0xbd98e) [0x596d2113e98e]
./realm_rs(+0xbd8ef) [0x596d2113e8ef]
./realm_rs(+0xbd7f7) [0x596d2113e7f7]
./realm_rs(+0xbd4e7) [0x596d2113e4e7]
./realm_rs(+0x890d0) [0x596d2110a0d0]
./realm_rs(+0x7cee7) [0x596d210fdee7]
./realm_rs(+0x7cf16) [0x596d210fdf16]
/usr/lib/libc.so.6(__libc_start_main+0xfe) [0x7137d6043dfe]
./realm_rs(+0x7c5d5) [0x596d210fd5d5]
!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose[1] 16903 IOT instruction (core dumped)
Steps & Code to Reproduce
<!-- What steps/operations resulted in the crash? Please show any relevant code or steps that WE can
<!-- use to reproduce it. Even better is a full sample project that can reproduce the crash. -->
<!-- Code and files can be shared privately at help@realm.io if needed. -->
I just created a simple exemple application using the getting started guide from realm cpp
CMakeFiles.txt:
cmake_minimum_required(VERSION 3.15) project(RealmRs) # Minimum C++ standard set(CMAKE_CXX_FLAGS "-fpermissive -Wchanges-meaning") set(CMAKE_CXX_STANDARD 17) set(REALM_CPP_NO_TESTS ON) # In a Windows install, set these compiler flags: if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:preprocessor /bigobj") endif() # Include the FetchContent module so you can download the C++ SDK Include(FetchContent) # Declare the version of the C++ SDK you want to download FetchContent_Declare( cpprealm GIT_REPOSITORY https://github.com/danielmbomfim/realm-cpp.git GIT_TAG "origin/main" ) # The MakeAvailable command ensures the named dependencies have been populated FetchContent_MakeAvailable(cpprealm) # Create an executable target called myApp with the source file main.cpp add_executable(realm_rs main.cpp) target_link_libraries(realm_rs PRIVATE cpprealm)
My cpp code
#include <vector> #include <string> #include <cpprealm/sdk.hpp> using std::vector; using std::string; namespace realm { struct Note { primary_key<string> _id; string title; string content; }; REALM_SCHEMA(Note, _id, title, content) } using namespace realm; auto config = realm::db_config(); auto database = realm::db(std::move(config)); Note _create_note(string title, string content) { auto draft_note = Note { .title = title, .content = content }; auto note = database.write([&] { return database.add(std::move(draft_note)); }); return note.detach(); } int main() { Note note = _create_note("teste", "teste"); return 0; }
Even if a commit all the code except for the imports and the config instantiation the crash still occurs.