|
|
Chromium Code Reviews|
Created:
4 years, 8 months ago by esprehn Modified:
4 years, 8 months ago CC:
blink-reviews, blink-reviews-wtf_chromium.org, chromium-reviews, kinuko+watch, Mikhail Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionWTF::ThreadSpecific should use base::ThreadLocalStorage.
Let's use the base abstraction to allocate the
TLS. It's way less code.
Committed: https://crrev.com/56641fdb889c6b5d27997465b622d7432c0ba0b8
Cr-Commit-Position: refs/heads/master@{#384650}
Patch Set 1 #Patch Set 2 : fix gn build. #Patch Set 3 : Add back the destructor. #Patch Set 4 : Check isShutdown(). #
Total comments: 1
Messages
Total messages: 33 (15 generated)
The CQ bit was checked by esprehn@chromium.org to run a CQ dry run
The CQ bit was unchecked by esprehn@chromium.org
The CQ bit was checked by esprehn@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1849023002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1849023002/1
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_chro...) android_chromium_gn_compile_rel on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_chro...) cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...) linux_blink_oilpan_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_blink_oil...) linux_chromium_clobber_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_compile_dbg_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by esprehn@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1849023002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1849023002/20001
The CQ bit was unchecked by esprehn@chromium.org
The CQ bit was checked by esprehn@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1849023002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1849023002/20001
Hmm, I'm not sure I understand this one. ThreadSpecific never destroys the object on purpose... but the leak detector now finds it. Why didn't the leak detector find it before? @@@STEP_LOG_LINE@HeapTest.Threading@=========================================... @@@STEP_LOG_LINE@HeapTest.Threading@==32514==ERROR: LeakSanitizer: detected memory leaks@@@ @@@STEP_LOG_LINE@HeapTest.Threading@@@@ @@@STEP_LOG_LINE@HeapTest.Threading@Direct leak of 80 byte(s) in 10 object(s) allocated from:@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #0 0x4da4bb in __interceptor_malloc (/tmp/runCVVxKR/out/Release/blink_heap_unittests+0x4da4bb)@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #1 0x505f3c in partitionAllocGenericFlags third_party/WebKit/Source/wtf/PartitionAlloc.h:736:20@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #2 0x505f3c in partitionAllocGeneric third_party/WebKit/Source/wtf/PartitionAlloc.h:763@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #3 0x505f3c in WTF::Partitions::fastMalloc(unsigned long, char const*) third_party/WebKit/Source/wtf/Partitions.h:122@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #4 0x505d4f in fastZeroedMalloc third_party/WebKit/Source/wtf/Partitions.h:126:24@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #5 0x505d4f in WTF::ThreadSpecific<blink::ThreadState*>::get() third_party/WebKit/Source/wtf/ThreadSpecific.h:76@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #6 0x943e1b in operator* third_party/WebKit/Source/wtf/ThreadSpecific.h:61:30@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #7 0x943e1b in blink::ThreadState::ThreadState() third_party/WebKit/Source/platform/heap/ThreadState.cpp:117@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #8 0x9471ce in blink::ThreadState::attach() third_party/WebKit/Source/platform/heap/ThreadState.cpp:265:30@@@ @@@STEP_LOG_LINE@HeapTest.Threading@ #9 0x63c8a1 in blink::ThreadedHeapTester::runThread() third_party/WebKit/Source/platform/heap/HeapTest.cpp:518:9@@@
The CQ bit was checked by esprehn@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1849023002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1849023002/40001
Description was changed from ========== WTF::ThreadSpecific should use base::ThreadLocalPointer. ========== to ========== WTF::ThreadSpecific should use base::ThreadLocalStorage. Let's use the base abstraction to allocate the TLS. It's way less code. ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...)
The CQ bit was checked by esprehn@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1849023002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1849023002/60001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
esprehn@chromium.org changed reviewers: + danakj@chromium.org, haraken@chromium.org, yutak@chromium.org
LGTM https://codereview.chromium.org/1849023002/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/wtf/ThreadSpecific.h (right): https://codereview.chromium.org/1849023002/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/wtf/ThreadSpecific.h:88: if (isShutdown()) I'm not sure if this check is needed though.
On 2016/04/01 at 12:28:35, haraken wrote: > LGTM > > https://codereview.chromium.org/1849023002/diff/60001/third_party/WebKit/Sour... > File third_party/WebKit/Source/wtf/ThreadSpecific.h (right): > > https://codereview.chromium.org/1849023002/diff/60001/third_party/WebKit/Sour... > third_party/WebKit/Source/wtf/ThreadSpecific.h:88: if (isShutdown()) > > I'm not sure if this check is needed though. It is. See patch #3 where every bot was red because they hit an assert in fastFree about the partition being initialized. ASSERT(root->initialized)
On 2016/04/01 at 15:44:06, esprehn wrote: > On 2016/04/01 at 12:28:35, haraken wrote: > > LGTM > > > > https://codereview.chromium.org/1849023002/diff/60001/third_party/WebKit/Sour... > > File third_party/WebKit/Source/wtf/ThreadSpecific.h (right): > > > > https://codereview.chromium.org/1849023002/diff/60001/third_party/WebKit/Sour... > > third_party/WebKit/Source/wtf/ThreadSpecific.h:88: if (isShutdown()) > > > > I'm not sure if this check is needed though. > > It is. See patch #3 where every bot was red because they hit an assert in fastFree about the partition being initialized. > > ASSERT(root->initialized) ex. https://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel... I think we need to check isShutdown() because the main thread will call shutdown before the native thread is destroyed. So the destroy() method on the ThreadSpecific ends up after the shutdown. And it's not safe to call into PA after shutdown.
DEPS LGTM
The CQ bit was checked by esprehn@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1849023002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1849023002/60001
Message was sent while issue was closed.
Committed patchset #4 (id:60001)
Message was sent while issue was closed.
Description was changed from ========== WTF::ThreadSpecific should use base::ThreadLocalStorage. Let's use the base abstraction to allocate the TLS. It's way less code. ========== to ========== WTF::ThreadSpecific should use base::ThreadLocalStorage. Let's use the base abstraction to allocate the TLS. It's way less code. Committed: https://crrev.com/56641fdb889c6b5d27997465b622d7432c0ba0b8 Cr-Commit-Position: refs/heads/master@{#384650} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/56641fdb889c6b5d27997465b622d7432c0ba0b8 Cr-Commit-Position: refs/heads/master@{#384650}
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in https://codereview.chromium.org/1856793002/ by esprehn@chromium.org. The reason for reverting is: May have caused a bunch of perf regressions: https://bugs.chromium.org/p/chromium/issues/detail?id=600271. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
