Assertion failes on map.insert()

Ingo
2011-12-20
2013-04-25
  • Ingo

    Ingo - 2011-12-20

    First, thanks for the great (huge :) vectors.

    But, for now, I also *need* a map. Unfortunately on insert() I get a nasty runtime exception when i try to insert into an empty map:

    sps_test: /home/ischramm/dev/pagerank/trunk/sps/test/../../dep/include/stxxl/bits/containers/btree/btree.h:470: std::pair<stxxl::btree::btree_iterator<stxxl::btree::btree<KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy> >, bool> stxxl::btree::btree<KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy>::insert(const stxxl::btree::btree<KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy>::value_type&) : Assertion `it != root_node_.end()' failed.

    I'm using STXXL 1.3.1 compiled with these flags:

    STXXL_ROOT       = $(HOME)/install/stxxl-1.3.1
    #MCSTL_ROOT      = $(HOME)/work/mcstl
    COMPILER_GCC     = g++ -std=c++0x
    #COMPILER_GCC    = g++-4.4 -std=c++0x
    #COMPILER_ICPC   = icpc
    #USE_BOOST       = yes
    #BOOST_ROOT      =
    USE_PARALLEL_MODE        = yes
    #USE_MACOSX      = no
    #USE_FREEBSD     = no

    Ubuntu 11.04, g++ 4.5.2

    My code does essentially nothing more than this:

    TestCmp c;
    stxxl::map<uint64_t, uint64_t, CmpT> map(c, 1024*1024, 1024*1024);
    map.insert( std::pair<uint64_t,uint64_t>(1,0) );

    Any help appreciated (fix or workaround) :)

     
  • Ingo

    Ingo - 2011-12-20

    Ohmygod! My comparator lacked a min_value() and adding it solved the problem for now.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks