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

Crash on OTLPAgent when running tests under load #29

Closed
santigimeno opened this issue Nov 23, 2023 · 0 comments · Fixed by #30
Closed

Crash on OTLPAgent when running tests under load #29

santigimeno opened this issue Nov 23, 2023 · 0 comments · Fixed by #30
Assignees

Comments

@santigimeno
Copy link
Member

In a resource constrained environment this crash sometimes happens when running the test/parallel/test-nsolid-otlp* tests

(lldb) bt all                                                              
                                                                                                          
* thread #1                                                                                   
  * frame #0: 0x00007ff814dc80da libsystem_kernel.dylib`__ulock_wait + 10                                 
    frame #1: 0x00007ff814e04c95 libsystem_pthread.dylib`_pthread_join + 358                              
    frame #2: 0x000000010ff57a6e nsolid`uv_thread_join(tid=<unavailable>) at thread.c:286:10 [opt]
    frame #3: 0x000000010f4fcda1 nsolid`node::nsolid::EnvList::~EnvList() [inlined] nsuv::ns_thread::join(this=<unavailable>) at nsuv-inl.h:1783:10 [opt]                                                            
    frame #4: 0x000000010f4fcd95 nsolid`node::nsolid::EnvList::~EnvList(this=0x0000000113bd4788) at nsolid_api.cc:793:16 [opt]                                                                                       
    frame #5: 0x00007ff814cfbde4 libsystem_c.dylib`__cxa_finalize_ranges + 409                            
    frame #6: 0x00007ff814cfbbfe libsystem_c.dylib`exit + 35                                                                                                                                                         
    frame #7: 0x00007ff814e0f375 libdyld.dylib`dyld4::LibSystemHelpers::exit(int) const + 11                                                                                                                         
    frame #8: 0x0000000123efe558 dyld`start + 504                                                                                                                                                                    
  thread #2                                                                                                                                                                                                          
    frame #0: 0x00007ff814dccffe libsystem_kernel.dylib`__pthread_kill + 10                          
    frame #1: 0x00007ff814e031ff libsystem_pthread.dylib`pthread_kill + 263                               
    frame #2: 0x00007ff814d4ed24 libsystem_c.dylib`abort + 123                                                                                                                                                       
    frame #3: 0x000000010ff57c64 nsolid`uv_rwlock_rdlock(rwlock=<unavailable>) at thread.c:382:5 [opt]
    frame #4: 0x000000010f4adfc2 nsolid`node::nsolid::otlp::OTLPAgent::config_agent_cb_(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*) [inlined] nsuv::ns_rwlock::scoped_rdlock::scoped_rdlock(this=<unavailable>, lock=<unavailable>) at nsuv-inl.h:1705:3 [opt]                                                                                                 
    frame #5: 0x000000010f4adfb3 nsolid`node::nsolid::otlp::OTLPAgent::config_agent_cb_(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*) [inlined] nsuv::ns_rwlock::scoped_rdlock::scoped_rdlock(this=<unavailable>, lock=<unavailable>) at nsuv-inl.h:1704:22 [opt]                                                                                                
    frame #6: 0x000000010f4adfb3 nsolid`node::nsolid::otlp::OTLPAgent::config_agent_cb_(config="{\"app\":\"untitled application\",\"blockedLoopThreshold\":200,\"disablePackageScan\":false,\"env\":\"prod\",\"hostname\":\"Mac-1700569803041.local\",\"iisNode\":false,\"interval\":3000,\"otlp\":\"datadog\",\"otlpConfig\":{\"key\":\"my_random_key\",\"url\":\"http://localhost:9999\",\"zone\":\"eu\"},\"pauseMetrics\":false,\"promiseTracking\":false,\"pubkey\":\"^kvy<i^qI<r{=ZDrfK4K<#NtqY+zaH:ksm/YGE6I\",\"statsdBucket\":\"nsolid.${env}.${app}.${hostname}.${shortId}\",\"tags\":[],\"tracingEnabled\":false,\"tracingModulesBlacklist\":0,\"trackGlobalPackages\":false}", agent=0x0000000113bc1a10) at otlp_agent.cc:206:34 [opt]                                                                                                                                   
    frame #7: 0x000000010f4bd6fc nsolid`void node::nsolid::internal::on_configuration_hook_proxy_<std::__1::__bind<void (&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::placeholders::__ph<1> const&, node::nsolid::otlp::OTLPAgent*> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*) [inlined] decltype(__f=<unavailable>, __args=<unavailable>, __args=<unavailable>)(static_cast<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(fp0), static_cast<node::nsolid::otlp::OTLPAgent*&>(fp0))) std::__1::__invoke<void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, node::nsolid::otlp::OTLPAgent*&>(void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, node::nsolid::otlp::OTLPAgent*&) at type_traits:3918:1 [opt]                                                                              
    frame #8: 0x000000010f4bd6ea nsolid`void node::nsolid::internal::on_configuration_hook_proxy_<std::__1::__bind<void (&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::placeholders::__ph<1> const&, node::nsolid::otlp::OTLPAgent*> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*) [inlined] std::__1::__bind_return<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::tuple<std::__1::placeholders::__ph<1>, node::nsolid::otlp::OTLPAgent*>, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>, __is_valid_bind_return<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::tuple<std::__1::placeholders::__ph<1>, node::nsolid::otlp::OTLPAgent*>, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&> >::value>::type std::__1::__apply_functor<void (__f=<unavailable>, __bound_args=<unavailable>, (null)=<unavailable>, __args=<unavailable>)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::tuple<std::__1::placeholders::__ph<1>, node::nsolid::otlp::OTLPAgent*>, 0ul, 1ul, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&> >(void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::tuple<std::__1::placeholders::__ph<1>, node::nsolid::otlp::OTLPAgent*>&, std::__1::__tuple_indices<0ul, 1ul>, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>&&) at bind.h:257:12 [opt]                                                                                                                                                                                                  
    frame #9: 0x000000010f4bd6ea nsolid`void node::nsolid::internal::on_configuration_hook_proxy_<std::__1::__bind<void (&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::placeholders::__ph<1> const&, node::nsolid::otlp::OTLPAgent*> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*) [inlined] std::__1::__bind_return<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::tuple<std::__1::placeholders::__ph<1>, node::nsolid::otlp::OTLPAgent*>, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>, __is_valid_bind_return<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::tuple<std::__1::placeholders::__ph<1>, node::nsolid::otlp::OTLPAgent*>, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&> >::value>::type std::__1::__bind<void (this=0x0000600002ca0300, __args=<unavailable>)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::placeholders::__ph<1> const&, node::nsolid::otlp::OTLPAgent*>::operator()<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) at bind.h:292:20 [opt]                                                                                                                    
    frame #10: 0x000000010f4bd6e3 nsolid`void node::nsolid::internal::on_configuration_hook_proxy_<std::__1::__bind<void (&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, node::nsolid::otlp::OTLPAgent*), std::__1::placeholders::__ph<1> const&, node::nsolid::otlp::OTLPAgent*> >(info=<unavailable>, data=0x0000600002ca0300) at nsolid.h:1476:3 [opt]                                      
    frame #11: 0x000000010f50a4f2 nsolid`void node::nsolid::internal::queue_callback_proxy_<std::__1::__bind<void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*&> >(void*) [inlined] decltype(__f=<unavailable>, __args="{\"app\":\"untitled application\",\"blockedLoopThreshold\":200,\"disablePackageScan\":false,\"env\":\"prod\",\"hostname\":\"Mac-1700569803041.local\",\"iisNode\":false,\"interval\":3000,\"otlp\":\"datadog\",\"otlpConfig\":{\"key\":\"my_random_key\",\"url\":\"http://localhost:9999\",\"zone\":\"eu\"},\"pauseMetrics\":false,\"promiseTracking\":false,\"pubkey\":\"^kvy<i^qI<r{=ZDrfK4K<#NtqY+zaH:ksm/YGE6I\",\"statsdBucket\":\"nsolid.${env}.${app}.${hostname}.${shortId}\",\"tags\":[],\"tracingEnabled\":false,\"tracingModulesBlacklist\":0,\"trackGlobalPackages\":false}", __args=<unavailable>)(static_cast<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(fp0), static_cast<void*&>(fp0))) std::__1::__invoke<void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, void*&>(void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, void*&) at type_traits:3918:1 [opt]                                                                                                                                                                       
    frame #12: 0x000000010f50a4dd nsolid`void node::nsolid::internal::queue_callback_proxy_<std::__1::__bind<void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*&> >(void*) [inlined] std::__1::__bind_return<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>, std::__1::tuple<>, __is_valid_bind_return<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (__f=<unavailable>, __bound_args=<unavailable>, (null)=<unavailable>, __args=<unavailable>)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>, 0ul, 1ul, std::__1::tuple<> >(void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>&, std::__1::__tuple_indices<0ul, 1ul>, std::__1::tuple<>&&) at bind.h:257:12 [opt]                                                                                                                                                                                              
    frame #13: 0x000000010f50a4d5 nsolid`void node::nsolid::internal::queue_callback_proxy_<std::__1::__bind<void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*&> >(void*) [inlined] std::__1::__bind_return<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>, std::__1::tuple<>, __is_valid_bind_return<void (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (this=0x00006000020ad590)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*&>::operator()<>() at bind.h:292:20 [opt]                                                                                                                                                
    frame #14: 0x000000010f50a4d2 nsolid`void node::nsolid::internal::queue_callback_proxy_<std::__1::__bind<void (*&)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*), std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*&> >(data=0x00006000020ad590) at nsolid.h:1434:3 [opt]                                                                  
    frame #15: 0x000000010f4fc38e nsolid`node::nsolid::EnvList::process_callbacks_((null)=<unavailable>, envlist=0x0000000113bd4788) at nsolid_api.cc:1396:5 [opt]                                                   
    frame #16: 0x000000010ff492b1 nsolid`uv__async_io(loop=0x0000000113bd47a8, w=<unavailable>, events=<unavailable>) at async.c:176:5 [opt]                                                                         
    frame #17: 0x000000010ff5cf01 nsolid`uv__io_poll(loop=<unavailable>, timeout=<unavailable>) at kqueue.c:382:9 [opt]                                                                                              
    frame #18: 0x000000010ff49851 nsolid`uv_run(loop=0x0000000113bd47a8, mode=UV_RUN_DEFAULT) at core.c:453:5 [opt]                                                                                                  
    frame #19: 0x000000010f4fcd11 nsolid`node::nsolid::EnvList::env_list_routine_((null)=<unavailable>, envlist=<unavailable>) at nsolid_api.cc:1488:8 [opt]                                                         
    frame #20: 0x00007ff814e034e1 libsystem_pthread.dylib`_pthread_start + 125              
    frame #21: 0x00007ff814dfef6b libsystem_pthread.dylib`thread_start + 15                                                                                                                                          
  thread #3                                                                               
    frame #0: 0x00007ff814dc69a6 libsystem_kernel.dylib`semaphore_wait_trap + 10       
    frame #1: 0x000000010ff57df7 nsolid`uv_sem_wait(sem=0x0000000113bd589c) at thread.c:471:9 [opt]                                                                                                                  
    frame #2: 0x000000010f513b93 nsolid`node::inspector::(anonymous namespace)::StartIoThreadMain(unused=<unavailable>) at inspector_agent.cc:85:5 [opt]                                                             
    frame #3: 0x00007ff814e034e1 libsystem_pthread.dylib`_pthread_start + 125           
    frame #4: 0x00007ff814dfef6b libsystem_pthread.dylib`thread_start + 15
@santigimeno santigimeno self-assigned this Nov 23, 2023
santigimeno added a commit that referenced this issue Nov 23, 2023
Move the `exit_lock_` out of the class and make it static so we can use
it even if the agent has been deleted.
Also, make sure we use the `exit_lock_` in `OTLPAgent::config_msg_cb_`.

Fixes: #29
trevnorris pushed a commit that referenced this issue Nov 30, 2023
Move the `exit_lock_` out of the class and make it static so we can use
it even if the agent has been deleted.
Also, make sure we use the `exit_lock_` in `OTLPAgent::config_msg_cb_`.

Fixes: #29
PR-URL: #30
Reviewed-by: Trevor Norris <[email protected]>
santigimeno added a commit that referenced this issue Dec 6, 2023
Move the `exit_lock_` out of the class and make it static so we can use
it even if the agent has been deleted.
Also, make sure we use the `exit_lock_` in `OTLPAgent::config_msg_cb_`.

Fixes: #29
PR-URL: #30
Reviewed-by: Trevor Norris <[email protected]>
trevnorris pushed a commit that referenced this issue Dec 7, 2023
Move the `exit_lock_` out of the class and make it static so we can use
it even if the agent has been deleted.
Also, make sure we use the `exit_lock_` in `OTLPAgent::config_msg_cb_`.

Fixes: #29
PR-URL: #30
Reviewed-by: Trevor Norris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant