https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63456

            Bug ID: 63456
           Summary: unordered_map incorrectly frees _M_single_bucket.
                    Patch Included
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ylow at graphlab dot com

I am sorry I do not have a simple reproduction for this failure. It cropped up
in the middle of a rather large project. However, I traced it to this function
which can't possibly be right:

_M_uses_single_bucket(__bkts) does not use the value of __bkts but only tests
the value of _M_buckets. Fixing it resolves my issue.

patch below:

--- a/hashtable.h    2014-10-03 21:10:56.732842012 -0700
+++ b/hashtable.h    2014-10-03 21:23:45.924860775 -0700
@@ -326,7 +326,7 @@

       bool
       _M_uses_single_bucket(__bucket_type* __bkts) const
-      { return __builtin_expect(_M_buckets == &_M_single_bucket, false); }
+      { return __builtin_expect(__bkts == &_M_single_bucket, false); }

       bool
       _M_uses_single_bucket() const

Reply via email to