After display protocol error communication between wayland protocol and client is broken.

Ikshwaku Chauhan ikshwaku.ec2004 at gmail.com
Mon Dec 31 14:38:24 UTC 2018


Hello Pekka,

Thanks for your reply.
Here we are trying to identify the exact root cause for the protocol error.
we deliberately dumped the back trace by calling *abort in
display_protocol_error* function and attaching backtrace for your
reference.
Could you please have a look and provide your inputs.

We have one more query,
As per the wayland client logs I have attached in the last mail, we
observed that after getting surface created event, usually we get
configuration event and then if we set any property of surface (ex:
set_source_rectangle), the protocol communication seems to be fine.
But, when surface created event received and without configuration event,
if we try to set any property of surface, the protocol communication seems
to be stuck.

Is this the expected behavior for "Protocol error"?  Please provide you
inputs for this as well.

Thanks in advance.

Regards,
Ikshwaku

On Sun, Dec 30, 2018 at 2:42 PM Pekka Paalanen <ppaalanen at gmail.com> wrote:

> On Fri, 28 Dec 2018 15:46:23 +0530
> Ikshwaku Chauhan <ikshwaku.ec2004 at gmail.com> wrote:
>
> > Hello Pekka, Hello Dima,
> >
> > Thanks for your prompt responce.
> > After analyzing the below wayland client logs we concluded that we are
> > getting the *Protocol Error: Invalid Object*, because we are trying to
> set
> > the property of a destroyed surface.
>
> ...
>
> > [217759.719]  -> ivi_controller at 6.surface_create(80, new id
> > ivi_controller_surface at 22)
> > [217759.822] ivi_input at 7.input_acceptance(80, "default", 1)
> > [217763.257]  -> wl_display at 1.sync(new id wl_callback at 23)
> > [217764.394] wl_display at 1.delete_id(23)
> > [217764.456] wl_callback at 23.done(0)
> > [217765.170]  -> wl_display at 1.sync(new id wl_callback at 23)
> > [217765.660] wl_display at 1.delete_id(23)
> > [217765.871] wl_callback at 23.done(0)
> > [217765.921]  -> ivi_controller_surface at 22.set_source_rectangle(0, 0,
> 800,
> > 480)
> > [217766.272]  -> wl_display at 1.sync(new id wl_callback at 23)
> > [217773.004] wl_display at 1.error(wl_display at 1, 0, "invalid object 22")
> >
> > Could you please have a look and share your inputs about our findings.
> > Attaching the complete logs.
> >
> > Here we have a use case, where we are creating and destroying the
> surfaces
> > very quickly.
> > One more thing this is an some time issue.
>
> Well, I do not see why object id 22 would not exist in that log,
> it was just created.
>
> If I had to guess, you have a compositor-side bug. Either the
> wl_resource for id 22 in the ivi_controller.surface_create call is
> not created at all, or it is created and then destroyed unwarranted
> by the protocol.
>
> Whenever a protocol message is creating a new object, the message
> handler in the compositor cannot ever choose to not create the
> wl_resource for it. Likewise, wl_resources cannot be destroyed
> without an explicit warrant from protocol exchange, e.g. a destroy
> request.
>
> I'm guessing that you use global identifiers (the argument 80) to
> identify surfaces, that "surface 80" does not exist anymore, so you
> skip creating the wl_resource. That would be a bug.
>
> If so, this also shows a fundamental flaw in global identifiers
> like that: a client can never be sure that the global identifier is
> valid. Therefore you must design the ivi_controller_surface
> interface to deal with the fact that the global identifier it was
> created with was or became invalid, and add an event to tell the
> client the ivi_controller_surface is invalid. That event would then
> allow the client to destroy the ivi_controller_surface, which would
> let the compositor destroy the wl_resource.
>
> Another corollary to this is that every interface that uses or
> refers to a ivi_controller_surface object must be prepared to deal
> with one that points to an invalid or non-existent underlying
> surface. No amount of Wayland roundtrips will save you from that.
>
>
> Thanks,
> pq
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20181231/5726d5ec/attachment.html>
-------------- next part --------------
(gdb) bt full
#0  0xb6ae317c in __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
        _sys_result = 0
        pd = 0xb34093f0
        pid = <optimized out>
        selftid = 2247
#1  0xb6ae6f24 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {3064713540, 3069797744, 117156, 3007355056, 0, 1, 5, 3064029184, 117208, 3007355056, 0, 1, 5, 1, 
              3007351444, 3069713004, 3032540112, 1, 5, 0, 0, 3064712164, 0, 3007351840, 0, 4294967280, 0, 464492, 3066080448, 3069743276, 2997878784, 131072}}, sa_flags = 0, sa_restorer = 0x1}
        sigs = {__val = {32, 0 <repeats 31 times>}}
#2  0xb6a1945c in display_protocol_error (display=0x87ca8, code=0, id=1, intf=0xb6a32048 <wl_display_interface>)
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:180
No locals.
#3  0xb6a1a38c in display_handle_error (data=0x87ca8, display=0x87ca8, object=0x87ca8, code=0, message=0xb2b018c8 "invalid object 31")
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:858
        proxy = 0x87ca8
        object_id = 1
        interface = 0xb6a32048 <wl_display_interface>
#4  0xb6916ea4 in ffi_call_VFP () at /usr/src/debug/libffi/3.2.1-r0/libffi-3.2.1/src/arm/sysv.S:377
No locals.
#5  0xb6917938 in ffi_call (cif=0x2, fn=<optimized out>, rvalue=0xb34093f0, avalue=<optimized out>) at /usr/src/debug/libffi/3.2.1-r0/libffi-3.2.1/src/arm/ffi.c:344
        ecif = {cif = 0xb3408c20, rvalue = 0x0, avalue = 0xb3408b70}
        small_struct = <optimized out>
        vfp_struct = <optimized out>
        temp = 464492
#6  0xb6a1e684 in wl_closure_invoke (closure=0xb2b01848, flags=1, target=0x87ca8, opcode=0, data=0x87ca8)
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland/1.11.0-r0/wayland-1.11.0/src/connection.c:935
        count = 3
        cif = {abi = FFI_VFP, nargs = 5, arg_types = 0xb3408bc8, rtype = 0xb6917f2c <ffi_type_void>, bytes = 24, flags = 0, vfp_used = 0, vfp_reg_free = 0, vfp_nargs = 0, 
          vfp_args = '\377' <repeats 16 times>}
        ffi_types = {0xb6917ec0 <ffi_type_pointer>, 0xb6917ec0 <ffi_type_pointer>, 0xb6917ec0 <ffi_type_pointer>, 0xb6917ef0 <ffi_type_uint32>, 0xb6917ec0 <ffi_type_pointer>, 
          0xb6a1c698 <wl_connection_copy+48>, 0xb3408cac, 0x28, 0x28, 0x87d90, 0x1, 0x87ce8, 0xb6a32030 <wl_display_events>, 0x20, 0xb3408c20, 0xb6a20c22, 0x0, 0xb3408c4c, 0xb3408c2c, 0xb6a20c23, 
          0xb3408c30, 0xb6a20c22}
        ffi_args = {0xb3408c68, 0xb3408b64, 0xb2b01858, 0xb2b0185c, 0xb2b01860, 0xb6f27a48, 0xa6090, 0x2, 0xe, 0xb6f27a48, 0x28, 0xb6c0e064 <recvmsg+84>, 0xb3408c54, 0x89da0, 
          0xb6c0acc0 <__GI___pthread_key_create>, 0x87d90, 0xb3408c54, 0xb3408bc4, 0x44, 0xb2b00010, 0x94, 0x28}
        implementation = 0xb6a3200c <display_listener>
#7  0xb6a1b28c in dispatch_event (display=0x87ca8, queue=0x87d08)
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1348
        closure = 0xb2b01848
        proxy = 0x87ca8
        opcode = 0
        proxy_destroyed = false
---Type <return> to continue, or q <return> to quit---
#8  0xb6a1b5d4 in dispatch_queue (display=0x87ca8, queue=0x8bdc0)
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1486
        count = 0
#9  0xb6a1b9ac in wl_display_dispatch_queue_pending (display=0x87ca8, queue=0x8bdc0)
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1735
        ret = 0
#10 0xb6a1b960 in wl_display_dispatch_queue (display=0x87ca8, queue=0x8bdc0)
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1711
        ret = 36
#11 0xb6a1ac3c in wl_display_roundtrip_queue (display=0x87ca8, queue=0x8bdc0)
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1158
        display_wrapper = 0xb2b00818
        callback = 0xb2b006c8
        done = 0
        ret = 0
#12 0xb6f12eb4 in impl_sync_and_acquire_instance (ctx=0xb6f27cf4 <ilm_context>)
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland-ivi-extension/1.11.0-r1/git/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c:1367
No locals.
#13 0xb6f14e2c in ilm_surfaceSetDestinationRectangle (surfaceId=80, x=0, y=0, width=800, height=480)
    at /data/work/ichauhan/workspace/MMT2020/yocto/fresh/elina-mmt2020-gclient/elina-distro/build-mmt2020-a880/tmp/work/cortexa15hf-vfp-neon-elina-linux-gnueabi/wayland-ivi-extension/1.11.0-r1/git/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c:2139
        status = 464472
        ctx = 0xb6f27cf4 <ilm_context>
        returnValue = ILM_FAILED
        ctx = 0xb3408d68
        ctx_surf = 0xa60a8


More information about the wayland-devel mailing list