New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 644572 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug

Blocked on:
issue 581997
issue 641643

Blocking:
issue 619264



Sign in to add a comment

Pixel unpack buffer bindings in WebGL code cause unrelated TexImage2D calls to error

Project Member Reported by kainino@chromium.org, Sep 7 2016

Issue description

Version: 55.0.2853.0 at 66f753c
OS: Ubuntu 16.04, NVIDIA

What steps will reproduce the problem?
(1) Use a debug build (this works in release as well, but much less frequently)
(2) Run expando-loss-2, getextension-while-pbo-bound-stability (new), or conformance2/rendering/canvas-resizing-with-pbo-bound (attached).

What is the expected output?

No crash.

What do you see instead?

Failed TexImage2D calls (because a pbo is still bound but it should have been saved, cleared, and later restored).
 
expando-loss-2-crash.txt
2.0 KB View Download
canvas-resizing-with-pbo-bound-crash.txt
3.8 KB View Download
canvas-resizing-with-pbo-bound.html
4.2 KB View Download
Cc: qiankun....@intel.com

Comment 2 by kbr@chromium.org, Sep 7 2016

Blockedon: 641643
Cc: zmo@chromium.org sunn...@chromium.org vmi...@chromium.org
This is related to the incomplete initialization of virtual GL contexts in Chrome as discussed in person with a few folks. Qiankun's https://codereview.chromium.org/2302323002/ attempts to fix this but it's not clear that would be the best place to put this initialization.

It looks like a three-phase initialization (allocate the virtual GL context, initialize the command decoder, and make the virtual GL context current again) is undesirable.

The problematic code is in https://cs.chromium.org/chromium/src/gpu/ipc/service/gpu_command_buffer_stub.cc?q=gpu_command_buffer_stub.cc&sq=package:chromium&l=556 . Note that the GLContextVirtual's initialization is always short-circuited because the command decoder isn't initialized yet.

Cc: siev...@chromium.org
sievers@ may be most familiar with this original code.

My initial thought is that it is correct to initialize the state at decoder initialization time.  Here's the rationale:

1) Until the decoder is initialized, the virtual context is unusable.  The first MakeVirtuallyCurrent should only make the real GL context current, but not set any state.  

2) Next the decoder is initialized, which should set all initial GL state.

3) Subsequent runs of MakeVirtuallyCurrent deal with both making the real GL context current, and calling into the decoder to restore it's state.

Comment 4 by kbr@chromium.org, Sep 7 2016

I hadn't realized that in GLES2DecoderImpl::Initialize there is this comment:

// Set all the default state because some GL drivers get it wrong.

This does imply that resetting just this particular piece of state is the right thing to do, though perhaps there's a more principled way of doing it. It's unfortunate that the allocation of the black textures in the TextureManager during the early call to ContextGroup::Initialize() is what's breaking, when later on the ContextState would be used to zero out all of this state anyway.

Comment 5 by zmo@chromium.org, Sep 7 2016

Do we still need black textures in ES3, where the unpack buffer is introduced? If not, we can simply make it conditional to ES2.

Comment 6 by kbr@chromium.org, Sep 7 2016

Good point - but if there's even one ES 3.0 driver out there which doesn't correctly handle incomplete textures, this code path would have to be enabled via a driver bug workaround. So at a minimum this has to work.

Comment 7 by kbr@chromium.org, Sep 8 2016

Blocking: 619264
A suppression is needed on Linux for the new WebglConformance_conformance2_misc_getextension_while_pbo_bound_stability test. It's flaking on the linux_optional_gpu_test_rel tryserver per https://bugs.chromium.org/p/chromium/issues/detail?id=619264#c56 .

Project Member

Comment 8 by bugdroid1@chromium.org, Sep 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4506eb54b0c0165ec11eaec9e5143d5eaa612fe1

commit 4506eb54b0c0165ec11eaec9e5143d5eaa612fe1
Author: kbr <kbr@chromium.org>
Date: Thu Sep 08 04:10:27 2016

Skip getextension-while-pbo-bound-stability on Linux.

There are known bugs affecting this test and it's failing
intermittently on linux_optional_gpu_tests_rel.

BUG= 644572 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=zmo@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2320033002
Cr-Commit-Position: refs/heads/master@{#417188}

[modify] https://crrev.com/4506eb54b0c0165ec11eaec9e5143d5eaa612fe1/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py

Project Member

Comment 9 by bugdroid1@chromium.org, Sep 8 2016

Labels: merge-merged-2854
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4506eb54b0c0165ec11eaec9e5143d5eaa612fe1

commit 4506eb54b0c0165ec11eaec9e5143d5eaa612fe1
Author: kbr <kbr@chromium.org>
Date: Thu Sep 08 04:10:27 2016

Skip getextension-while-pbo-bound-stability on Linux.

There are known bugs affecting this test and it's failing
intermittently on linux_optional_gpu_tests_rel.

BUG= 644572 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=zmo@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2320033002
Cr-Commit-Position: refs/heads/master@{#417188}

[modify] https://crrev.com/4506eb54b0c0165ec11eaec9e5143d5eaa612fe1/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py

Project Member

Comment 10 by bugdroid1@chromium.org, Sep 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655

commit 17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655
Author: qiankun.miao <qiankun.miao@intel.com>
Date: Fri Sep 09 20:14:05 2016

Reset PIXEL_UNPACK_BUFFER at texture manager initialization time

Otherwise, there will be some weird GL errors on some GL drivers.

BUG= 641643 ,  644572 
TEST=conformance2/misc/getextension-while-pbo-bound-stability.html
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2302323002
Cr-Commit-Position: refs/heads/master@{#417685}

[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/gpu/command_buffer/service/test_helper.cc
[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/gpu/command_buffer/service/test_helper.h
[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/gpu/command_buffer/service/texture_manager.cc
[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/gpu/command_buffer/service/texture_manager_unittest.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Sep 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655

commit 17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655
Author: qiankun.miao <qiankun.miao@intel.com>
Date: Fri Sep 09 20:14:05 2016

Reset PIXEL_UNPACK_BUFFER at texture manager initialization time

Otherwise, there will be some weird GL errors on some GL drivers.

BUG= 641643 ,  644572 
TEST=conformance2/misc/getextension-while-pbo-bound-stability.html
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2302323002
Cr-Commit-Position: refs/heads/master@{#417685}

[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/gpu/command_buffer/service/test_helper.cc
[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/gpu/command_buffer/service/test_helper.h
[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/gpu/command_buffer/service/texture_manager.cc
[modify] https://crrev.com/17ad0f1ca0367fbb6d28cd9ed3d4d60a44e0e655/gpu/command_buffer/service/texture_manager_unittest.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Sep 10 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2c847da844d0f3f802069754b840bc36c3366c87

commit 2c847da844d0f3f802069754b840bc36c3366c87
Author: kainino <kainino@chromium.org>
Date: Sat Sep 10 03:33:05 2016

Save/restore PBO bindings in DrawingBuffer

DrawingBuffer::prepareTextureMailboxInternal

This prevents TexImage2D from being called internally with a
leaked pixel unpack buffer object bound.

BUG= 644572 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2329523002
Cr-Commit-Position: refs/heads/master@{#417815}

[modify] https://crrev.com/2c847da844d0f3f802069754b840bc36c3366c87/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/2c847da844d0f3f802069754b840bc36c3366c87/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
[modify] https://crrev.com/2c847da844d0f3f802069754b840bc36c3366c87/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h

Status: Fixed (was: Started)

Sign in to add a comment