[PATCH 0/2] Fix double free issue when a client surface is destroyed

Frederico Cadete frederico.cadete at awtce.be
Thu Mar 17 07:14:05 EDT 2016

On Thu, Mar 17, 2016 at 10:43:54AM +0000, Ucan, Emre (ADITG/SW1) wrote:
> Hi,
> When a client surface is destroyed, ivi-controller sends a content removed event and a surface destroyed event.
> Both of these events are freeing the surface context, and therefore causing a double free. 
> I removed the surface cleanup code from surface content listener implementation to fix this issue.
> Furthermore, I changed the implementation of ivi-controller to send only surface destroyed event, when a client surface is destroyed.

Out of curiosity, does this part of the ivi-controller.xml protocol
still make sense?

        <event name="destroyed">
            <description summary="ivi_controller_surface was destroyed"/>
        <enum name="content_state">
            <description summary="all possible states of content for a surface">
                This enum defines all possible content states of a surface. This is
                required, since surfaces in ivi compositor can exist without applications
                providing content for them.
            <entry name="content_available" value="1"
                   summary="application provided wl_surface for this surface"/>
            <entry name="content_removed" value="2"
                   summary="wl_surface was removed for this surface"/>

content_available is hooked to the surface creation inside weston.
Now content removed is never sent. The controller process has to listen
to surface_content_state_content_available for the creation of the surface,
and for surface_destroyed for the destruction of the surface.

I don't understand where is the implementation for the sentence
"surfaces in ivi compositor can exist without applications providing
content for them."

I don't mean to nitpick :). It's just that I have been considering implementing
an HMI controller directly on top of the generated ivi_controller_*
protocol functions (without libilmControl), and I would like to understand
if this protocol is stable enough.

Best regards,

Frederico Cadete
R&D Software Engineer
VIT Software Development
AWTC Europe - www.aweurope.eu - www.aisin-aw.co.jp

> Emre Ucan (2):
>   ilmControl: don't free surface context twice
>   ivi-controller: don't send content removed event
>  .../ilmControl/src/ilm_control_wayland_platform.c  |   34 ++++++--------------
>  weston-ivi-shell/src/ivi-controller-impl.c         |    1 -
>  2 files changed, 9 insertions(+), 26 deletions(-)
> -- 
> Best regards
> Emre Ucan
> Advanced Driver Information Technology GmbH
> Software Group I (ADITG/SW1)
> Robert-Bosch-Str. 200
> 31139 Hildesheim
> Germany
> Tel. +49 5121 49 6937
> Fax +49 5121 49 6999
> eucan at de.adit-jv.com
> ADIT is a joint venture company of Robert Bosch GmbH/Robert Bosch Car Multimedia GmbH and DENSO Corporation
> Sitz: Hildesheim, Registergericht: Amtsgericht Hildesheim HRB 3438
> Geschaeftsfuehrung: Wilhelm Grabow, Ken Yaguchi
> _______________________________________________
> genivi-ivi-layer-management mailing list
> genivi-ivi-layer-management at lists.genivi.org
> https://lists.genivi.org/mailman/listinfo/genivi-ivi-layer-management

More information about the genivi-ivi-layer-management mailing list