An application I am building uses std::multimap and it has resulted in a Seg Fault. Tired changing the key between long long and std::string but the bug appeared with both. It is 100% reproducible in my test. The output of gdb backtrace is given below. Reproducible: Always Steps to Reproduce: 1. 2. 3. Actual Results: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 81926 (LWP 27561)] 0x080572ad in std::_Rb_tree_rotate_left(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&) () (gdb) where #0 0x080572ad in std::_Rb_tree_rotate_left(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&) () #1 0x0805713d in std::_Rb_tree_rebalance(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&) () #2 0x4003b5b4 in std::_Rb_tree<long long, std::pair<long long const, Constants::eType>, std::_Select1st<std::pair<long long const, Constants::eType> >, std::less<long long>, std::allocator<std::pair<long long const, Constants::eType> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<long long const, Constants::eType> const&) () from /home/mel/Projects/daytrader/src/.libs/libdaytrading.so.0 #3 0x4003b024 in Rule::InsertStateToHx(long long, Constants::eType) () from /home/mel/Projects/daytrader/src/.libs/libdaytrading.so.0 #4 0x4003d51d in HIRule::SetNewHighClosing(pt::compref<Datum> const&) () from /home/mel/Projects/daytrader/src/.libs/libdaytrading.so.0 #5 0x4003edf7 in HIRule::UpdateRule(pt::compref<Datum> const&) () from /home/mel/Projects/daytrader/src/.libs/libdaytrading.so.0 #6 0x4005d17d in TimeSeriesToRuleAssociation::DoHistoricalAnalysis(long long, long long) () from /home/mel/Projects/daytrader/src/.libs/libdaytrading.so.0 #7 0x4003990c in HistoricalAnalysis::run() () from /home/mel/Projects/daytrader/src/.libs/libdaytrading.so.0 #8 0x400ec586 in ZThread::ThreadImpl::dispatch(ZThread::ThreadImpl*, ZThread::ThreadImpl*, ZThread::CountedPtr<ZThread::Runnable> const&) () from /usr/lib/libZThread-2.2.so.8 #9 0x400ed5c4 in ZThread::Launcher::run() () from /usr/lib/libZThread-2.2.so.8 #10 0x400ee742 in _dispatch () from /usr/lib/libZThread-2.2.so.8 #11 0x40144100 in pthread_start_thread () from /lib/libpthread.so.0 #12 0x40144202 in pthread_start_thread_event () from /lib/libpthread.so.0 (gdb) Portage 2.0.48 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4) ================================================================= System uname: 2.4.20 i686 AMD Athlon(tm) MP 2200+ GENTOO_MIRRORS="ftp://sunsite.ualberta.ca/pub/unix/Linux/gentoo/ rsync://planetmirror.com/ gentoo/ rsync://linux.rz.ruhr-uni-bochum.de/gentoo/ ftp://mirror.iawnet.sandia.gov/pub/gentoo/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /usr/kde/3/share/config /etc/modules.d /etc/init.d /etc/pam.d /etc/cups /etc/X11 /etc/X11/rstart /etc/X11/app-defaults /etc/X11/xinit /etc/X11/fs /etc/env.d" PORTDIR="/usr/portage" DISTDIR="/usr/portage/distfiles" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR_OVERLAY="" USE="x86 oss 3dnow apm avi crypt cups encode gif jpeg gnome libg++ mikmod mmx mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib gtkhtml gdbm berkdb slang readline arts tetex bonobo svga guile sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis qt kde motif opengl mozilla cdr X gtk alsa tcltk postgres java" COMPILER="gcc3" CHOST="i686-pc-linux-gnu" CFLAGS="-march=athlon-mp -O3 -pipe" CXXFLAGS="-march=athlon-mp -O3 -pipe" ACCEPT_KEYWORDS="x86" MAKEOPTS="-j4" AUTOCLEAN="yes" SYNC="rsync://rsync.gentoo.org/gentoo-portage" FEATURES="sandbox ccache buildpkg"
I am not entirely confident that this is a bug in std::multimap. It may have been related to its use in referring to the same object in multiple threads. I suggest this bug be resolved INVALID.