[Mesa-dev] [RFC] st: guard against NULL pipe_surface

Tobias Klausmann tobias.johannes.klausmann at mni.thm.de
Thu Aug 18 12:41:43 UTC 2016


I have no test case per se, but orbea (in CC) noted in IRC:

Start OpenMW with DRI3 -> Crash [1]

Start OpenMW with DRI2 -> no crash,

So i fear it is somewhere in our DRI3 path. Anyway a guard seems 
reasonable to harden release builds against this. Maybe not at this 
place but central in update_framebuffer_size().

Greetings,

Tobias


[1] https://homepages.thm.de/~tjkl80/openmw_backtrace.txt


On 18.08.2016 11:55, Marek Olšák wrote:
> Hi,
>
> Do you have a test case?
>
> Marek
>
> On Thu, Aug 18, 2016 at 1:44 AM, Tobias Klausmann 
> <tobias.johannes.klausmann at mni.thm.de 
> <mailto:tobias.johannes.klausmann at mni.thm.de>> wrote:
>
>     OpenMW tries to upload a new surface (mouse pointer) which fails
>     in the now
>     guarded update_framebuffer_size() as the surface is NULL.
>
>     This is not inteded as a real "fix", as it would just hide the
>     immediate crash.
>
>     So if somebody could take a look at this...
>
>     Reported-by: <ovariegata at yahoo.com <mailto:ovariegata at yahoo.com>>
>     Signed-off-by: Tobias Klausmann
>     <tobias.johannes.klausmann at mni.thm.de
>     <mailto:tobias.johannes.klausmann at mni.thm.de>>
>     ---
>      src/mesa/state_tracker/st_atom_framebuffer.c | 6 ++++--
>      1 file changed, 4 insertions(+), 2 deletions(-)
>
>     diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c
>     b/src/mesa/state_tracker/st_atom_framebuffer.c
>     index ea41d9d..3ee4ea5 100644
>     --- a/src/mesa/state_tracker/st_atom_framebuffer.c
>     +++ b/src/mesa/state_tracker/st_atom_framebuffer.c
>     @@ -177,8 +177,10 @@ update_framebuffer_state( struct st_context *st )
>               /* rendering to a GL texture, may have to update surface */
>               st_update_renderbuffer_surface(st, strb);
>            }
>     -      pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
>     -      update_framebuffer_size(framebuffer, strb->surface);
>     +      if (strb->surface) {
>     +         pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
>     +         update_framebuffer_size(framebuffer, strb->surface);
>     +      }
>         }
>         else {
>            strb =
>     st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
>     --
>     2.9.2
>
>     _______________________________________________
>     mesa-dev mailing list
>     mesa-dev at lists.freedesktop.org <mailto:mesa-dev at lists.freedesktop.org>
>     https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>     <https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
>
>



More information about the mesa-dev mailing list