Assertion `hdr->_magic == RLE_PAYLOAD_MAGIC' failed


#1

Hi, there!

/home/scidb/data/scidbtrunk/src/array/RLE.cpp:993: scidb::ConstRLEPayload::ConstRLEPayload(const char*): Assertionhdr->_magic == RLE_PAYLOAD_MAGIC’ failed. 2016-11-28 12:31:21 (ppid=5011): SciDB child (pid=5031) terminated by signal = 6, core dumped`

I altered the source code. When I input below, I get that messages.
iquery -n -q "select objID from PhotoObjAll where (r - extinction_r) < 22 and mode =1 and type =3;"
Query was executed successfully
SystemException in file: src/network/BaseConnection.h function: receive line: 414
Error id: scidb::SCIDB_SE_NETWORK::SCIDB_LE_CANT_SEND_RECEIVE
Error description: Network error. Cannot send or receive network messages.

I want to know when hdr->_magic is assigned, how the error happened? Thank you!

Below is the result of gdb (bt):
#0 0x00000038736328a5 in raise () from /lib64/libc.so.6
#1 0x0000003873634085 in abort () from /lib64/libc.so.6
#2 0x000000387362ba1e in __assert_fail_base () from /lib64/libc.so.6
#3 0x000000387362bae0 in __assert_fail () from /lib64/libc.so.6
#4 0x000000000168eed7 in scidb::ConstRLEPayload::ConstRLEPayload (this=0x409a288, src=0x54366f0 “Z”)
at /home/scidb/data/scidbtrunk/src/array/RLE.cpp:1008
#5 0x000000000165f9e6 in scidb::RLEConstChunkIterator::RLEConstChunkIterator (this=0x409a180, desc=…, attr=9, data=
0x2d33640, bitmap=0x2908a90, iterationMode=258, query=std::shared_ptr (count 6) 0x2a60950)
at /home/scidb/data/scidbtrunk/src/array/MemChunk.cpp:599
#6 0x0000000001723b6b in __gnu_cxx::new_allocatorscidb::RLEConstChunkIterator::construct<scidb::RLEConstChunkIterator, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (
this=0x7f908f7e5fbf, __p=0x409a180) at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/ext/new_allocator.h:120
#7 0x0000000001723562 in std::allocator_traits<std::allocatorscidb::RLEConstChunkIterator >::_S_construct<scidb::RLEConstChunkIterator, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&>
(__a=…, __p=0x409a180) at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/alloc_traits.h:253
#8 0x0000000001722fff in std::allocator_traits<std::allocatorscidb::RLEConstChunkIterator >::construct<scidb::RLEConstChunkIterator, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (
__a=…, __p=0x409a180) at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/alloc_traits.h:399
#9 0x00000000017227d2 in std::_Sp_counted_ptr_inplace<scidb::RLEConstChunkIterator, std::allocatorscidb::RLEConstChunkIterator, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (this=0x409a170, __a=…)
at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/shared_ptr_base.h:515
#10 0x0000000001721b74 in __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<scidb::RLEConstChunkIterator, std::allocatorscidb::RLEConstChunkIterator, (__gnu_cxx::_Lock_policy)2> >::construct<std::_Sp_counted_ptr_inplace<scidb::RLEConstChunkIterator, std::allocatorscidb::RLEConstChunkIterator, (__gnu_cxx::_Lock_policy)2>, std::allocatorscidb::RLEConstChunkIterator const, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (
this=0x7f908f7e61a7, __p=0x409a170) at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/ext/new_allocator.h:120
#11 0x0000000001720d6d in std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<scidb::RLEConstChunkIterator, st—Type to continue, or q to quit—
d::allocatorscidb::RLEConstChunkIterator, (__gnu_cxx::_Lock_policy)2> > >::_S_construct<std::_Sp_counted_ptr_inplace<scidb::RLEConstChunkIterator, std::allocatorscidb::RLEConstChunkIterator, (__gnu_cxx::_Lock_policy)2>, std::allocatorscidb::RLEConstChunkIterator const, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (__a=…, __p=0x409a170) at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/alloc_traits.h:253
#12 0x000000000171f725 in std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<scidb::RLEConstChunkIterator, std::allocatorscidb::RLEConstChunkIterator, (__gnu_cxx::_Lock_policy)2> > >::construct<std::_Sp_counted_ptr_inplace<scidb::RLEConstChunkIterator, std::allocatorscidb::RLEConstChunkIterator, (__gnu_cxx::_Lock_policy)2>, std::allocatorscidb::RLEConstChunkIterator const, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (__a=…, __p=0x409a170) at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/alloc_traits.h:399
#13 0x000000000171cc61 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<scidb::RLEConstChunkIterator, std::allocatorscidb::RLEConstChunkIterator, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (this=0x7f908f7e6568, __a=…)
at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/shared_ptr_base.h:619
#14 0x00000000017187f6 in std::__shared_ptr<scidb::RLEConstChunkIterator, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocatorscidb::RLEConstChunkIterator, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (this=0x7f908f7e6560, __tag=…, __a=…)
at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/shared_ptr_base.h:1090
#15 0x00000000017142a4 in std::shared_ptrscidb::RLEConstChunkIterator::shared_ptr<std::allocatorscidb::RLEConstChunkIterator, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (
this=0x7f908f7e6560, __tag=…, __a=…) at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/shared_ptr.h:316
#16 0x000000000170f29d in std::allocate_shared<scidb::RLEConstChunkIterator, std::allocatorscidb::RLEConstChunkIterator, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> (__a=…)
at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/shared_ptr.h:588
#17 0x000000000170b96e in std::make_shared<scidb::RLEConstChunkIterator, scidb::ArrayDesc const&, unsigned int, scidb::Chunk*, scidb::Chunk*&, int&, std::shared_ptrscidb::Query&> ()
at /opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/bits/shared_ptr.h:604
#18 0x0000000001702551 in scidb::CachedStorage::DBArrayChunk::getConstIterator (this=0x2d33640, iterationMode=258)
at /home/scidb/data/scidbtrunk/src/smgr/io/Storage.cpp:2768
—Type to continue, or q to quit—
#19 0x0000000001b11e68 in scidb::FilterChunkIterator::FilterChunkIterator (this=0x2a7df90, arrayIterator=…, chunk=
0x283da30, iterationMode=258) at /home/scidb/data/scidbtrunk/src/query/ops/filter/FilterArray.cpp:211
#20 0x0000000001b1231f in scidb::ExistedBitmapChunkIterator::ExistedBitmapChunkIterator (this=0x2a7df90,
arrayIterator=…, chunk=0x283da30, iterationMode=258)
at /home/scidb/data/scidbtrunk/src/query/ops/filter/FilterArray.cpp:291
#21 0x0000000001b13480 in scidb::FilterArray::createChunkIterator (this=0x2949ff0, chunk=0x283da30, iterationMode=258)
at /home/scidb/data/scidbtrunk/src/query/ops/filter/FilterArray.cpp:439
#22 0x0000000001b7552b in scidb::DelegateChunk::getConstIterator (this=0x283da30, iterationMode=2)
at /home/scidb/data/scidbtrunk/src/array/DelegateArray.cpp:90
#23 0x0000000001b75a56 in scidb::DelegateChunkIterator::DelegateChunkIterator (this=0x4ae2600, aChunk=0x283da90,
iterationMode=1026) at /home/scidb/data/scidbtrunk/src/array/DelegateArray.cpp:222
#24 0x0000000001b75ec5 in scidb::DelegateArray::createChunkIterator (this=0x322c7a0, chunk=0x283da90, iterationMode=1026)
at /home/scidb/data/scidbtrunk/src/array/DelegateArray.cpp:314
#25 0x0000000001b7552b in scidb::DelegateChunk::getConstIterator (this=0x283da90, iterationMode=1026)
at /home/scidb/data/scidbtrunk/src/array/DelegateArray.cpp:90
#26 0x00000000016865b7 in scidb::ParallelAccumulatorArray::ChunkPrefetchJob::run (this=0x4ae2780)
at /home/scidb/data/scidbtrunk/src/array/ParallelAccumulatorArray.cpp:107
#27 0x00000000013f9be4 in scidb::Job::execute (this=0x4ae2780) at /home/scidb/data/scidbtrunk/src/util/Job.cpp:61
#28 0x00000000013ff596 in scidb::Thread::_threadFunction (this=0x2742c70)
at /home/scidb/data/scidbtrunk/src/util/Thread.cpp:149
#29 0x00000000013ff33a in scidb::Thread::threadFunction (arg=0x2742c70)
at /home/scidb/data/scidbtrunk/src/util/Thread.cpp:122
#30 0x0000003873e07851 in start_thread () from /lib64/libpthread.so.0
#31 0x00000038736e890d in clone () from /lib64/libc.so.6


#2

Hello Cherry,

This assertion failure indicates that there is memory corruption. Somehow the chunk payload magic number got clobbered. Since you say you modified the source code, you are kind of on your own to fix this. I would suggest desk-checking your changes to see there is any kind of dangling pointer or similar issue. Also, sometimes examining the memory in the area of the overwritten magic number is helpful… perhaps you’ll see familiar looking data there that will guide you toward what part of your changes may be responsible.

Best,
Mike