|
|
Chromium Code Reviews
Descriptionbinding: Makes assertion of adjustAmountOfExternalAllocatedMemory more exact.
1) Makes sure that ABC::s_adjustAoEAM is initialized before its use.
2) Makes the assertion in adjustAoEAM thread-safe.
BUG=638069
Committed: https://crrev.com/1851a7c26bc46902c7f62de0bcabf774911596c0
Cr-Commit-Position: refs/heads/master@{#422396}
Patch Set 1 #Patch Set 2 : Uses ThreadSpecific. #Patch Set 3 : Detects a race. #Patch Set 4 : Synced. #Patch Set 5 : Synced. #Patch Set 6 : Give it a try a process-wide check. #Patch Set 7 : Synced. #Patch Set 8 : . #Patch Set 9 : . #Patch Set 10 : . #Patch Set 11 : . #Patch Set 12 : . #Patch Set 13 : Synced. #Patch Set 14 : . #Patch Set 15 : . #
Total comments: 8
Patch Set 16 : Synced. #Patch Set 17 : Factor it out to checkIfAAOEAMIsConsistent. #
Messages
Total messages: 99 (71 generated)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
yukishiino@chromium.org changed reviewers: + haraken@chromium.org
Could you review this CL? I don't see any problem about where we should adjust. Fixes two possible defeats, but I'm not sure if this really fixes the flakiness or not.
On 2016/09/14 13:35:22, Yuki wrote: > Could you review this CL? > > I don't see any problem about where we should adjust. > > Fixes two possible defeats, but I'm not sure if this really fixes the flakiness > or not. Ah, the problem is that |totalSize| is a per-process variable, right? I think it needs to be a thread-local variable.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Could you take another look?
LGTM
The CQ bit was unchecked by yukishiino@chromium.org
The CQ bit was checked by yukishiino@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
peria@chromium.org changed reviewers: + peria@chromium.org
I agree that this CL does (2) in the description, but I think it does not do (1). I also agree that this CL can fix the target issue, i.e. Cr does not fail with the CHECK(), but I wonder this CL just hides wrong behaviors. (and it does not count in the memory usage of non-main threads.) IIUC, the issue can happen in following situation; 1. ABC::aAOEAM(+8) in thread B, but be ignored with null s_aAOEAM. 2. V8initialize() in thread A 3. ABC::aAOEAM(-8) in thread B Can't we catch up how this situation happen with doing (1) in this CL's description?
The CQ bit was unchecked by yukishiino@chromium.org
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== binding: Makes assertion of adjustAmountOfExternalAllocatedMemory more exact. 1) Makes sure that ABC::s_adjustAoEAM is initialized. 2) Makes the assertion in adjustAoEAM thread-safe. BUG=638069 ========== to ========== binding: Makes assertion of adjustAmountOfExternalAllocatedMemory more exact. 1) Makes sure that ABC::s_adjustAoEAM is initialized before its use. 2) Makes the assertion in adjustAoEAM thread-safe. BUG=638069 ==========
I was lazy. Updated.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
I'm sorry for the late reply. although some tests still fail, code itself LGTM.
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...) chromeos_x86-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
There seems a case that an ArrayBuffer created in a thread is passed over to another thread, so we have to count the total size in a process. I've updated the CL and the approach changed again from per-thread-counting to process-wide-counting. Could you take another look?
https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h (right): https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:119: s_lastUsedAdjustAmountOfExternalAllocatedMemoryFunction); Sorry, what is this DCHECK checking?
https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h (right): https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:119: s_lastUsedAdjustAmountOfExternalAllocatedMemoryFunction); On 2016/09/30 14:12:51, haraken wrote: > > Sorry, what is this DCHECK checking? I was afraid of the following case. 1) Use ArrayBufferContents (allocate). 2) Change s_adjustAmountOfExternalAllocatedMemoryFunction (for the first time through V8Initializer). 3) Use ArrayBufferContents (deallocate). i.e. I wanted to make sure that ABC::initialize() was called before the first use of ABC.
https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h (right): https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:119: s_lastUsedAdjustAmountOfExternalAllocatedMemoryFunction); On 2016/09/30 14:16:11, Yuki wrote: > On 2016/09/30 14:12:51, haraken wrote: > > > > Sorry, what is this DCHECK checking? > > I was afraid of the following case. > > 1) Use ArrayBufferContents (allocate). > 2) Change s_adjustAmountOfExternalAllocatedMemoryFunction (for the first time > through V8Initializer). > 3) Use ArrayBufferContents (deallocate). > > i.e. I wanted to make sure that ABC::initialize() was called before the first > use of ABC. Isn't the DCHECK at line 112 enough to detect the case?
https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h (right): https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:119: s_lastUsedAdjustAmountOfExternalAllocatedMemoryFunction); On 2016/09/30 14:21:39, haraken wrote: > On 2016/09/30 14:16:11, Yuki wrote: > > On 2016/09/30 14:12:51, haraken wrote: > > > > > > Sorry, what is this DCHECK checking? > > > > I was afraid of the following case. > > > > 1) Use ArrayBufferContents (allocate). > > 2) Change s_adjustAmountOfExternalAllocatedMemoryFunction (for the first time > > through V8Initializer). > > 3) Use ArrayBufferContents (deallocate). > > > > i.e. I wanted to make sure that ABC::initialize() was called before the first > > use of ABC. > > Isn't the DCHECK at line 112 enough to detect the case? Not enough. s_adjust... is initialized to defaultAdjust... by default, and tests are using this default implementation. The problem here is that most of tests do not call ABC::initialize(), and it's not easy to make all the tests call ACB::initialize(), but we'd like to guarantee that, if the adjust function is going to be changed, it must be only once and before any use.
On 2016/09/30 14:27:26, Yuki wrote: > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h (right): > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:119: > s_lastUsedAdjustAmountOfExternalAllocatedMemoryFunction); > On 2016/09/30 14:21:39, haraken wrote: > > On 2016/09/30 14:16:11, Yuki wrote: > > > On 2016/09/30 14:12:51, haraken wrote: > > > > > > > > Sorry, what is this DCHECK checking? > > > > > > I was afraid of the following case. > > > > > > 1) Use ArrayBufferContents (allocate). > > > 2) Change s_adjustAmountOfExternalAllocatedMemoryFunction (for the first > time > > > through V8Initializer). > > > 3) Use ArrayBufferContents (deallocate). > > > > > > i.e. I wanted to make sure that ABC::initialize() was called before the > first > > > use of ABC. > > > > Isn't the DCHECK at line 112 enough to detect the case? > > Not enough. s_adjust... is initialized to defaultAdjust... by default, and > tests are using this default implementation. > > The problem here is that most of tests do not call ABC::initialize(), and it's > not easy to make all the tests call ACB::initialize(), Why is it so hard? Tests that need to use V8 need to call V8Initializer::initializeMainThread. And V8Initializer::initializeMainThread calls ABC::initialize().
On 2016/10/03 01:52:11, haraken wrote: > On 2016/09/30 14:27:26, Yuki wrote: > > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > > File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h (right): > > > > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > > third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:119: > > s_lastUsedAdjustAmountOfExternalAllocatedMemoryFunction); > > On 2016/09/30 14:21:39, haraken wrote: > > > On 2016/09/30 14:16:11, Yuki wrote: > > > > On 2016/09/30 14:12:51, haraken wrote: > > > > > > > > > > Sorry, what is this DCHECK checking? > > > > > > > > I was afraid of the following case. > > > > > > > > 1) Use ArrayBufferContents (allocate). > > > > 2) Change s_adjustAmountOfExternalAllocatedMemoryFunction (for the first > > time > > > > through V8Initializer). > > > > 3) Use ArrayBufferContents (deallocate). > > > > > > > > i.e. I wanted to make sure that ABC::initialize() was called before the > > first > > > > use of ABC. > > > > > > Isn't the DCHECK at line 112 enough to detect the case? > > > > Not enough. s_adjust... is initialized to defaultAdjust... by default, and > > tests are using this default implementation. > > > > The problem here is that most of tests do not call ABC::initialize(), and it's > > not easy to make all the tests call ACB::initialize(), > > Why is it so hard? > > Tests that need to use V8 need to call V8Initializer::initializeMainThread. And > V8Initializer::initializeMainThread calls ABC::initialize(). Tests under platform/ don't depend on V8Initializer. Tests under WTF/, too.
On 2016/10/03 05:09:41, Yuki wrote: > On 2016/10/03 01:52:11, haraken wrote: > > On 2016/09/30 14:27:26, Yuki wrote: > > > > > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > > > File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h > (right): > > > > > > > > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > > > third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:119: > > > s_lastUsedAdjustAmountOfExternalAllocatedMemoryFunction); > > > On 2016/09/30 14:21:39, haraken wrote: > > > > On 2016/09/30 14:16:11, Yuki wrote: > > > > > On 2016/09/30 14:12:51, haraken wrote: > > > > > > > > > > > > Sorry, what is this DCHECK checking? > > > > > > > > > > I was afraid of the following case. > > > > > > > > > > 1) Use ArrayBufferContents (allocate). > > > > > 2) Change s_adjustAmountOfExternalAllocatedMemoryFunction (for the first > > > time > > > > > through V8Initializer). > > > > > 3) Use ArrayBufferContents (deallocate). > > > > > > > > > > i.e. I wanted to make sure that ABC::initialize() was called before the > > > first > > > > > use of ABC. > > > > > > > > Isn't the DCHECK at line 112 enough to detect the case? > > > > > > Not enough. s_adjust... is initialized to defaultAdjust... by default, and > > > tests are using this default implementation. > > > > > > The problem here is that most of tests do not call ABC::initialize(), and > it's > > > not easy to make all the tests call ACB::initialize(), > > > > Why is it so hard? > > > > Tests that need to use V8 need to call V8Initializer::initializeMainThread. > And > > V8Initializer::initializeMainThread calls ABC::initialize(). > > Tests under platform/ don't depend on V8Initializer. Tests under WTF/, too. Are they using ABC? It sounds a bit strange that they don't initialize V8Initializer but use ABC.
https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h (right): https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:112: DCHECK(s_adjustAmountOfExternalAllocatedMemoryFunction); s_adjustAOEAMF is initialized with a non null function pointer, so I think this DCHECK can be removed. https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:113: #if ENABLE(ASSERT) If you work for all tests which use ABC without ABC::initialize(), this ENABLE(ASSERT) may be replaced with a DCHECK(false) in defaultAAOEAMF(), and I think it better to catch up how the unexpected first call happens.
On 2016/10/03 05:13:09, haraken wrote: > On 2016/10/03 05:09:41, Yuki wrote: > > On 2016/10/03 01:52:11, haraken wrote: > > > On 2016/09/30 14:27:26, Yuki wrote: > > > > > > > > > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > > > > File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h > > (right): > > > > > > > > > > > > > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > > > > third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:119: > > > > s_lastUsedAdjustAmountOfExternalAllocatedMemoryFunction); > > > > On 2016/09/30 14:21:39, haraken wrote: > > > > > On 2016/09/30 14:16:11, Yuki wrote: > > > > > > On 2016/09/30 14:12:51, haraken wrote: > > > > > > > > > > > > > > Sorry, what is this DCHECK checking? > > > > > > > > > > > > I was afraid of the following case. > > > > > > > > > > > > 1) Use ArrayBufferContents (allocate). > > > > > > 2) Change s_adjustAmountOfExternalAllocatedMemoryFunction (for the > first > > > > time > > > > > > through V8Initializer). > > > > > > 3) Use ArrayBufferContents (deallocate). > > > > > > > > > > > > i.e. I wanted to make sure that ABC::initialize() was called before > the > > > > first > > > > > > use of ABC. > > > > > > > > > > Isn't the DCHECK at line 112 enough to detect the case? > > > > > > > > Not enough. s_adjust... is initialized to defaultAdjust... by default, > and > > > > tests are using this default implementation. > > > > > > > > The problem here is that most of tests do not call ABC::initialize(), and > > it's > > > > not easy to make all the tests call ACB::initialize(), > > > > > > Why is it so hard? > > > > > > Tests that need to use V8 need to call V8Initializer::initializeMainThread. > > And > > > V8Initializer::initializeMainThread calls ABC::initialize(). > > > > Tests under platform/ don't depend on V8Initializer. Tests under WTF/, too. > > Are they using ABC? It sounds a bit strange that they don't initialize > V8Initializer but use ABC. Yes, platform/graphics/ is using. It's not strange. platform/ cannot depend on bindings/, so platform/ never initialize V8Initializer. platform/graphics/ is using ArrayBuffer as underlying buffer. No strange here.
https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h (right): https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:112: DCHECK(s_adjustAmountOfExternalAllocatedMemoryFunction); On 2016/10/03 05:43:49, peria wrote: > s_adjustAOEAMF is initialized with a non null function pointer, so I think this > DCHECK can be removed. You can do ABC::initialize(nullptr), so we cannot remove this. We can move the check to ABC::initialize, but it's safe to have the CHECK here because this always works even if we introduced ABC::reset(func), etc. https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:113: #if ENABLE(ASSERT) On 2016/10/03 05:43:49, peria wrote: > If you work for all tests which use ABC without ABC::initialize(), this > ENABLE(ASSERT) may be replaced with a DCHECK(false) in defaultAAOEAMF(), > and I think it better to catch up how the unexpected first call happens. That's true, but I don't want to do that. ;)
On 2016/10/03 05:49:56, Yuki wrote: > On 2016/10/03 05:13:09, haraken wrote: > > On 2016/10/03 05:09:41, Yuki wrote: > > > On 2016/10/03 01:52:11, haraken wrote: > > > > On 2016/09/30 14:27:26, Yuki wrote: > > > > > > > > > > > > > > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > > > > > File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h > > > (right): > > > > > > > > > > > > > > > > > > > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > > > > > third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:119: > > > > > s_lastUsedAdjustAmountOfExternalAllocatedMemoryFunction); > > > > > On 2016/09/30 14:21:39, haraken wrote: > > > > > > On 2016/09/30 14:16:11, Yuki wrote: > > > > > > > On 2016/09/30 14:12:51, haraken wrote: > > > > > > > > > > > > > > > > Sorry, what is this DCHECK checking? > > > > > > > > > > > > > > I was afraid of the following case. > > > > > > > > > > > > > > 1) Use ArrayBufferContents (allocate). > > > > > > > 2) Change s_adjustAmountOfExternalAllocatedMemoryFunction (for the > > first > > > > > time > > > > > > > through V8Initializer). > > > > > > > 3) Use ArrayBufferContents (deallocate). > > > > > > > > > > > > > > i.e. I wanted to make sure that ABC::initialize() was called before > > the > > > > > first > > > > > > > use of ABC. > > > > > > > > > > > > Isn't the DCHECK at line 112 enough to detect the case? > > > > > > > > > > Not enough. s_adjust... is initialized to defaultAdjust... by default, > > and > > > > > tests are using this default implementation. > > > > > > > > > > The problem here is that most of tests do not call ABC::initialize(), > and > > > it's > > > > > not easy to make all the tests call ACB::initialize(), > > > > > > > > Why is it so hard? > > > > > > > > Tests that need to use V8 need to call > V8Initializer::initializeMainThread. > > > And > > > > V8Initializer::initializeMainThread calls ABC::initialize(). > > > > > > Tests under platform/ don't depend on V8Initializer. Tests under WTF/, too. > > > > Are they using ABC? It sounds a bit strange that they don't initialize > > V8Initializer but use ABC. > > Yes, platform/graphics/ is using. It's not strange. platform/ cannot depend on > bindings/, so platform/ never initialize V8Initializer. platform/graphics/ is > using ArrayBuffer as underlying buffer. No strange here. Makes sense. However, the current DCHECKs look a bit too complicated. I'd prefer simply removing the DCHECK (because it's already guaranteed that WebKit::initialize is called at the very beginning of the renderer execution) or replace the DCHECK with DCHECK(WTF::isInitialized()) or something. In long term, a right solution would be to move core-independent binding things to platform/bindings/ and make platform/bindings/ register the AdjustExternalMemory function.
On 2016/10/03 05:53:26, Yuki wrote: > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > File third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h (right): > > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:112: > DCHECK(s_adjustAmountOfExternalAllocatedMemoryFunction); > On 2016/10/03 05:43:49, peria wrote: > > s_adjustAOEAMF is initialized with a non null function pointer, so I think > this > > DCHECK can be removed. > > You can do ABC::initialize(nullptr), so we cannot remove this. > We can move the check to ABC::initialize, but it's safe to have the CHECK here > because this always works even if we introduced ABC::reset(func), etc. got it. thanks. > https://codereview.chromium.org/2343643003/diff/280001/third_party/WebKit/Sou... > third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h:113: #if > ENABLE(ASSERT) > On 2016/10/03 05:43:49, peria wrote: > > If you work for all tests which use ABC without ABC::initialize(), this > > ENABLE(ASSERT) may be replaced with a DCHECK(false) in defaultAAOEAMF(), > > and I think it better to catch up how the unexpected first call happens. > > That's true, but I don't want to do that. ;) +1 non-owner lgtm
The CQ bit was checked by yukishiino@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/10/03 06:04:34, haraken wrote: > > Yes, platform/graphics/ is using. It's not strange. platform/ cannot depend > on > > bindings/, so platform/ never initialize V8Initializer. platform/graphics/ is > > using ArrayBuffer as underlying buffer. No strange here. > > Makes sense. > > However, the current DCHECKs look a bit too complicated. I'd prefer simply > removing the DCHECK (because it's already guaranteed that WebKit::initialize is > called at the very beginning of the renderer execution) or replace the DCHECK > with DCHECK(WTF::isInitialized()) or something. > > In long term, a right solution would be to move core-independent binding things > to platform/bindings/ and make platform/bindings/ register the > AdjustExternalMemory function. Factored the check out to checkIfAAOEAMIsConsistent(). I'm on the fence to remove the DCHECKs. If everything is so trivial, we wouldn't have had this issue at all.
On 2016/10/03 07:37:37, Yuki wrote: > On 2016/10/03 06:04:34, haraken wrote: > > > Yes, platform/graphics/ is using. It's not strange. platform/ cannot > depend > > on > > > bindings/, so platform/ never initialize V8Initializer. platform/graphics/ > is > > > using ArrayBuffer as underlying buffer. No strange here. > > > > Makes sense. > > > > However, the current DCHECKs look a bit too complicated. I'd prefer simply > > removing the DCHECK (because it's already guaranteed that WebKit::initialize > is > > called at the very beginning of the renderer execution) or replace the DCHECK > > with DCHECK(WTF::isInitialized()) or something. > > > > In long term, a right solution would be to move core-independent binding > things > > to platform/bindings/ and make platform/bindings/ register the > > AdjustExternalMemory function. > > Factored the check out to checkIfAAOEAMIsConsistent(). > > I'm on the fence to remove the DCHECKs. If everything is so trivial, we > wouldn't have had this issue at all. LGTM
The CQ bit was unchecked by yukishiino@chromium.org
The CQ bit was checked by yukishiino@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from peria@chromium.org Link to the patchset: https://codereview.chromium.org/2343643003/#ps320001 (title: "Factor it out to checkIfAAOEAMIsConsistent.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by yukishiino@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== binding: Makes assertion of adjustAmountOfExternalAllocatedMemory more exact. 1) Makes sure that ABC::s_adjustAoEAM is initialized before its use. 2) Makes the assertion in adjustAoEAM thread-safe. BUG=638069 ========== to ========== binding: Makes assertion of adjustAmountOfExternalAllocatedMemory more exact. 1) Makes sure that ABC::s_adjustAoEAM is initialized before its use. 2) Makes the assertion in adjustAoEAM thread-safe. BUG=638069 ==========
Message was sent while issue was closed.
Committed patchset #17 (id:320001)
Message was sent while issue was closed.
Description was changed from ========== binding: Makes assertion of adjustAmountOfExternalAllocatedMemory more exact. 1) Makes sure that ABC::s_adjustAoEAM is initialized before its use. 2) Makes the assertion in adjustAoEAM thread-safe. BUG=638069 ========== to ========== binding: Makes assertion of adjustAmountOfExternalAllocatedMemory more exact. 1) Makes sure that ABC::s_adjustAoEAM is initialized before its use. 2) Makes the assertion in adjustAoEAM thread-safe. BUG=638069 Committed: https://crrev.com/1851a7c26bc46902c7f62de0bcabf774911596c0 Cr-Commit-Position: refs/heads/master@{#422396} ==========
Message was sent while issue was closed.
Patchset 17 (id:??) landed as https://crrev.com/1851a7c26bc46902c7f62de0bcabf774911596c0 Cr-Commit-Position: refs/heads/master@{#422396} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
