qchbai / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

crashed when running unittest #425

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The two unittests tcmalloc_minimal_unittest-static and 
tcmalloc_minimal_unittest crashed when I'm running it in release mode. Dedug 
mode is OK.

tcmalloc_minimal_unittest:
console output:
  Testing empty allocation
  Testing STL use
  Sanity-testing all the memory allocation functions
  Check failed: g_NewHook_calls > 0
crashed code line: tcmalloc_unittest.cc::1069 VerifyDeleteHookWasCalled();

tcmalloc_minimal_unittest-static:
console output:
  Testing empty allocation
  Testing STL use
  Sanity-testing all the memory allocation functions
  Check failed: g_NewHook_calls > 0
crashed code line: crtexe.c::555 mainret = main(argc, argv, envp);

additional information:
gperftools: version 2.0
OS: Windows XP SP3
Compiler: Visaul Studio 2010 Ultimate (version 10.0.30319.1)

Original issue reported on code.google.com by Layze...@gmail.com on 20 Apr 2012 at 3:15

GoogleCodeExporter commented 9 years ago
I just converted the project to VS2010 format and did not change any default 
project setting.

Original comment by Layze...@gmail.com on 20 Apr 2012 at 3:18

GoogleCodeExporter commented 9 years ago
There seems to be a number of issues with gperftools showing up on windows 
running VS2010. Unfortunately, the community of users running windows are 
fairly reluctant to participate in patch work and I do not have any experience 
with windows based software development. So unless someone in the windows 
community is compelled to contribute back to the project this is likely to stay 
broken for awhile.

Original comment by chapp...@gmail.com on 3 May 2012 at 3:05

GoogleCodeExporter commented 9 years ago
The VS2010 compiler optimises the greater than zero test out - fix the issue by 
changing line 728 of tcmalloc_unittest.cc like so:

From 

  static int g_##hook_type##_calls = 0;                        \

to

  static volatile int g_##hook_type##_calls = 0;                        \

Regards

Andrew Haslam

Original comment by ahas...@iostack.com on 1 Jul 2012 at 11:17

GoogleCodeExporter commented 9 years ago

Original comment by chapp...@gmail.com on 23 Dec 2012 at 3:18

GoogleCodeExporter commented 9 years ago
r198 | chappedm@gmail.com | 2013-03-10 21:35:37 -0400 (Sun, 10 Mar 2013) | 5 
lines

issue-425: Fixed tcmalloc unittest crashes for windows builds

Missing use of volatile was causing vs2010 to perform unwanted
optimization resulting in the crash. See issue for more details.

Original comment by chapp...@gmail.com on 11 Mar 2013 at 1:36