pmed / v8pp

Bind C++ functions and classes into V8 JavaScript engine
http://pmed.github.io/v8pp/
Other
886 stars 118 forks source link

Exception throw fails on macOS with cmake -DV8PP_HEADER_ONLY=0 -DBUILD_SHARED_LIBS=1 #176

Closed pmed closed 1 year ago

pmed commented 2 years ago

Causes terminate after __cxxabiv1::failed_throw(). See frame 7 in stack trace:

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff2034e92e libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff2037d5bd libsystem_pthread.dylib`pthread_kill + 263
    frame #2: 0x00007fff202d2406 libsystem_c.dylib`abort + 125
    frame #3: 0x00007fff20340ef2 libc++abi.dylib`abort_message + 241
    frame #4: 0x00007fff203325fd libc++abi.dylib`demangling_terminate_handler() + 266
    frame #5: 0x00007fff2022b595 libobjc.A.dylib`_objc_terminate() + 104
    frame #6: 0x00007fff20340307 libc++abi.dylib`std::__terminate(void (*)()) + 8
    frame #7: 0x00007fff20342beb libc++abi.dylib`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 27
    frame #8: 0x00007fff20342bb2 libc++abi.dylib`__cxa_throw + 116
    frame #9: 0x00000001007eaf32 libv8pp.dylib`v8pp::detail::object_registry<v8pp::raw_ptr_traits>& v8pp::detail::classes::add<v8pp::raw_ptr_traits>(isolate=0x0000000102c25000, type=0x00007ffeefbfe310, dtor=0x00007ffeefbfe360) at class.ipp:284:3
    frame #10: 0x0000000100022942 v8pp_test`v8pp::class_<X, v8pp::raw_ptr_traits>::class_(this=0x00007ffeefbfe3f0, isolate=0x0000000102c25000, destroy= Function = v8pp::factory<X, v8pp::raw_ptr_traits>::destroy(v8::Isolate*, X* const&) )>) at class.hpp:183:17
    frame #11: 0x000000010001ab2d v8pp_test`v8pp::class_<X, v8pp::raw_ptr_traits>::class_(this=0x00007ffeefbfe3f0, isolate=0x0000000102c25000, destroy=<unavailable>)>) at class.hpp:188:2
    frame #12: 0x00000001000444ba v8pp_test`void test_class_<v8pp::raw_ptr_traits>(this=0x00007ffeefbfef00)::'lambda'()::operator()() const at test_class.cpp:184:27
    frame #13: 0x000000010001e783 v8pp_test`void check_ex<std::runtime_error, void test_class_<v8pp::raw_ptr_traits>()::'lambda'()>(msg=(data_ = "already wrapped class X", size_ = 23), f=0x00007ffeefbfef00)::'lambda'()&&) at test.hpp:193:3
    frame #14: 0x000000010001376a v8pp_test`void test_class_<v8pp::raw_ptr_traits>() at test_class.cpp:182:2
    frame #15: 0x0000000100012d39 v8pp_test`test_class() at test_class.cpp:445:2
    frame #16: 0x0000000100005b81 v8pp_test`run_tests() at main.cpp:54:4
    frame #17: 0x000000010000629a v8pp_test`main(argc=1, argv=0x00007ffeefbffa08) at main.cpp:119:3
    frame #18: 0x00007fff20398f3d libdyld.dylib`start + 1
    frame #19: 0x00007fff20398f3d libdyld.dylib`start + 1
pmed commented 2 years ago

Fixed in 6611145