[PATCH xserver v2] xwayland: avoid using freed xwl_window on unrealize

Olivier Fourdan ofourdan at redhat.com
Thu Apr 19 15:05:41 UTC 2018


Hi,

On Thu, Apr 19, 2018 at 9:15 AM, Olivier Fourdan <fourdan at gmail.com> wrote:

> Sure, I've sent a new patch to do that, but I reckon this can wait after
> the release, we might leak a frame callback in some cases (although
> valgrind did not really complain yet), but we won't crash anymore.
>

Sorry I kinda take that back, I just had a crash related to
xwayland-present again:

gdb) bt
#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007f023c612591 in __GI_abort () at abort.c:79
#2  0x000000000058d850 in OsAbort () at utils.c:1350
#3  0x0000000000592ac9 in AbortServer () at log.c:877
#4  0x000000000059393d in FatalError (f=f at entry=0x5b86b0 "Caught signal %d
(%s). Server aborting\n") at log.c:1015
#5  0x000000000058aba5 in OsSigHandler (signo=11, sip=<optimized out>,
unused=<optimized out>) at osinit.c:156
#6  <signal handler called>
#7  0x00007f023eac1b55 in wl_proxy_destroy (proxy=0x31) at
src/wayland-client.c:530
#8  0x0000000000434774 in wl_callback_destroy (wl_callback=<optimized out>)
at /usr/include/wayland-client-protocol.h:1154
#9  xwl_present_frame_callback (data=0x184cb10, callback=<optimized out>,
time=<optimized out>) at xwayland-present.c:192
#10 0x00007f023bf5603e in ffi_call_unix64 () at ../src/x86/unix64.S:76
#11 0x00007f023bf559ff in ffi_call () at ../src/x86/ffi64.c:525
#12 0x00007f023eac52dd in wl_closure_invoke (closure=0x18837d0, flags=1,
target=<optimized out>, opcode=0,
    data=<optimized out>) at src/connection.c:996
#13 0x00007f023eac1a39 in dispatch_event (display=display at entry=0x980010,
queue=<optimized out>) at src/wayland-client.c:1434
#14 0x00007f023eac2f5c in dispatch_queue (queue=0x9800d8, display=0x980010)
at src/wayland-client.c:1580
#15 wl_display_dispatch_queue_pending (display=0x980010, queue=0x9800d8) at
src/wayland-client.c:1822
#16 0x00007f023eac2fc0 in wl_display_dispatch_pending (display=<optimized
out>) at src/wayland-client.c:1885
#17 0x000000000042a83b in xwl_read_events (xwl_screen=0x977c20) at
xwayland.c:800
#18 0x000000000058b591 in ospoll_wait (ospoll=0x96d0d0, timeout=<optimized
out>) at ospoll.c:651
#19 0x0000000000584e2c in WaitForSomething (are_ready=<optimized out>) at
WaitFor.c:208
#20 0x0000000000554970 in Dispatch () at ../include/list.h:220
#21 0x0000000000558c26 in dix_main (argc=12, argv=0x7ffce44bebc8,
envp=<optimized out>) at main.c:276
---Type <return> to continue, or q <return> to quit---
#22 0x00007f023c6141bb in __libc_start_main (main=0x429f30 <main>, argc=12,
argv=0x7ffce44bebc8, init=<optimized out>,
    fini=<optimized out>, rtld_fini=<optimized out>,
stack_end=0x7ffce44bebb8) at ../csu/libc-start.c:308
#23 0x0000000000429f6a in _start ()

(gdb) f 9
#9  xwl_present_frame_callback (data=0x184cb10, callback=<optimized out>,
time=<optimized out>) at xwayland-present.c:192
192        wl_callback_destroy(xwl_window->present_frame_callback);
(gdb) list
187                   struct wl_callback *callback,
188                   uint32_t time)
189    {
190        struct xwl_window *xwl_window = data;
191
192        wl_callback_destroy(xwl_window->present_frame_callback);
193        xwl_window->present_frame_callback = NULL;
194
195        if (xwl_window->present_timer_firing) {
196            /* If the timer is firing, this frame callback is too late */

Looks like we're not done yet :/

I'll try that other patch I sent and see if that makes a difference here,
could be related according to the backtrace I guess...

Cheers,
Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180419/1a351e24/attachment.html>


More information about the xorg-devel mailing list