Open blappm opened 6 years ago
Crash with -O2. I'm currently trying to see if I can get crashes with -O0 too.
Core was generated by `lz4mt -1 --numthreads=3 -c'. Program terminated with signal SIGSEGV, Segmentation fault.
if (!static_cast<bool>(__p))
(gdb) where
wait (this=0x7f37f3bfeff0) at /usr/include/c++/7/future:691#2
(anonymous namespace)::<lambda(int, Lz4Mt::MemPool::Buffer, int)>::operator()(int, Lz4Mt::MemPool::Buffer , int) const (__closure=0x7f37f506e350, i=262143, srcRawPtr=
operator() (this=
__f=<optimized out>, __did_set=0x7f37fa1aee07) at /usr/include/c++/7/future:561#12
0x00007f37fc7b8d03 in pthread_once () from /lib64/libpthread.so.0
__once=...) at /usr/include/c++/7/mutex:684#15
_M_set_result (ignore_failure=false, res=..., this=0x7f37f506e300) at /usr/include/c++/7/future:401#16
operator() (closure=0x7f37f506e0e8) at /usr/include/c++/7/future:1667#17
__invoke_impl<void, std::future_base::_Async_state_impl<_BoundFn, _Res>::_Async_state_impl(_BoundFn&&) [with _BoundFn = std::thread::_Invoker<std::tuple<(anonymous namespace)::compress((anonymous namespace)::Ctx&, const (anonymous namespace)::Params&, Lz4Mt::Xxh32&)::<lambda(int, Lz4Mt::MemPool::Buffer, int)>, int, Lz4Mt::MemPool::Buffer, int> >; _Res = void]::<lambda()> > (__f=
at /usr/include/c++/7/bits/invoke.h:95
operator() (this=0x7f37f506e0e8) at /usr/include/c++/7/thread:243#21 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::future_base::_Async_state_impl<_BoundFn, _Res>::_Async_state_impl(_BoundFn&&) [with _BoundFn = std::thread::_Invoker<std::tuple<(anonymous namespace)::compress((anonymous namespace)::Ctx&, const (anonymous namespace)::Params&, Lz4Mt::Xxh32&)::<lambda(int, Lz4Mt::MemPool::Buffer, int)>, int, Lz4Mt::MemPool::Buffer, int> >; _Res = void]::<lambda()> > > >::_M_run(void) (this=0x7f37f506e0e0) at /usr/include/c++/7/thread:186#22 0x0000000000488cdf in std::execute_native_thread_routine (p=0x7f37f506e0e0) at ../../../../../libstdc++-v3/src/c++11/thread.cc:83
(gdb) p p
$1 = (const std::shared_ptr
Hi,
I'm trying to use your extemly fast version of lz4, but from time to time lz4mt is segfaulting due to a issue within threading. It happens with both compression and decompression, but not always at the same place.
We used gcc7 to compile it.
I've also tried the thread-pool variant, but there I see deadlocks - the compression is stalling.
Why haven't you merged the Thread-Pool veriant into the main tree? Was there any reason do not to do it? It seems to me that it would fix the segfault problems.
Best Regards: Martin