[Mesa-dev] [PATCH] clover: Don't call pipe_loader_release() when deleting a device

Tom Stellard tom at stellard.net
Wed Feb 19 14:29:38 PST 2014


On Tue, Feb 18, 2014 at 05:50:19PM +0100, Francisco Jerez wrote:
> Tom Stellard <tom at stellard.net> writes:
> 
> > From: Tom Stellard <thomas.stellard at amd.com>
> >
> > After pipe_loader_release() is called, if any of the pipe_* objects
> > try to call into the gallium API the application will segfault.
> >
> > The only time devices are deleted is when the global _clover_platform
> > object is deleted by the static destructor.  However,  since application
> > objects that are deleted by the static destructor *after*
> > _clover_platform might try to make a CL API calls from their destructor,
> > it is never safe to call pipe_loader_release().
> 
> Please have a look at the clover-internal-ref-counting branch [1] of my
> mesa tree, it should fix a number of memory management-related bugs,
> possibly the one you've encountered too, without the negative side
> effects of dropping the call to pipe_loader_release().
> 

I came across one regression, but I'm still looking into whether or not it is a
bug in clover or an application bug.

-Tom

> Thanks.
> 
> [1] http://cgit.freedesktop.org/~currojerez/mesa/log/?h=clover-internal-ref-counting
> 
> > ---
> >  src/gallium/state_trackers/clover/core/device.cpp | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
> > index 76a49d0..2290366 100644
> > --- a/src/gallium/state_trackers/clover/core/device.cpp
> > +++ b/src/gallium/state_trackers/clover/core/device.cpp
> > @@ -48,8 +48,6 @@ device::device(clover::platform &platform, pipe_loader_device *ldev) :
> >  device::~device() {
> >     if (pipe)
> >        pipe->destroy(pipe);
> > -   if (ldev)
> > -      pipe_loader_release(&ldev, 1);
> >  }
> >  
> >  bool
> > -- 
> > 1.8.1.4





More information about the mesa-dev mailing list