On Mon, Sep 2, 2013 at 2:46 AM, Matthew Vernon <mc...@cam.ac.uk> wrote:

> Hi,
>
> I rebuilt buici-clock with debugging information turned on, ran it, and
> waited for it to hang. When it did, here's the backtrace from gdb.
>
> Any other debugging info I can provide?
>

Thanks for doing this.  I've been unable to reproduce the fault.

My hunch has been that we're running into trouble with the X server.
 Perhaps we're leaking X resources.  This backtrace does not contradict
that premise.

I reviewed the program code and did not find anything I could suspect of
leaking resources.

Considering where the lock-up is occurring, it seems like an easy way to
recreate it would be to change the re-draw timer to draw more frequently
than once a second.  Say, 10 or 20 times a second.  This would be helpful
in recreating the failure more quickly, but it still doesn't answer the
question of what is going wrong.

In this dump, it's the first call to stroke that fails.  I'd guess that
most of the cairo calls before this are local and don't interface with the
X server.  So, what would be interesting to see is a) increasing the draw
rate so that the clock locks-up more quickly, and then seeing if the
failure always occurs at the same point in draw.cc.

Do you think you could run this test?

I think you may only have to remove the test in clock.cxx where it says:

                                // Return immediately if there is
                                // nothing new to render.
  if (seconds == m_seconds)
    return false;

We'd let it draw every time it is activated, or if you are interested in
more control you could calculate a more precise time delta.  The alarm is
configured for 100ms which would be the upper bound on redraw if you
removed the test above.



>
> Thanks,
>
> Matthew
>
> #0  pthread_cond_wait@@GLIBC_2.3.2 ()
>     at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
> #1  0x00007f452804b31e in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
> #2  0x00007f452804c697 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
> #3  0x00007f452804c8bb in xcb_wait_for_reply ()
>    from /usr/lib/x86_64-linux-gnu/libxcb.so.1
> #4  0x00007f452804d393 in xcb_get_extension_data ()
>    from /usr/lib/x86_64-linux-gnu/libxcb.so.1
> #5  0x00007f452804d567 in xcb_generate_id ()
>    from /usr/lib/x86_64-linux-gnu/libxcb.so.1
> #6  0x00007f45292d8f9f in _XAllocIDs ()
>    from /usr/lib/x86_64-linux-gnu/libX11.so.6
> #7  0x00007f45292dbb87 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
> #8  0x00007f4526c8bdc9 in XRenderCreatePicture ()
>    from /usr/lib/x86_64-linux-gnu/libXrender.so.1
> ---Type <return> to continue, or q <return> to quit---
> #9  0x00007f4528e193a7 in ?? () from
> /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #10 0x00007f4528e1448d in ?? () from
> /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #11 0x00007f4528dfe4d3 in ?? () from
> /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #12 0x00007f4528dff6d9 in ?? () from
> /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #13 0x00007f4528dae1fe in ?? () from
> /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #14 0x00007f4528e17b83 in ?? () from
> /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #15 0x00007f4528ded2fe in ?? () from
> /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #16 0x00007f4528db5925 in ?? () from
> /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #17 0x00007f4528dafcc4 in ?? () from
> /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #18 0x00007f4528da9145 in cairo_stroke ()
>    from /usr/lib/x86_64-linux-gnu/libcairo.so.2
> #19 0x0000000000407bce in draw_hands (display=0x7098b0, visual=0x7144f0,
>     pixmap=8388619, dx=99, dy=99, seconds=19459) at draw.cc:172
> #20 0x0000000000404ed1 in WTopLevel::render (this=0x722240) at
> clock.cxx:541
> #21 0x00000000004063ab in signal_alarm (pv=0x722240) at clock.cxx:965
> #22 0x0000000000407117 in LSignal::handler (signal=14) at signal.cxx:215
> #23 <signal handler called>
> #24 0x00007f452832fdf8 in *__GI___poll (fds=0x7fffc6501510, nfds=1,
>     timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:83
> #25 0x00007f452804b1c2 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
> #26 0x00007f452804c93f in xcb_wait_for_event ()
>    from /usr/lib/x86_64-linux-gnu/libxcb.so.1
> #27 0x00007f45292d8d88 in _XReadEvents ()
> ---Type <return> to continue, or q <return> to quit---
>    from /usr/lib/x86_64-linux-gnu/libX11.so.6
> #28 0x00007f45292c80a8 in XNextEvent ()
>    from /usr/lib/x86_64-linux-gnu/libX11.so.6
> #29 0x0000000000409114 in LDisplay::next_event (this=0x7fffc65016f0,
>     pEvent=0x7fffc6501600) at ldisplay.h:153
> #30 0x00000000004085a7 in LDisplay::dispatch_next_event
> (this=0x7fffc65016f0)
>     at ldisplay.cxx:62
> #31 0x00000000004062cc in do_clock () at clock.cxx:946
> #32 0x00000000004036b5 in main (argc=3, argv=0x7fffc6501938) at
> main.cxx:140
>
>

Reply via email to