| Summary: | i965: segfault in prepare_depthbuffer when switching to full screen with virtualbox | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Alon Levy <alevy> |
| Component: | mesa | Assignee: | Adam Jackson <ajax> |
| Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 16 | CC: | ajax, dblechte, marco |
| Target Milestone: | --- | Keywords: | Patch, Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | [cat:crash] | ||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-02-13 07:56:25 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Alon Levy
2011-09-05 12:27:45 UTC
that patch is not enough since srb->region == NULL too, so now trying this patch:
commit 426dc8fe8f45082841773382e24dc42a2d2dc22d
Author: Alon Levy <alevy>
Date: Mon Sep 5 14:28:14 2011 +0300
i965: prepare_depthbuffer: fix segfault, rhbz#735794
Also fixes a segfault immediatelly after in the same case, i.e.
srb->region is also NULL in the run of virtualbox described in
the bug report in the subject.
Signed-off-by: Alon Levy <alevy>
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index f7e6e7c..479cf82 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -204,11 +204,11 @@ static void prepare_depthbuffer(struct brw_context *brw)
struct intel_renderbuffer *drb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
struct intel_renderbuffer *srb = intel_get_renderbuffer(fb, BUFFER_STENCIL);
- if (drb)
+ if (drb && drb->region)
brw_add_validated_bo(brw, drb->region->buffer);
if (drb && drb->hiz_region)
brw_add_validated_bo(brw, drb->hiz_region->buffer);
- if (srb)
+ if (srb && srb->region)
brw_add_validated_bo(brw, srb->region->buffer);
}
That just makes it fail again later, at intel_renderbuffer_tile_offsets (gdb) bt #0 intel_renderbuffer_tile_offsets (irb=0x7f98ceb39ec0, tile_x=0x7f98dddcc898, tile_y=0x7f98dddcc89c) at intel_fbo.c:659 #1 0x00007f98dcb48dca in brw_update_renderbuffer_surface (unit=0, rb=0x7f98ceb39ec0, brw=0x7f98cc4901e 0) at brw_wm_surface_state.c:480 #2 upload_wm_surfaces (brw=0x7f98cc4901e0) at brw_wm_surface_state.c:588 #3 0x00007f98dcb32729 in brw_upload_state (brw=0x7f98cc4901e0) at brw_state_upload.c:553 #4 0x00007f98dcb20930 in brw_try_draw_prims (max_index=<optimized out>, min_index=<optimized out>, ib= 0x0, nr_prims=1, prim=0x7f98cc4ebaec, arrays=0x7f98cc4ed4d0, ctx=0x7f98cc4901e0) at brw_draw.c:370 #5 brw_draw_prims (ctx=0x7f98cc4901e0, arrays=0x7f98cc4ed4d0, prim=0x7f98cc4ebaec, nr_prims=1, ib=0x0, index_bounds_valid=<optimized out>, min_index=0, max_index=15) at brw_draw.c:431 #6 0x00007f98dcc11e28 in vbo_exec_vtx_flush (exec=0x7f98cc4eb800, keepUnmapped=1 '\001') at vbo/vbo_ex ec_draw.c:390 #7 0x00007f98dcc0b34c in vbo_exec_FlushVertices_internal (exec=0x7f98cc4eb800, unmap=<optimized out>) at vbo/vbo_exec_api.c:545 #8 0x00007f98dcc0fcbc in vbo_exec_FlushVertices (ctx=0x7f98cc4901e0, flags=<optimized out>) at vbo/vbo _exec_api.c:996 #9 0x00007f98dcbe685e in _mesa_BindTexture (target=34037, texName=622) at main/texobj.c:1102 #10 0x00007f98ddb09c6a in crUnpack () from /usr/lib/virtualbox/VBoxSharedCrOpenGL.so So I think the right approach would be to make intel_renderbuffer return NULL when irb->region == NULL. I'll try that next. Alon Tried something else, namely: (this patch is for the mesa package, not upstream - upstream broke a line in to to preserve max columns, so it didn't apply to mesa)
From fd46e2c7bee1d0c30a66fdee37f0c7d192322481 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy>
Date: Mon, 5 Sep 2011 16:38:43 +0300
Subject: [PATCH] i965: prepare_depthbuffer: don't update NULL region'ed
surface, rhbz#735794
---
src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 89fea9c..8cc1e91 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -439,6 +439,9 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
uint32_t tile_x, tile_y;
uint32_t format = 0;
+ if (irb->region == NULL)
+ return;
+
surf = brw_state_batch(brw, 6 * 4, 32, &brw->wm.surf_offset[unit]);
switch (irb->Base.Format) {
--
1.7.6.1
And then it failed a bit later at:
(gdb) up
#1 0x00007ffb9f86a729 in brw_upload_state (brw=0x7ffba44901e0) at brw_state_upl
oad.c:553
(gdb) down
#0 emit_depthbuffer (brw=0x7ffba44901e0) at brw_misc_state.c:318
(gdb) bt
#0 emit_depthbuffer (brw=0x7ffba44901e0) at brw_misc_state.c:318
#1 0x00007ffb9f86a729 in brw_upload_state (brw=0x7ffba44901e0) at brw_state_upl
oad.c:553
#2 0x00007ffb9f858930 in brw_try_draw_prims (max_index=<optimized out>, min_ind
ex=<optimized out>, ib=0x0, nr_prims=1, prim=0x7ffba44ebaec, arrays=0x7ffba44ed4
d0, ctx=0x7ffba44901e0) at brw_draw.c:370
#3 brw_draw_prims (ctx=0x7ffba44901e0, arrays=0x7ffba44ed4d0, prim=0x7ffba44eba
ec, nr_prims=1, ib=0x0, index_bounds_valid=<optimized out>, min_index=0, max_ind
ex=15) at brw_draw.c:431
#4 0x00007ffb9f949e38 in vbo_exec_vtx_flush (exec=0x7ffba44eb800, keepUnmapped=
1 '\001') at vbo/vbo_exec_draw.c:390
So now really trying what I suggested at comment 2.
comment 2 was wrong, since glClear's intel implementation relies on intel_get_renderbuffer being non NULL. But combining the two previous patches in comment 1 and comment 3, together with the following patch, fixes the problem: commit 1ecdae72917f4485bd7fea204d346d05a18ee055 Author: Alon Levy <alevy> Date: Mon Sep 5 19:25:19 2011 +0300 i965: emit_depthbuffer: fix segfault, rhbz#735794 Signed-off-by: Alon Levy <alevy> diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 479cf82..f102bc6 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -248,6 +248,9 @@ static void emit_depthbuffer(struct brw_context *brw) else len = 5; + if (depth_irb && depth_irb->region == NULL) + depth_irb = NULL; + if (!depth_irb && !stencil_irb) { BEGIN_BATCH(len); OUT_BATCH(_3DSTATE_DEPTH_BUFFER << 16 | (len - 2)); put a scratch build with those three patches: http://koji.fedoraproject.org/koji/taskinfo?taskID=3325476 Alon better scratch build - same patches, but release incremented: http://koji.fedoraproject.org/koji/taskinfo?taskID=3325495 *** Bug 766078 has been marked as a duplicate of this bug. *** This message is a reminder that Fedora 16 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '16'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 16's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 16 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged to click on "Clone This Bug" and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed. |