stellar2012wxg / gperftools

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

Deadlock on startup because of getenv() #655

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.2.Run VS2010 app with statically linked gperftools 2.2.1

What is the expected output? What do you see instead?
Deadlock at startup

What version of the product are you using? On what operating system?
gperftools 2.2.1 on Windows 7

Please provide any additional information below.
EnvToBool("TCMALLOC_AGGRESSIVE_DECOMMIT", false)
macros from function 
InitStaticVars()
causes deadlock because it uses getenv() instead of TCMallocGetenvSafe().

Original issue reported on code.google.com by zndmi...@gmail.com on 22 Oct 2014 at 11:55

GoogleCodeExporter commented 9 years ago
Blocking bug, should be fixed in the official repository ASAP.
Replaced it with that, works just fine:
const char *envval = TCMallocGetenvSafe("TCMALLOC_AGGRESSIVE_DECOMMIT");
pageheap_->SetAggressiveDecommit( envval && strcmp(envval, "0") != 0 );

Original comment by iamjo...@gmail.com on 25 Oct 2014 at 11:49

GoogleCodeExporter commented 9 years ago
merged a fix. Thanks.

Original comment by alkondratenko on 3 Nov 2014 at 4:43