Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Issue 11340054: Band-aid fix for test hangs: (Closed)

Created:
8 years, 1 month ago by Paweł Hajdan Jr.
Modified:
8 years, 1 month ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Visibility:
Public.

Description

Band-aid fix for test hangs: What happens is after I enabled tcmalloc's debugallocation in http://code.google.com/p/chromium/issues/detail?id=30715 cc_unittests started hanging in StackDumpSignalHandler, triggered by SIGSEGV triggered by: @0 0x00000000019c6c85 in tcmalloc::Abort () at third_party/tcmalloc/chromium/src/base/abort.cc:15 @1 0x00000000019b39c1 in LogPrintf (severity=-4, pat=0x32aeb18 "memory allocation/deallocation mismatch at %p: allocated with %s being deallocated with %s", ap=0x7fff52c379e8) at third_party/tcmalloc/chromium/src/base/logging.h:210 @2 0x00000000019b3a8b in RAW_LOG (lvl=-4, pat=0x32aeb18 "memory allocation/deallocation mismatch at %p: allocated with %s being deallocated with %s") at third_party/tcmalloc/chromium/src/base/logging.h:230 @3 0x00000000019c3fb1 in MallocBlock::CheckLocked (this=0x7fd18f143400, type=-21308287) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:461 @4 0x00000000019c3c42 in MallocBlock::CheckAndClear (this=0x7fd18f143400, type=-21308287) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:401 @5 0x00000000019c436a in MallocBlock::Deallocate (this=0x7fd18f143400, type=-21308287) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:557 @6 0x00000000019c1929 in DebugDeallocate (ptr=0x7fd18f143420, type=-21308287) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:998 @7 0x00000000028d1482 in tc_delete (p=0x7fd18f143420) at ./third_party/tcmalloc/chromium/src/debugallocation.cc:1232 @8 0x000000000097dc04 in cc::ResourceProvider::deleteResourceInternal (this=0x7fd191827da0, it=...) at cc/resource_provider.cc:242 @9 0x000000000097daaf in cc::ResourceProvider::deleteResource (this=0x7fd191827da0, id=1) at cc/resource_provider.cc:230 @10 0x00000000006f9824 in (anonymous namespace)::ResourceProviderTest_Basic_Test::TestBody (this=0x7fd18dc5abf0) at cc/resource_provider_unittest.cc:328 @11 0x00000000008ec801 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (object=0x7fd18dc5abf0, method=&virtual testing::Test::TestBody(), location=0x29463ab "the test body") at testing/gtest/src/gtest.cc:2071 @12 0x00000000008e9665 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x7fd18dc5abf0, method=&virtual testing::Test::TestBody(), location=0x29463ab "the test body") at testing/gtest/src/gtest.cc:2123 @13 0x00000000008dee0d in testing::Test::Run (this=0x7fd18dc5abf0) at testing/gtest/src/gtest.cc:2143 @14 0x00000000008df3ea in testing::TestInfo::Run (this=0x7fd191823020) at testing/gtest/src/gtest.cc:2319 @15 0x00000000008df8dc in testing::TestCase::Run (this=0x7fd19181f0d0) at testing/gtest/src/gtest.cc:2426 @16 0x00000000008e3eea in testing::internal::UnitTestImpl::RunAllTests (this=0x7fd19829dd60) at testing/gtest/src/gtest.cc:4249 The hang is triggered by calling backtrace() in the signal handler. The problem reported by tcmalloc is "memory allocation/deallocation mismatch at 0xa3af520: allocated with new [] being deallocated with delete". BUG=30715, 101155 TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=165067

Patch Set 1 #

Patch Set 2 : fixed release build #

Total comments: 1

Patch Set 3 : simpler #

Total comments: 1

Patch Set 4 : bug reference #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M base/process_util_posix.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Paweł Hajdan Jr.
8 years, 1 month ago (2012-10-30 23:04:44 UTC) #1
Scott Hess - ex-Googler
https://codereview.chromium.org/11340054/diff/1002/base/process_util_posix.cc File base/process_util_posix.cc (right): https://codereview.chromium.org/11340054/diff/1002/base/process_util_posix.cc#newcode158 base/process_util_posix.cc:158: #if defined(OS_MACOSX) I would prefer to have the PrintBacktrace() ...
8 years, 1 month ago (2012-10-30 23:47:59 UTC) #2
Paweł Hajdan Jr.
PTAL Now simply disabling troublesome code on non-Mac. I should have a fix (and re-enable ...
8 years, 1 month ago (2012-10-30 23:57:21 UTC) #3
Scott Hess - ex-Googler
lgtm https://codereview.chromium.org/11340054/diff/7001/base/process_util_posix.cc File base/process_util_posix.cc (right): https://codereview.chromium.org/11340054/diff/7001/base/process_util_posix.cc#newcode145 base/process_util_posix.cc:145: // TODO(phajdan.jr): Fix hangs caused by using malloc ...
8 years, 1 month ago (2012-10-30 23:59:55 UTC) #4
jar (doing other things)
Patch set 3 LGTM (especially since shess likes it!)
8 years, 1 month ago (2012-10-31 00:00:28 UTC) #5
Alexander Potapenko
On 2012/10/31 00:00:28, jar wrote: > Patch set 3 LGTM (especially since shess likes it!) ...
8 years, 1 month ago (2012-11-01 07:39:41 UTC) #6
Scott Hess - ex-Googler
On 2012/11/01 07:39:41, Alexander Potapenko wrote: > On 2012/10/31 00:00:28, jar wrote: > > Patch ...
8 years, 1 month ago (2012-11-01 16:58:43 UTC) #7
Paweł Hajdan Jr.
8 years, 1 month ago (2012-11-01 18:04:35 UTC) #8
So, some update for you (thank you for feedback):

1. This is not just for debugallocation. The signal handler is not async-signal
safe, and may hang even without debugallocation.

2. I have a fix locally, and I'm now working on getting it reviewed and
committed. Fun thing is that backtrace() itself can use malloc the first time
it's called. I've solved that by warming it up before enabling our signal
handler.

Powered by Google App Engine
This is Rietveld 408576698