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

Francisco Jerez currojerez at riseup.net
Tue Feb 18 08:50:19 PST 2014


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().

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140218/0d762036/attachment.pgp>


More information about the mesa-dev mailing list