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 when storing the individual detector stations not as unique_ptr #8

Open
dtreffenstaedt opened this issue Apr 6, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@dtreffenstaedt
Copy link
Member

A segmentation fault happens upon creating the current log data when the map which stores the detector stations holds the objects directly, instead of using a std::unique_ptr.

To reproduce, use the commit 66d1a16

Backtrace:

  std::accumulate<double const*, double> (__first=0x7fffdf7ff000, __last=<optimized out>, __init=-nan(0xfffffffffff92))
      at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_numeric.h:141
  141             __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
  (gdb) backtrace
  #0  std::accumulate<double const*, double> (__first=0x7fffdf7ff000, __last=<optimized out>,
      __init=-nan(0xfffffffffff92))
      at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_numeric.h:141
  #1  muonpi::data_series<double, 100ul, false>::private_mean (this=<optimized out>)
      at include/analysis/dataseries.h:70
  #2  muonpi::data_series<double, 100ul, false>::{lambda()#1}::operator()() const (this=0x7fffc800b3b0)
      at include/analysis/dataseries.h:105
  #3  std::__invoke_impl<double, muonpi::data_series<double, 100ul, false>::{lambda()#1}&>(std::__invoke_other, muonpi::data_series<double, 100ul, false>::{lambda()#1}&) (__f=...)
      at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:60
  #4  std::__invoke_r<double, muonpi::data_series<double, 100ul, false>::{lambda()#1}&>(muonpi::data_series<double, 100ul, false>::{lambda()#1}&) (__fn=...)
      at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:113
  #5  std::_Function_handler<double (), muonpi::data_series<double, 100ul, false>::{lambda()#1}>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:291
  #6  0x0000000000503621 in std::function<double ()>::operator()() const (this=0x7fffc800b3b0)
      at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:622
  #7  muonpi::cached_value<double>::get (this=0x7fffc800b3b0)
      at include/analysis/cachedvalue.h:43
  #8  muonpi::data_series<double, 100ul, false>::mean (this=0x7fffc800b080)
      at include/analysis/dataseries.h:136
  #9  muonpi::detector_station::current_log_data (this=0x7fffc800a5c8)
      at src/analysis/detectorstation.cpp:191
  #10 0x000000000050dc0c in muonpi::supervision::station::process (this=<optimized out>)
      at src/supervision/station.cpp:95
  #11 0x0000000000436638 in muonpi::sink::threaded<muonpi::detector_info_t<muonpi::location_t> >::step (
      this=0x7fffffffd068) at include/sink/base.h:156
  #12 0x00000000004887ea in muonpi::thread_runner::run (this=this@entry=0x7fffffffd070)
      at src/utility/threadrunner.cpp:114
  #13 0x000000000048924f in muonpi::thread_runner::exec (this=0x7fffffffd070)
      at src/utility/threadrunner.cpp:139
  #14 0x00007ffff7588ed0 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #15 0x00007ffff7a90ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
  #16 0x00007ffff7294def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
@dtreffenstaedt dtreffenstaedt added the bug Something isn't working label Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant