Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-24 Thread Marek Olšák
On Tue, Apr 24, 2018 at 3:13 AM, Johan Helsing wrote: > Emil: Your alternative patch won't work because dri_make_current is not > necessarily called with NULL after a buffer has been destroyed. > > > The problematic sequence is a pattern we use in QtWayland: > > > //create temporary context > > s

Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-24 Thread Emil Velikov
On 24 April 2018 at 08:13, Johan Helsing wrote: > Emil: Your alternative patch won't work because dri_make_current is not > necessarily called with NULL after a buffer has been destroyed. > Interesting, the trace attached in the bugreport does a proper makecurrent/surface dance. Namely, MakeCurren

Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-24 Thread Michel Dänzer
ekka.paala...@collabora.co.uk; ML Mesa-dev > Subject: Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed > dri_drawable > > On 2018-04-24 09:13 AM, Johan Helsing wrote: >> Emil: Your alternative patch won't work because dri_make_current is not >> neces

Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-24 Thread Daniel Stone
Hi Johan, On 24 April 2018 at 09:44, Johan Helsing wrote: > If the call to dri_destroy_buffer is delayed until the next eglMakeCurrent, > that would also solve the problem (I'm not sure how that would affect other > things, though). It _must_ be: If the EGL surface surface is not current to an

Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-24 Thread Johan Helsing
happy. Johan From: Michel Dänzer Sent: Tuesday, April 24, 2018 10:36:00 AM To: Johan Helsing; Marek Olšák Cc: Daniel Stone; pekka.paala...@collabora.co.uk; ML Mesa-dev Subject: Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable On 2018-04-24 09:13 AM, Johan Helsin

Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-24 Thread Michel Dänzer
On 2018-04-24 09:13 AM, Johan Helsing wrote: > Emil: Your alternative patch won't work because dri_make_current is not > necessarily called with NULL after a buffer has been destroyed. > > > The problematic sequence is a pattern we use in QtWayland: > > > //create temporary context > > surfac

Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-24 Thread Johan Helsing
Emil: Your alternative patch won't work because dri_make_current is not necessarily called with NULL after a buffer has been destroyed. The problematic sequence is a pattern we use in QtWayland: //create temporary context surface1 = eglCreateWindowSurface() <-- dri_drawable pointer is malloce

Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-23 Thread Marek Olšák
FYI, the commit was causing crashes of qtcreator and firefox, so I reverted it. Marek On Fri, Apr 20, 2018 at 6:29 AM, Johan Klokkhammer Helsing < johan.hels...@qt.io> wrote: > If an EGLSurface is created, made current and destroyed, and then a second > EGLSurface is created. Then the second mal

Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-23 Thread Emil Velikov
Hi Johan, On 20 April 2018 at 11:29, Johan Klokkhammer Helsing wrote: > If an EGLSurface is created, made current and destroyed, and then a second > EGLSurface is created. Then the second malloc in driCreateNewDrawable may > return the same pointer address the first surface's drawable had. What d

Re: [Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-23 Thread Marek Olšák
Pushed, thanks! Marek On Fri, Apr 20, 2018 at 6:29 AM, Johan Klokkhammer Helsing < johan.hels...@qt.io> wrote: > If an EGLSurface is created, made current and destroyed, and then a second > EGLSurface is created. Then the second malloc in driCreateNewDrawable may > return the same pointer addres

[Mesa-dev] [PATCH] st/dri: Fix dangling pointer to a destroyed dri_drawable

2018-04-20 Thread Johan Klokkhammer Helsing
If an EGLSurface is created, made current and destroyed, and then a second EGLSurface is created. Then the second malloc in driCreateNewDrawable may return the same pointer address the first surface's drawable had. Consequently, when dri_make_current later tries to determine if it should update the