Skip to content

Instantly share code, notes, and snippets.

@wch
Created December 7, 2017 05:31
Show Gist options
  • Save wch/9818a0321782c4e3cfcf321ee9a87cdb to your computer and use it in GitHub Desktop.
Save wch/9818a0321782c4e3cfcf321ee9a87cdb to your computer and use it in GitHub Desktop.
valgrind + helgrind output for httpuv app
Results from running:
RDvalgrind2 -d "valgrind -v --tool=helgrind"
and then running httpuv test app, and hitting it with lots of requests.
library(httpuv)
library(promises)
content <- list(
status = 200L,
headers = list(
'Content-Type' = 'text/html'
),
body = "abc"
)
app_handle <- startServer("0.0.0.0", 5000,
list(
onHeaders = function(req) {
if (req$PATH_INFO == "/header") {
# content$body <- "this is a response from onHeaders()\n"
return(content)
} else {
return(NULL)
}
},
call = function(req) {
if (req$PATH_INFO %in% c("/", "/sync")) {
return(content)
} else if (req$PATH_INFO == "/async") {
promise(function(resolve, reject) {
resolve(content)
})
}
}
)
)
==30841== ---Thread-Announcement------------------------------------------
==30841==
==30841== Thread #1 is the program's root thread
==30841==
==30841== ---Thread-Announcement------------------------------------------
==30841==
==30841== Thread #3 was created
==30841== at 0x581EAFE: clone (clone.S:71)
==30841== by 0x54F1291: create_thread (createthread.c:100)
==30841== by 0x54F2FC7: pthread_create@@GLIBC_2.2.5 (pthread_create.c:822)
==30841== by 0x4C36A27: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0C8B: Timer::set(Timestamp const&) (timer_posix.cpp:99)
==30841== by 0xF6B01AD: doExecLater(void (*)(void*), void*, double) (later_posix.cpp:177)
==30841== by 0xF6AEA49: execLaterNative (later.cpp:119)
==30841== by 0xFB1BFEC: later::later(void (*)(void*), void*, double) (later.h:57)
==30841== by 0xFB1DB13: HttpRequest::_on_headers_complete(http_parser*) (httprequest.cpp:230)
==30841== by 0xFB1FEE1: HttpRequest_on_headers_complete(http_parser*) (httprequest.cpp:690)
==30841== by 0xFB68A48: http_parser_execute (http_parser.c:1837)
==30841== by 0xFB1F62A: HttpRequest::_parse_http_data(char*, long) (httprequest.cpp:571)
==30841==
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during read of size 1 at 0xF8BE014 by thread #1
==30841== Locks held: none
==30841== at 0xF6AFAA2: set_fd(bool) (later_posix.cpp:44)
==30841== by 0xF6B0409: SuspendFDReadiness::SuspendFDReadiness() (later_posix.cpp:71)
==30841== by 0xF6AFBDD: async_input_handler(void*) (later_posix.cpp:107)
==30841== by 0x50CA7EA: R_runHandlers (sys-std.c:383)
==30841== by 0x50CB983: Rstd_ReadConsole (sys-std.c:1033)
==30841== by 0x50CE91E: R_ReadConsole (system.c:72)
==30841== by 0x4FBCB1E: Rf_ReplIteration (main.c:206)
==30841== by 0x4FBCED4: R_ReplConsole (main.c:308)
==30841== by 0x4FBE982: run_Rmainloop (main.c:1082)
==30841== by 0x4FBE998: Rf_mainloop (main.c:1089)
==30841== by 0x10896B: main (Rmain.c:29)
==30841==
==30841== This conflicts with a previous write of size 1 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AFAD7: set_fd(bool) (later_posix.cpp:48)
==30841== by 0xF6AFB36: (anonymous namespace)::fd_on() (later_posix.cpp:62)
==30841== by 0xF6B05A3: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118)
==30841== by 0xF6AEFCC: boost::function0<void>::operator()() const (function_template.hpp:759)
==30841== by 0xF6B0A2B: Timer::bg_main() (timer_posix.cpp:64)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== Address 0xf8be014 is 0 bytes inside data symbol "hot"
==30841==
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during write of size 1 at 0xF8BE014 by thread #1
==30841== Locks held: none
==30841== at 0xF6AFB23: set_fd(bool) (later_posix.cpp:55)
==30841== by 0xF6B0409: SuspendFDReadiness::SuspendFDReadiness() (later_posix.cpp:71)
==30841== by 0xF6AFBDD: async_input_handler(void*) (later_posix.cpp:107)
==30841== by 0x50CA7EA: R_runHandlers (sys-std.c:383)
==30841== by 0x50CB983: Rstd_ReadConsole (sys-std.c:1033)
==30841== by 0x50CE91E: R_ReadConsole (system.c:72)
==30841== by 0x4FBCB1E: Rf_ReplIteration (main.c:206)
==30841== by 0x4FBCED4: R_ReplConsole (main.c:308)
==30841== by 0x4FBE982: run_Rmainloop (main.c:1082)
==30841== by 0x4FBE998: Rf_mainloop (main.c:1089)
==30841== by 0x10896B: main (Rmain.c:29)
==30841==
==30841== This conflicts with a previous write of size 1 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AFAD7: set_fd(bool) (later_posix.cpp:48)
==30841== by 0xF6AFB36: (anonymous namespace)::fd_on() (later_posix.cpp:62)
==30841== by 0xF6B05A3: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118)
==30841== by 0xF6AEFCC: boost::function0<void>::operator()() const (function_template.hpp:759)
==30841== by 0xF6B0A2B: Timer::bg_main() (timer_posix.cpp:64)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== Address 0xf8be014 is 0 bytes inside data symbol "hot"
==30841==
==30841== ---Thread-Announcement------------------------------------------
==30841==
==30841== Thread #2 was created
==30841== at 0x581EAFE: clone (clone.S:71)
==30841== by 0x54F1291: create_thread (createthread.c:100)
==30841== by 0x54F2FC7: pthread_create@@GLIBC_2.2.5 (pthread_create.c:822)
==30841== by 0x4C36A27: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xFB56679: uv_thread_create (thread.c:198)
==30841== by 0xFB2C8A9: ensure_io_thread() (httpuv.cpp:105)
==30841== by 0xFB2D09D: makeTcpServer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, Rcpp::Function_Impl<Rcpp::PreserveStorage>, Rcpp::Function_Impl<Rcpp::PreserveStorage>, Rcpp::Function_Impl<Rcpp::PreserveStorage>, Rcpp::Function_Impl<Rcpp::PreserveStorage>, Rcpp::Function_Impl<Rcpp::PreserveStorage>, Rcpp::Function_Impl<Rcpp::PreserveStorage>) (httpuv.cpp:187)
==30841== by 0xFB12C24: _httpuv_makeTcpServer (RcppExports.cpp:44)
==30841== by 0x4F2ECE5: R_doDotCall (dotcode.c:596)
==30841== by 0x4F39C3D: do_dotcall (dotcode.c:1252)
==30841== by 0x4F7525E: Rf_eval (eval.c:728)
==30841== by 0x4F79871: do_begin (eval.c:2209)
==30841==
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during write of size 8 at 0xB4EB600 by thread #1
==30841== Locks held: none
==30841== at 0xF6B1BF7: TimestampImplPosix::~TimestampImplPosix() (timestamp_unix.cpp:13)
==30841== by 0xF6B1C21: TimestampImplPosix::~TimestampImplPosix() (timestamp_unix.cpp:13)
==30841== by 0xF6B1C5E: void boost::checked_delete<TimestampImplPosix>(TimestampImplPosix*) (checked_delete.hpp:34)
==30841== by 0xF6B1CD7: boost::detail::sp_counted_impl_p<TimestampImplPosix>::dispose() (sp_counted_impl.hpp:92)
==30841== by 0xF6AADB8: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:110)
==30841== by 0xF6AAE44: boost::detail::shared_count::~shared_count() (shared_count.hpp:426)
==30841== by 0xF6AB589: boost::shared_ptr<TimestampImpl const>::~shared_ptr() (shared_ptr.hpp:341)
==30841== by 0xF6AB5CB: Timestamp::~Timestamp() (timestamp.h:16)
==30841== by 0xF6AB69B: Callback::~Callback() (callback_registry.h:13)
==30841== by 0xF6ADD44: void std::_Destroy<Callback>(Callback*) (stl_construct.h:98)
==30841== by 0xF6AD4A6: void std::_Destroy_aux<false>::__destroy<Callback*>(Callback*, Callback*) (stl_construct.h:108)
==30841== by 0xF6AC90B: void std::_Destroy<Callback*>(Callback*, Callback*) (stl_construct.h:137)
==30841==
==30841== This conflicts with a previous read of size 8 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AAF6E: Timestamp::diff_secs(Timestamp const&) const (timestamp.h:39)
==30841== by 0xF6B08B8: Timer::bg_main() (timer_posix.cpp:34)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== by 0x581EB0E: clone (clone.S:95)
==30841== Address 0xb4eb600 is 0 bytes inside a block of size 24 alloc'd
==30841== at 0x4C3159F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B1489: Timestamp::Timestamp(double) (timestamp_unix.cpp:67)
==30841== by 0xF6AA3D2: CallbackRegistry::add(void (*)(void*), void*, double) (callback_registry.cpp:16)
==30841== by 0xF6B017C: doExecLater(void (*)(void*), void*, double) (later_posix.cpp:175)
==30841== by 0xF6AEA49: execLaterNative (later.cpp:119)
==30841== by 0xFB1BFEC: later::later(void (*)(void*), void*, double) (later.h:57)
==30841== by 0xFB1DB13: HttpRequest::_on_headers_complete(http_parser*) (httprequest.cpp:230)
==30841== by 0xFB1FEE1: HttpRequest_on_headers_complete(http_parser*) (httprequest.cpp:690)
==30841== by 0xFB68A48: http_parser_execute (http_parser.c:1837)
==30841== by 0xFB1F62A: HttpRequest::_parse_http_data(char*, long) (httprequest.cpp:571)
==30841== by 0xFB1FCA5: HttpRequest::_on_request_read(uv_stream_s*, long, uv_buf_t const*) (httprequest.cpp:643)
==30841== by 0xFB1FFA9: HttpRequest_on_request_read(uv_stream_s*, long, uv_buf_t const*) (httprequest.cpp:694)
==30841== Block was alloc'd by thread #2
==30841==
--30841-- Reading syms from /usr/local/RDvalgrind2/lib/R/library/rlang/libs/rlang.so
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during read of size 1 at 0xF8BE014 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AFAA2: set_fd(bool) (later_posix.cpp:44)
==30841== by 0xF6AFB36: (anonymous namespace)::fd_on() (later_posix.cpp:62)
==30841== by 0xF6B05A3: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118)
==30841== by 0xF6AEFCC: boost::function0<void>::operator()() const (function_template.hpp:759)
==30841== by 0xF6B0A2B: Timer::bg_main() (timer_posix.cpp:64)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== by 0x581EB0E: clone (clone.S:95)
==30841==
==30841== This conflicts with a previous write of size 1 by thread #1
==30841== Locks held: none
==30841== at 0xF6AFAD7: set_fd(bool) (later_posix.cpp:48)
==30841== by 0xF6B042F: SuspendFDReadiness::~SuspendFDReadiness() (later_posix.cpp:75)
==30841== by 0xF6AFBF2: async_input_handler(void*) (later_posix.cpp:107)
==30841== by 0x50CA7EA: R_runHandlers (sys-std.c:383)
==30841== by 0x50CB983: Rstd_ReadConsole (sys-std.c:1033)
==30841== by 0x50CE91E: R_ReadConsole (system.c:72)
==30841== by 0x4FBCB1E: Rf_ReplIteration (main.c:206)
==30841== by 0x4FBCED4: R_ReplConsole (main.c:308)
==30841== Address 0xf8be014 is 0 bytes inside data symbol "hot"
==30841==
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during write of size 1 at 0xF8BE014 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AFAD7: set_fd(bool) (later_posix.cpp:48)
==30841== by 0xF6AFB36: (anonymous namespace)::fd_on() (later_posix.cpp:62)
==30841== by 0xF6B05A3: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118)
==30841== by 0xF6AEFCC: boost::function0<void>::operator()() const (function_template.hpp:759)
==30841== by 0xF6B0A2B: Timer::bg_main() (timer_posix.cpp:64)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== by 0x581EB0E: clone (clone.S:95)
==30841==
==30841== This conflicts with a previous read of size 1 by thread #1
==30841== Locks held: none
==30841== at 0xF6AFAA2: set_fd(bool) (later_posix.cpp:44)
==30841== by 0xF6B0409: SuspendFDReadiness::SuspendFDReadiness() (later_posix.cpp:71)
==30841== by 0xF6AFBDD: async_input_handler(void*) (later_posix.cpp:107)
==30841== by 0x50CA7EA: R_runHandlers (sys-std.c:383)
==30841== by 0x50CB983: Rstd_ReadConsole (sys-std.c:1033)
==30841== by 0x50CE91E: R_ReadConsole (system.c:72)
==30841== by 0x4FBCB1E: Rf_ReplIteration (main.c:206)
==30841== by 0x4FBCED4: R_ReplConsole (main.c:308)
==30841== Address 0xf8be014 is 0 bytes inside data symbol "hot"
==30841==
>
>
> q()
Save workspace image? [y/n/c]: n
--30841-- Reading syms from /usr/local/RDvalgrind2/lib/R/library/tools/libs/tools.so
--30841-- REDIR: 0x54f3ab0 (libpthread.so.0:pthread_join) redirected to 0x4c37b40 (pthread_join)
==30841== ----------------------------------------------------------------
==30841==
==30841== Thread #3: Exiting thread still holds 1 lock
==30841== at 0x54F28BE: __exit_thread (exit-thread.h:36)
==30841== by 0x54F28BE: start_thread (pthread_create.c:608)
==30841== by 0x581EB0E: clone (clone.S:95)
==30841==
--30841-- REDIR: 0x54f8af0 (libpthread.so.0:pthread_cond_destroy@@GLIBC_2.3.2) redirected to 0x4c37fe0 (pthread_cond_destroy@*)
--30841-- REDIR: 0x54f4a30 (libpthread.so.0:pthread_mutex_destroy) redirected to 0x4c37f40 (pthread_mutex_destroy)
==30841== ----------------------------------------------------------------
==30841==
==30841== Thread #1: pthread_mutex_destroy of a locked mutex
==30841== at 0x4C33DE9: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0BBD: Timer::~Timer() (timer_posix.cpp:90)
==30841== by 0x5745EBF: __run_exit_handlers (exit.c:83)
==30841== by 0x5745F19: exit (exit.c:105)
==30841== by 0x50CBE35: Rstd_CleanUp (sys-std.c:1213)
==30841== by 0x50CEA4D: R_CleanUp (system.c:82)
==30841== by 0x4FBE913: end_Rmainloop (main.c:1072)
==30841== by 0x4FBE987: run_Rmainloop (main.c:1083)
==30841== by 0x4FBE998: Rf_mainloop (main.c:1089)
==30841== by 0x10896B: main (Rmain.c:29)
==30841==
==30841== ----------------------------------------------------------------
==30841==
==30841== Thread #1's call to pthread_mutex_destroy failed
==30841== with error code 16 (EBUSY: Device or resource busy)
==30841== at 0x4C33EB3: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0BBD: Timer::~Timer() (timer_posix.cpp:90)
==30841== by 0x5745EBF: __run_exit_handlers (exit.c:83)
==30841== by 0x5745F19: exit (exit.c:105)
==30841== by 0x50CBE35: Rstd_CleanUp (sys-std.c:1213)
==30841== by 0x50CEA4D: R_CleanUp (system.c:82)
==30841== by 0x4FBE913: end_Rmainloop (main.c:1072)
==30841== by 0x4FBE987: run_Rmainloop (main.c:1083)
==30841== by 0x4FBE998: Rf_mainloop (main.c:1089)
==30841== by 0x10896B: main (Rmain.c:29)
==30841==
==30841==
==30841== ERROR SUMMARY: 41 errors from 8 contexts (suppressed: 2610 from 68)
==30841==
==30841== 1 errors in context 1 of 8:
==30841== ----------------------------------------------------------------
==30841==
==30841== Thread #1's call to pthread_mutex_destroy failed
==30841== with error code 16 (EBUSY: Device or resource busy)
==30841== at 0x4C33EB3: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0BBD: Timer::~Timer() (timer_posix.cpp:90)
==30841== by 0x5745EBF: __run_exit_handlers (exit.c:83)
==30841== by 0x5745F19: exit (exit.c:105)
==30841== by 0x50CBE35: Rstd_CleanUp (sys-std.c:1213)
==30841== by 0x50CEA4D: R_CleanUp (system.c:82)
==30841== by 0x4FBE913: end_Rmainloop (main.c:1072)
==30841== by 0x4FBE987: run_Rmainloop (main.c:1083)
==30841== by 0x4FBE998: Rf_mainloop (main.c:1089)
==30841== by 0x10896B: main (Rmain.c:29)
==30841==
==30841==
==30841== 1 errors in context 2 of 8:
==30841== ----------------------------------------------------------------
==30841==
==30841== Thread #1: pthread_mutex_destroy of a locked mutex
==30841== at 0x4C33DE9: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0BBD: Timer::~Timer() (timer_posix.cpp:90)
==30841== by 0x5745EBF: __run_exit_handlers (exit.c:83)
==30841== by 0x5745F19: exit (exit.c:105)
==30841== by 0x50CBE35: Rstd_CleanUp (sys-std.c:1213)
==30841== by 0x50CEA4D: R_CleanUp (system.c:82)
==30841== by 0x4FBE913: end_Rmainloop (main.c:1072)
==30841== by 0x4FBE987: run_Rmainloop (main.c:1083)
==30841== by 0x4FBE998: Rf_mainloop (main.c:1089)
==30841== by 0x10896B: main (Rmain.c:29)
==30841==
==30841==
==30841== 1 errors in context 3 of 8:
==30841== ----------------------------------------------------------------
==30841==
==30841== Thread #3: Exiting thread still holds 1 lock
==30841== at 0x54F28BE: __exit_thread (exit-thread.h:36)
==30841== by 0x54F28BE: start_thread (pthread_create.c:608)
==30841== by 0x581EB0E: clone (clone.S:95)
==30841==
==30841==
==30841== 2 errors in context 4 of 8:
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during write of size 1 at 0xF8BE014 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AFAD7: set_fd(bool) (later_posix.cpp:48)
==30841== by 0xF6AFB36: (anonymous namespace)::fd_on() (later_posix.cpp:62)
==30841== by 0xF6B05A3: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118)
==30841== by 0xF6AEFCC: boost::function0<void>::operator()() const (function_template.hpp:759)
==30841== by 0xF6B0A2B: Timer::bg_main() (timer_posix.cpp:64)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== by 0x581EB0E: clone (clone.S:95)
==30841==
==30841== This conflicts with a previous read of size 1 by thread #1
==30841== Locks held: none
==30841== at 0xF6AFAA2: set_fd(bool) (later_posix.cpp:44)
==30841== by 0xF6B0409: SuspendFDReadiness::SuspendFDReadiness() (later_posix.cpp:71)
==30841== by 0xF6AFBDD: async_input_handler(void*) (later_posix.cpp:107)
==30841== by 0x50CA7EA: R_runHandlers (sys-std.c:383)
==30841== by 0x50CB983: Rstd_ReadConsole (sys-std.c:1033)
==30841== by 0x50CE91E: R_ReadConsole (system.c:72)
==30841== by 0x4FBCB1E: Rf_ReplIteration (main.c:206)
==30841== by 0x4FBCED4: R_ReplConsole (main.c:308)
==30841== Address 0xf8be014 is 0 bytes inside data symbol "hot"
==30841==
==30841==
==30841== 2 errors in context 5 of 8:
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during read of size 1 at 0xF8BE014 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AFAA2: set_fd(bool) (later_posix.cpp:44)
==30841== by 0xF6AFB36: (anonymous namespace)::fd_on() (later_posix.cpp:62)
==30841== by 0xF6B05A3: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118)
==30841== by 0xF6AEFCC: boost::function0<void>::operator()() const (function_template.hpp:759)
==30841== by 0xF6B0A2B: Timer::bg_main() (timer_posix.cpp:64)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== by 0x581EB0E: clone (clone.S:95)
==30841==
==30841== This conflicts with a previous write of size 1 by thread #1
==30841== Locks held: none
==30841== at 0xF6AFAD7: set_fd(bool) (later_posix.cpp:48)
==30841== by 0xF6B042F: SuspendFDReadiness::~SuspendFDReadiness() (later_posix.cpp:75)
==30841== by 0xF6AFBF2: async_input_handler(void*) (later_posix.cpp:107)
==30841== by 0x50CA7EA: R_runHandlers (sys-std.c:383)
==30841== by 0x50CB983: Rstd_ReadConsole (sys-std.c:1033)
==30841== by 0x50CE91E: R_ReadConsole (system.c:72)
==30841== by 0x4FBCB1E: Rf_ReplIteration (main.c:206)
==30841== by 0x4FBCED4: R_ReplConsole (main.c:308)
==30841== Address 0xf8be014 is 0 bytes inside data symbol "hot"
==30841==
==30841==
==30841== 10 errors in context 6 of 8:
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during write of size 8 at 0xB4EB600 by thread #1
==30841== Locks held: none
==30841== at 0xF6B1BF7: TimestampImplPosix::~TimestampImplPosix() (timestamp_unix.cpp:13)
==30841== by 0xF6B1C21: TimestampImplPosix::~TimestampImplPosix() (timestamp_unix.cpp:13)
==30841== by 0xF6B1C5E: void boost::checked_delete<TimestampImplPosix>(TimestampImplPosix*) (checked_delete.hpp:34)
==30841== by 0xF6B1CD7: boost::detail::sp_counted_impl_p<TimestampImplPosix>::dispose() (sp_counted_impl.hpp:92)
==30841== by 0xF6AADB8: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:110)
==30841== by 0xF6AAE44: boost::detail::shared_count::~shared_count() (shared_count.hpp:426)
==30841== by 0xF6AB589: boost::shared_ptr<TimestampImpl const>::~shared_ptr() (shared_ptr.hpp:341)
==30841== by 0xF6AB5CB: Timestamp::~Timestamp() (timestamp.h:16)
==30841== by 0xF6AB69B: Callback::~Callback() (callback_registry.h:13)
==30841== by 0xF6ADD44: void std::_Destroy<Callback>(Callback*) (stl_construct.h:98)
==30841== by 0xF6AD4A6: void std::_Destroy_aux<false>::__destroy<Callback*>(Callback*, Callback*) (stl_construct.h:108)
==30841== by 0xF6AC90B: void std::_Destroy<Callback*>(Callback*, Callback*) (stl_construct.h:137)
==30841==
==30841== This conflicts with a previous read of size 8 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AAF6E: Timestamp::diff_secs(Timestamp const&) const (timestamp.h:39)
==30841== by 0xF6B08B8: Timer::bg_main() (timer_posix.cpp:34)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== by 0x581EB0E: clone (clone.S:95)
==30841== Address 0xb4eb600 is 0 bytes inside a block of size 24 alloc'd
==30841== at 0x4C3159F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B1489: Timestamp::Timestamp(double) (timestamp_unix.cpp:67)
==30841== by 0xF6AA3D2: CallbackRegistry::add(void (*)(void*), void*, double) (callback_registry.cpp:16)
==30841== by 0xF6B017C: doExecLater(void (*)(void*), void*, double) (later_posix.cpp:175)
==30841== by 0xF6AEA49: execLaterNative (later.cpp:119)
==30841== by 0xFB1BFEC: later::later(void (*)(void*), void*, double) (later.h:57)
==30841== by 0xFB1DB13: HttpRequest::_on_headers_complete(http_parser*) (httprequest.cpp:230)
==30841== by 0xFB1FEE1: HttpRequest_on_headers_complete(http_parser*) (httprequest.cpp:690)
==30841== by 0xFB68A48: http_parser_execute (http_parser.c:1837)
==30841== by 0xFB1F62A: HttpRequest::_parse_http_data(char*, long) (httprequest.cpp:571)
==30841== by 0xFB1FCA5: HttpRequest::_on_request_read(uv_stream_s*, long, uv_buf_t const*) (httprequest.cpp:643)
==30841== by 0xFB1FFA9: HttpRequest_on_request_read(uv_stream_s*, long, uv_buf_t const*) (httprequest.cpp:694)
==30841== Block was alloc'd by thread #2
==30841==
==30841==
==30841== 12 errors in context 7 of 8:
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during write of size 1 at 0xF8BE014 by thread #1
==30841== Locks held: none
==30841== at 0xF6AFB23: set_fd(bool) (later_posix.cpp:55)
==30841== by 0xF6B0409: SuspendFDReadiness::SuspendFDReadiness() (later_posix.cpp:71)
==30841== by 0xF6AFBDD: async_input_handler(void*) (later_posix.cpp:107)
==30841== by 0x50CA7EA: R_runHandlers (sys-std.c:383)
==30841== by 0x50CB983: Rstd_ReadConsole (sys-std.c:1033)
==30841== by 0x50CE91E: R_ReadConsole (system.c:72)
==30841== by 0x4FBCB1E: Rf_ReplIteration (main.c:206)
==30841== by 0x4FBCED4: R_ReplConsole (main.c:308)
==30841== by 0x4FBE982: run_Rmainloop (main.c:1082)
==30841== by 0x4FBE998: Rf_mainloop (main.c:1089)
==30841== by 0x10896B: main (Rmain.c:29)
==30841==
==30841== This conflicts with a previous write of size 1 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AFAD7: set_fd(bool) (later_posix.cpp:48)
==30841== by 0xF6AFB36: (anonymous namespace)::fd_on() (later_posix.cpp:62)
==30841== by 0xF6B05A3: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118)
==30841== by 0xF6AEFCC: boost::function0<void>::operator()() const (function_template.hpp:759)
==30841== by 0xF6B0A2B: Timer::bg_main() (timer_posix.cpp:64)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== Address 0xf8be014 is 0 bytes inside data symbol "hot"
==30841==
==30841==
==30841== 12 errors in context 8 of 8:
==30841== ----------------------------------------------------------------
==30841==
==30841== Lock at 0xF8BE348 was first observed
==30841== at 0x4C37F2A: pthread_mutex_init (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0xF6B0AEE: Timer::Timer(boost::function<void ()> const&) (timer_posix.cpp:71)
==30841== by 0xF6B033A: __static_initialization_and_destruction_0(int, int) (later_posix.cpp:65)
==30841== by 0xF6B03B1: _GLOBAL__sub_I_later_posix.cpp (later_posix.cpp:178)
==30841== by 0x4010A69: call_init.part.0 (dl-init.c:72)
==30841== by 0x4010B7A: call_init (dl-init.c:30)
==30841== by 0x4010B7A: _dl_init (dl-init.c:120)
==30841== by 0x4015B85: dl_open_worker (dl-open.c:575)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x40150D8: _dl_open (dl-open.c:660)
==30841== by 0x6D82FF5: dlopen_doit (dlopen.c:66)
==30841== by 0x5862D63: _dl_catch_error (dl-error-skeleton.c:198)
==30841== by 0x6D83758: _dlerror_run (dlerror.c:163)
==30841== Address 0xf8be348 is 40 bytes inside data symbol "_ZN12_GLOBAL__N_15timerE"
==30841==
==30841== Possible data race during read of size 1 at 0xF8BE014 by thread #1
==30841== Locks held: none
==30841== at 0xF6AFAA2: set_fd(bool) (later_posix.cpp:44)
==30841== by 0xF6B0409: SuspendFDReadiness::SuspendFDReadiness() (later_posix.cpp:71)
==30841== by 0xF6AFBDD: async_input_handler(void*) (later_posix.cpp:107)
==30841== by 0x50CA7EA: R_runHandlers (sys-std.c:383)
==30841== by 0x50CB983: Rstd_ReadConsole (sys-std.c:1033)
==30841== by 0x50CE91E: R_ReadConsole (system.c:72)
==30841== by 0x4FBCB1E: Rf_ReplIteration (main.c:206)
==30841== by 0x4FBCED4: R_ReplConsole (main.c:308)
==30841== by 0x4FBE982: run_Rmainloop (main.c:1082)
==30841== by 0x4FBE998: Rf_mainloop (main.c:1089)
==30841== by 0x10896B: main (Rmain.c:29)
==30841==
==30841== This conflicts with a previous write of size 1 by thread #3
==30841== Locks held: 1, at address 0xF8BE348
==30841== at 0xF6AFAD7: set_fd(bool) (later_posix.cpp:48)
==30841== by 0xF6AFB36: (anonymous namespace)::fd_on() (later_posix.cpp:62)
==30841== by 0xF6B05A3: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118)
==30841== by 0xF6AEFCC: boost::function0<void>::operator()() const (function_template.hpp:759)
==30841== by 0xF6B0A2B: Timer::bg_main() (timer_posix.cpp:64)
==30841== by 0xF6B07DB: Timer::bg_main_func(void*) (timer_posix.cpp:10)
==30841== by 0x4C36C26: ??? (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==30841== by 0x54F27FB: start_thread (pthread_create.c:465)
==30841== Address 0xf8be014 is 0 bytes inside data symbol "hot"
==30841==
--30841--
--30841-- used_suppression: 2610 helgrind-glibc2X-005 /usr/lib/valgrind/default.supp:951
==30841==
==30841== ERROR SUMMARY: 41 errors from 8 contexts (suppressed: 2610 from 68)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment