Aqueti / AquetiTools

Collection of data structures and generally useful tools maintained by Aqueti
1 stars 0 forks source link

ThreadTesting fails due to shared JsonBox variables #4

Closed sfeller closed 7 years ago

sfeller commented 7 years ago

It is known that JsonBox is not threadsafe. Test code assumes that it is.

sfeller commented 7 years ago

core results:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000ac159f in JsonBox::Value::operator= (this=0x7fb0eaf99e28, src=...) at /home/sfeller/develop/atl/dependencies/JsonBox/src/Value.cpp:225
225             type = src.type;
[Current thread is 1 (Thread 0x7fb0eaf9a700 (LWP 21967))]
(gdb) bt
#0  0x0000000000ac159f in JsonBox::Value::operator= (this=0x7fb0eaf99e28, src=...) at /home/sfeller/develop/atl/dependencies/JsonBox/src/Value.cpp:225
#1  0x0000000000ab673f in atl::JsonBuffer::operator= (this=0x7fb0eaf99e28) at /home/sfeller/develop/atl/Socket/JsonClient.h:15
#2  0x0000000000ab581f in atl::TSQueue<atl::JsonBuffer>::dequeue (this=0x2e25480, data=..., timeout=300)
    at /home/sfeller/develop/build/atl/INSTALL/include/atl/TSQueue.tcc:161
#3  0x0000000000ab1199 in atl::JsonClient::mainLoop (this=0x2e252b0) at /home/sfeller/develop/atl/Socket/JsonClient.cpp:214
#4  0x0000000000ab89cb in atl::Thread::Execute (this=0x2e253a8) at /home/sfeller/develop/atl/dependencies/AquetiTools/Thread/Thread.cpp:66
#5  0x0000000000abba56 in atl::MultiThread::Start(bool*)::$_0::operator()() const (this=0x2dbd088)
    at /home/sfeller/develop/atl/dependencies/AquetiTools/Thread/MultiThread.cpp:49
#6  0x0000000000abba05 in std::_Bind_simple<atl::MultiThread::Start(bool*)::$_0 ()>::_M_invoke<>(std::_Index_tuple<>) (this=0x2dbd088)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/functional:1530
#7  0x0000000000abb9d5 in std::_Bind_simple<atl::MultiThread::Start(bool*)::$_0 ()>::operator()() (this=0x2dbd088)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/functional:1520
#8  0x0000000000abb8c9 in std::thread::_Impl<std::_Bind_simple<atl::MultiThread::Start(bool*)::$_0 ()> >::_M_run() (this=0x2dbd070)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/thread:115
#9  0x00007fb0ecb50c80 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007fb0ece216ba in start_thread (arg=0x7fb0eaf9a700) at pthread_create.c:333
#11 0x00007fb0ec2b63dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
sfeller commented 7 years ago

Working to confirm this is a AquetiTools bug... estimate going up

sfeller commented 7 years ago

Fixed. Testing consistently passes. Closing