This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/17664] Crash in std::map when using _GLIBCXX_DEBUG with multithreading
- From: "lothar at xcerla dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Sep 2004 00:52:10 -0000
- Subject: [Bug libstdc++/17664] Crash in std::map when using _GLIBCXX_DEBUG with multithreading
- References: <20040924220544.17664.lothar@xcerla.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From lothar at xcerla dot com 2004-09-25 00:52 -------
I did some reading in the source and the culprit is that _M_attach,
_M_detach, ... are not thread safe. as iter++ creates a temporary iterator
(that has to attach and detach) and they access the (shared) map, it failes in
the multithreaded case. As these calls are ONLY executed when _GLIBCXX_DEBUG
is defined, the program only fails there.
I think this clearly IS a bug and should be solved by protecting the
_M_attach, _M_detach, ... methods with a mutex.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |VERIFIED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17664