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

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Thu Mar 17 08:07:40 EDT 2016


Hi Frederico,

Short answer: No, It does not make sense.

Long answer:
In old LayerManager, it was possible to create ilm surfaces without content and add content later with ilm_surfaceSetNativeContent API.
In weston-ivi-shell, you can create an ivi-surface only with a wl-surface. Therefore, it is not possible to create an ivi-surface without native content.

The controller process does not have to listen content available event to track surface creation. It can check the surface event of ivi-controller interface (see controller_listener_surface).
Furthermore, the controller process can check the surface destroyed event to track client surface destruction. Therefore, the surface content events are unnecessary.

Best regards

Emre Ucan
Software Group I (ADITG/SW1)

Tel. +49 5121 49 6937

> -----Original Message-----
> From: Frederico Cadete [mailto:frederico.cadete at awtce.be]
> Sent: Donnerstag, 17. März 2016 12:14
> To: Ucan, Emre (ADITG/SW1)
> Cc: genivi-ivi-layer-management at lists.genivi.org
> Subject: Re: [PATCH 0/2] Fix double free issue when a client surface is
> destroyed
> 
> 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"/>
>         </event>
>         <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.
>             </description>
>             <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"/>
>         </enum>
> 
> 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
> 
> 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(-)
> >
> > --
> > 1.7.9.5
> >
> > 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