maidsafe-archive / MaidSafe

This is the super-project in which each MaidSafe library resides. Some information is common to all libraries, and is detailed here. Library-specific information can be found in each library's wiki.
Other
583 stars 102 forks source link

Uninitialised bounded string in ChunkInfoHandler::SerialiseChunkInfo #49

Closed ghost closed 12 years ago

ghost commented 12 years ago
I 2990537536 19:04:35.370322 pd/vault/node.cc:691] OnCloseNodeReplaced - 4fb0ec7..c7cafe3 - Synchronising with new node 6ba0424..567f5bc
I 3072326464 19:04:35.417055 pd/vault/node.cc:696] GetSyncDataCallback - 4fb0ec7..c7cafe3 - Got 2 data sets from 6ba0424..567f5bc
S 3072326464 19:04:35.417532 pd/vault/account_handler.cc:441] ParseAccounts - Parsed 10 account records.
S 3072326464 19:04:35.421061 pd/vault/chunk_info_handler.cc:1072] ParseChunkInfo - Parsed 52 chunk info records, 0 transaction records and 0 duplication records.
Init - 4fb0ec7..c7cafe3 - Network health is 23% (was 25%)
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::system_error> >'
  what():  Class is uninitialised.
#0  0xb7fdd424 in __kernel_vsyscall ()
#1  0xb7dd61df in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0xb7dd9825 in __GI_abort () at abort.c:91
#3  0x08dba81d in __gnu_cxx::__verbose_terminate_handler() ()
#4  0x08db8933 in __cxxabiv1::__terminate(void (*)()) ()
#5  0x08db896f in std::terminate() ()
#6  0x08db88be in __cxa_throw ()
#7  0x08ba8bde in boost::throw_exception<std::system_error> (e=...)
    at /home/maidsafe/Work/MyMaidSafe-SuperProject/src/third_party_libs/boost/boost/throw_exception.hpp:67
#8  0x08ba80c5 in maidsafe::DoThrowError (code=...)
    at /home/maidsafe/Work/MyMaidSafe-SuperProject/src/common/src/maidsafe/common/error.cc:72
#9  0x087d8a58 in maidsafe::ThrowError (code=...)
    at /home/maidsafe/Work/MyMaidSafe-SuperProject/src/common/include/maidsafe/common/error.h:561
#10 0x0880e946 in maidsafe::detail::BoundedString<24u, 24u>::string (this=0xb71fe178)
    at /home/maidsafe/Work/MyMaidSafe-SuperProject/src/common/include/maidsafe/common/bounded_string.h:122
#11 0x088acf57 in operator() (this=0xb71fe1ac, entry=...)
    at /home/maidsafe/Work/MyMaidSafe-SuperProject/src/pd/src/maidsafe/pd/vault/chunk_info_handler.cc:912
#12 0x088aedc0 in std::for_each<std::_Rb_tree_const_iterator<std::pair<const maidsafe::NodeId, maidsafe::pd::vault::ChunkInfoHandler::ChunkInfo::Instance> >, maidsafe::pd::vault::ChunkInfoHandler::SerialiseChunkInfo()::<lambda(const value_type&)>::<lambda(const std::pair<maidsafe::NodeId, maidsafe::pd::vault::ChunkInfoHandler::ChunkInfo::Instance>&)> >(std::_Rb_tree_const_iterator<std::pair<maidsafe::NodeId const, maidsafe::pd::vault::ChunkInfoHandler::ChunkInfo::Instance> >, std::_Rb_tree_const_iterator<std::pair<maidsafe::NodeId const, maidsafe::pd::vault::ChunkInfoHandler::ChunkInfo::Instance> >, struct {...}) (__first=..., __last=..., __f=...) at /usr/include/c++/4.6/bits/stl_algo.h:4379
#13 0x088ad157 in operator() (this=0xb71fe21c, info=...)
    at /home/maidsafe/Work/MyMaidSafe-SuperProject/src/pd/src/maidsafe/pd/vault/chunk_info_handler.cc:916
#14 0x088aee4f in std::for_each<std::_Rb_tree_iterator<std::pair<const maidsafe::detail::BoundedString<64u, 65u>, maidsafe::pd::vault::ChunkInfoHandler::ChunkInfo> >, maidsafe::pd::vault::ChunkInfoHandler::SerialiseChunkInfo()::<lambda(const value_type&)> >(std::_Rb_tree_iterator<std::pair<maidsafe::detail::BoundedString<64u, 65u> const, maidsafe::pd::vault::ChunkInfoHandler::ChunkInfo> >, std::_Rb_tree_iterator<std::pair<maidsafe::detail::BoundedString<64u, 65u> const, maidsafe::pd::vault::ChunkInfoHandler::ChunkInfo> >, struct {...}) (__first=..., __last=..., __f=...)
    at /usr/include/c++/4.6/bits/stl_algo.h:4379
#15 0x088ad44e in maidsafe::pd::vault::ChunkInfoHandler::SerialiseChunkInfo (this=0x91a6270)
    at /home/maidsafe/Work/MyMaidSafe-SuperProject/src/pd/src/maidsafe/pd/vault/chunk_info_handler.cc:929
#16 0x087f7999 in maidsafe::pd::vault::Node::GetSyncData (this=0x91703f4, response=0xb71fee04)
    at /home/maidsafe/Work/MyMaidSafe-SuperProject/src/pd/src/maidsafe/pd/vault/node.cc:944
chandraprakash commented 12 years ago

In the current revision this is line chunk_info_handler.cc:954

instance->set_chunk_version(entry.second.chunk_version.string());

account_name, transaction_id and chunk_version are uninitialised and the time stamps are neg inf (i.e. entry.second is uninitialised).

muecs commented 12 years ago

Fixed in maidsafe/MaidSafe-Pd@3960d2de7b4821f7ee2b1a6d6e3a5962841e7af7