Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crashed when running unittest #428

Closed
alk opened this issue Aug 23, 2015 · 5 comments
Closed

crashed when running unittest #428

alk opened this issue Aug 23, 2015 · 5 comments

Comments

@alk
Copy link
Contributor

alk commented Aug 23, 2015

Originally reported on Google Code with ID 425

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)

Reported by LayzerAr on 2012-04-20 03:15:01

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

I just converted the project to VS2010 format and did not change any default project
setting.

Reported by LayzerAr on 2012-04-20 03:18:14

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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.

Reported by chappedm on 2012-05-03 15:05:13

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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

Reported by ahaslam@iostack.com on 2012-07-01 23:17:50

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

Reported by chappedm on 2012-12-23 15:18:15

  • Status changed: Accepted

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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.

Reported by chappedm on 2013-03-11 01:36:46

  • Status changed: Fixed

@alk alk closed this as completed Aug 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant