Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault during garbage collection after process.exit #165

Closed
JCMais opened this issue Apr 3, 2019 · 0 comments
Closed

Segmentation fault during garbage collection after process.exit #165

JCMais opened this issue Apr 3, 2019 · 0 comments
Assignees
Labels

Comments

@JCMais
Copy link
Owner

JCMais commented Apr 3, 2019

* thread #1: tid = 48586, 0x0000000000a7c690 node`v8::Context::GetIsolate(), name = 'node', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x0000000000a7c690 node`v8::Context::GetIsolate()
    frame #1: node_libcurl.node`NodeLibcurl::AdjustMemory(diff=-12) at Curl.cc:1114
    frame #2: node_libcurl.node`NodeLibcurl::FreeCallback(void*) at Curl.cc:1174
    frame #3: node_libcurl.node`NodeLibcurl::FreeCallback(p=0x00000000023fece8)
    frame #4: 0x00007ffff4558a59 node_libcurl.node`curl_formfree + 57
    frame #5: node_libcurl.node`NodeLibcurl::CurlHttpPost::Reset(this=0x00000000024172d0) at CurlHttpPost.cc:39
    frame #6: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() [inlined] std::default_delete<NodeLibcurl::CurlHttpPost>::operator(this=<unavailable>, __ptr=0x00000000024172d0)(NodeLibcurl::CurlHttpPost*) const at unique_ptr.h:78
    frame #7: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() at unique_ptr.h:268
    frame #8: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() [inlined] void std::_Destroy<std::unique_ptr<NodeLibcurl::CurlHttpPost, std::default_delete<NodeLibcurl::CurlHttpPost> > >(__pointer=<unavailable>) at stl_construct.h:98
    frame #9: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() [inlined] void std::_Destroy_aux<false>::__destroy<std::unique_ptr<NodeLibcurl::CurlHttpPost, std::default_delete<NodeLibcurl::CurlHttpPost> >*>(__last=<unavailable>, __first=0x00000000024177a0) at stl_construct.h:108
    frame #10: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() at stl_construct.h:137
    frame #11: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() [inlined] void std::_Destroy<std::unique_ptr<NodeLibcurl::CurlHttpPost, std::default_delete<NodeLibcurl::CurlHttpPost> >*, std::unique_ptr<NodeLibcurl::CurlHttpPost, std::default_delete<NodeLibcurl::CurlHttpPost> > >((null)=<unavailable>, __last=0x00000000024177a8, __first=<unavailable>) at stl_construct.h:206
    frame #12: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() [inlined] _ZNSt6vectorISt10unique_ptrIN11NodeLibcurl12CurlHttpPostESt14default_deleteIS2_EESaIS5_EED4Ev(this=0x00007fffdc001630) at stl_vector.h:434
    frame #13: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() [inlined] _ZN11NodeLibcurl4Easy6ToFreeD4Ev(this=0x00007fffdc001600) at Easy.cc:47
    frame #14: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() [inlined] void __gnu_cxx::new_allocator<NodeLibcurl::Easy::ToFree>::destroy<NodeLibcurl::Easy::ToFree>(this=<unavailable>, __p=0x00007fffdc001600) at new_allocator.h:140
    frame #15: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() [inlined] void std::allocator_traits<std::allocator<NodeLibcurl::Easy::ToFree> >::destroy<NodeLibcurl::Easy::ToFree>(__a=<unavailable>, __p=0x00007fffdc001600) at alloc_traits.h:487
    frame #16: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() at shared_ptr_base.h:1310
    frame #17: node_libcurl.node`std::_Sp_counted_deleter<NodeLibcurl::Easy::ToFree*, std::__shared_ptr<NodeLibcurl::Easy::ToFree, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<NodeLibcurl::Easy::ToFree> >, std::allocator<NodeLibcurl::Easy::ToFree>, (__gnu_cxx::_Lock_policy)2>::_M_dispose(this=<unavailable>) at shared_ptr_base.h:470
    frame #18: node_libcurl.node`NodeLibcurl::Easy::~Easy() [inlined] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release(this=0x0000000002417090) at shared_ptr_base.h:154
    frame #19: node_libcurl.node`NodeLibcurl::Easy::~Easy() [inlined] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release(this=0x0000000002417090)
    frame #20: node_libcurl.node`NodeLibcurl::Easy::~Easy() [inlined] _ZNSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EED4Ev(this=0x0000000002417828) at shared_ptr_base.h:684
    frame #21: node_libcurl.node`NodeLibcurl::Easy::~Easy() [inlined] _ZNSt12__shared_ptrIN11NodeLibcurl4Easy6ToFreeELN9__gnu_cxx12_Lock_policyE2EED4Ev(this=0x0000000002417820) at shared_ptr_base.h:1123
    frame #22: node_libcurl.node`NodeLibcurl::Easy::~Easy() [inlined] _ZNSt10shared_ptrIN11NodeLibcurl4Easy6ToFreeEED4Ev(this=0x0000000002417820) at shared_ptr.h:93
    frame #23: node_libcurl.node`NodeLibcurl::Easy::~Easy(this=0x00000000024177c0) at Easy.cc:122
    frame #24: node_libcurl.node`NodeLibcurl::Easy::~Easy(this=0x00000000024177c0) at Easy.cc:128
    frame #25: 0x0000000000ddc82e node`v8::internal::GlobalHandles::DispatchPendingPhantomCallbacks(bool) + 238
    frame #26: 0x0000000000ddca9a node`v8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::GarbageCollector, v8::GCCallbackFlags) + 42
    frame #27: 0x0000000000e0bb87 node`v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) + 567
    frame #28: 0x0000000000e0c9ce node`v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) + 798
    frame #29: 0x0000000000db07e2 node`v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) + 82
    frame #30: 0x000000000102a8c0 node`v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) + 96
    frame #31: 0x00002ea133d042fd <exit>
    frame #32: 0x00002ea133e05c4b <stub>
    frame #33: 0x00002ea133dbedb6 lookupAndListen(this=0x27c2211822d1:<undefined>, 0x20697cd033e1:<Object: Server>, <Smi: 3443>, 0x5794c94f119:<String: "localhost">, 0x27c2211823e1:<false>, 0x27c2211822d1:<undefined>) at net.js:1504:25 fn=0x00001d98be96c4b1
    frame #34: 0x00002ea133dbedb6 Server.listen(this=0x20697cd033e1:<Object: Server>) at net.js:1433:35 fn=0x00001d9180d4d479
    frame #35: 0x00002ea133d0535f <adaptor>
    frame #36: 0x00002ea133dbedb6 (anonymous)(this=0x20697cd03639:<Object: Context>, 0x20697cd035f1:<function: (anonymous) at /home/jcm/node-libcurl/node_modules/mocha/lib/runnable.js:400:39>) at /home/jcm/node-libcurl/test/curl/ssl.js:28:16 fn=0x000020697cd03571
    frame #37: 0x00002ea133dbedb6 callFnAsync(this=0x27c2211822d1:<undefined>, 0x20697cd03571:<function: (anonymous) at /home/jcm/node-libcurl/test/curl/ssl.js:28:16>) at /home/jcm/node-libcurl/node_modules/mocha/lib/runnable.js:399:23 fn=0x000020697cd03711
    frame #38: 0x00002ea133dbedb6 Runnable.run(this=0x20697cd03821:<Object: Hook>, 0x20697cd037d9:<function: (anonymous) at /home/jcm/node-libcurl/node_modules/mocha/lib/runner.js:317:22>) at /home/jcm/node-libcurl/node_modules/mocha/lib/runnable.js:275:34 fn=0x0000203bd3628961
    frame #39: 0x00002ea133dbedb6 next(this=0x27c2211822d1:<undefined>, <Smi: 0>) at /home/jcm/node-libcurl/node_modules/mocha/lib/runner.js:300:16 fn=0x000020697cd03929
    frame #40: 0x00002ea133dbedb6 (anonymous)(this=0x20697cd039f9:<Object: Immediate>) at /home/jcm/node-libcurl/node_modules/mocha/lib/runner.js:346:30 fn=0x000020697cd039b1
    frame #41: 0x00002ea133dbedb6 runCallback(this=0x27c2211822d1:<undefined>, 0x20697cd039f9:<Object: Immediate>) at timers.js:98:18 fn=0x00001d9180d1e6b9
    frame #42: 0x00002ea133dbedb6 tryOnImmediate(this=0x27c2211822d1:<undefined>, 0x20697cd039f9:<Object: Immediate>, 0x20697cd039f9:<Object: Immediate>) at timers.js:98:18 fn=0x00001d9180d1e671
    frame #43: 0x00002ea133dbedb6 processImmediate(this=0x7bf9c009cf9:<Object: process>) at timers.js:98:18 fn=0x00001d9180d1e629
    frame #44: 0x00002ea133d04239 <internal>
    frame #45: 0x00002ea133d04101 <entry>
    frame #46: 0x0000000000da611a node`v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 266
    frame #47: 0x0000000000a78b43 node`v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) + 355
    frame #48: 0x00000000008cf861 node`node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) + 177
    frame #49: 0x00000000008cfb93 node`node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*, node::async_context) + 163
    frame #50: 0x00000000008bca6f node`node::Environment::CheckImmediate(uv_check_s*) + 111
    frame #51: node`uv__run_check(loop=0x0000000002184aa0) at loop-watcher.c:67
    frame #52: node`uv_run(loop=0x0000000002184aa0, mode=UV_RUN_DEFAULT) at core.c:371
    frame #53: 0x00000000008d6665 node`node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) + 1205
    frame #54: 0x00000000008d59c0 node`node::Start(int, char**) + 352
    frame #55: libc.so.6`__libc_start_main(main=(node`main), argc=7, argv=0x00007fffffffde68, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffde58) at libc-start.c:310
    frame #56: 0x000000000089f101 node`_start + 41

Caused by not checking if current context is dead on Curl::AdjustMemory

@JCMais JCMais added the segfault label Apr 3, 2019
@JCMais JCMais self-assigned this Apr 3, 2019
@JCMais JCMais closed this as completed in e44d480 Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant