Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11650

Unittests freeing unallocated thread specific pointer in debug mode

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.4
    • Affects Version/s: None
    • Component/s: Build
    • None
    • Fully Compatible
    • OS X

      I don't know what's causing this, but here's the output I get:

      $ build/darwin/dd/mongo/hash_test
      2013-11-09T11:32:24.062-0500 going to run suite: GeoHash
      2013-11-09T11:32:24.063-0500 	 going to run test: MakeZeroHash
      2013-11-09T11:32:24.063-0500 	 going to run test: MakeRandomValidHashes
      2013-11-09T11:32:24.063-0500 	 going to run test: MakeTooLongHash
      2013-11-09T11:32:24.063-0500 	 going to run test: MakeOddHash
      2013-11-09T11:32:24.063-0500 	 DONE running tests
      2013-11-09T11:32:24.063-0500 **************************************************
      2013-11-09T11:32:24.063-0500 GeoHash                        | tests:    4 | fails:    0 | assert calls:          2 | time secs:  0.000
      2013-11-09T11:32:24.063-0500 TOTALS                         | tests:    4 | fails:    0 | assert calls:          2 | time secs:  0.000
      2013-11-09T11:32:24.063-0500 SUCCESS - All tests in all suites passed
      hash_test(75340) malloc: *** error for object 0x1010843e0: pointer being freed was not allocated
      *** set a breakpoint in malloc_error_break to debug
      Abort trap: 6
      

      Stack trace:

      $ gdb build/darwin/dd/mongo/hash_test
      GNU gdb 6.3.50-20050815 (Apple version gdb-1822) (Sun Aug  5 03:00:42 UTC 2012)
      Copyright 2004 Free Software Foundation, Inc.
      GDB is free software, covered by the GNU General Public License, and you are
      welcome to change it and/or distribute copies of it under certain conditions.
      Type "show copying" to see the conditions.
      There is absolutely no warranty for GDB.  Type "show warranty" for details.
      This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done
      
      (gdb) r
      Starting program: <path>/build/darwin/dd/mongo/hash_test
      Reading symbols for shared libraries ++.............................. done
      2013-11-09T11:33:20.667-0500 going to run suite: GeoHash
      2013-11-09T11:33:20.668-0500 	 going to run test: MakeZeroHash
      2013-11-09T11:33:20.668-0500 	 going to run test: MakeRandomValidHashes
      2013-11-09T11:33:20.668-0500 	 going to run test: MakeTooLongHash
      2013-11-09T11:33:20.668-0500 	 going to run test: MakeOddHash
      2013-11-09T11:33:20.668-0500 	 DONE running tests
      2013-11-09T11:33:20.669-0500 **************************************************
      2013-11-09T11:33:20.669-0500 GeoHash                        | tests:    4 | fails:    0 | assert calls:          2 | time secs:  0.000
      2013-11-09T11:33:20.669-0500 TOTALS                         | tests:    4 | fails:    0 | assert calls:          2 | time secs:  0.000
      2013-11-09T11:33:20.669-0500 SUCCESS - All tests in all suites passed
      hash_test(75371) malloc: *** error for object 0x1010843e0: pointer being freed was not allocated
      *** set a breakpoint in malloc_error_break to debug
      
      Program received signal SIGABRT, Aborted.
      0x00007fff997dbd46 in __kill ()
      (gdb) bt
      #0  0x00007fff997dbd46 in __kill ()
      #1  0x00007fff8e42cf83 in abort ()
      #2  0x00007fff8e400989 in free ()
      #3  0x00000001000b4c1a in boost::thread_specific_ptr<std::string>::delete_data::operator() (this=0x100605640, data=0x1010843e0) at tss.hpp:42
      #4  0x0000000100130ecd in boost::detail::set_tss_data (key=0x10020d6f0, func=@0x7fff5fbff908, tss_data=0x0, cleanup_existing=true) at thread.cpp:586
      #5  0x00000001000b5008 in boost::thread_specific_ptr<std::string>::~thread_specific_ptr (this=0x10020d6f0) at tss.hpp:79
      #6  0x00000001000b485b in __tcf_1 (unnamed_arg=0x0) at thread_name.cpp:26
      #7  0x00007fff8e42e521 in __cxa_finalize ()
      #8  0x00007fff8e43068b in exit ()
      #9  0x000000010000121b in start ()
      (gdb)
      

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            sverch Shaun Verch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: