bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Plotutils 2.4.1, X double buffering and X threads


From: Jonathan Woithe
Subject: Plotutils 2.4.1, X double buffering and X threads
Date: Thu, 11 Apr 2002 12:23:29 +0930 (CST)

Hi there

I am using plotutils 2.4.1 under Slackware 8.0 (glibc 2.2.3, XFree86 4.0.2)
to produce some animations.  I have encountered a couple of problems.

Essentially the program initialises libplot, does pl_openpl_r() and then
separates frames by calling pl_erase_r().

Firstly, once the animation is complete, the last graph is cleared and the
command line returns indicating a successful `spin off'.  However, the
plotting window is completely unresponsive to the `q' button.  In fact, the
only way to remove the window is to either destroy it or kill the process.

In addition, I've found that if double buffering is active, moving the mouse
in and out of the window during the animation can reliably cause the program
to freeze.  <ctrl>-c can exit in this case.

In both cases, it seems that there's an issue with the X event handler for
this widget.  A gdb attached to the hung process (either case) shows that
the program is within the X event handlers.  A partial stack trace from a
mouse-induced freeze gives the following.
  :
  #2  0x403837c3 in _XEventsQueued () from /usr/X11R6/lib/libX11.so.6
  #3  0x403784aa in XEventsQueued () from /usr/X11R6/lib/libX11.so.6
  #4  0x402fd9de in XtAppPending () from /usr/X11R6/lib/libXt.so.6
  #5  0x400ba9b6 in _y_maybe_handle_x_events ()
     from /remote/wave/jwoithe/lib.linux/libplot.so.2
  #6  0x400b3bad in _maybe_handle_x_events ()
     from /remote/wave/jwoithe/lib.linux/libplot.so.2
  #7  0x400b9ce2 in _y_erase_page ()
     from /remote/wave/jwoithe/lib.linux/libplot.so.2
  #8  0x4007acc2 in pl_erase_r ()
  :

What appears above the _XEventsQueued() call varies, but the rest of
the trace seems fairly reproduceable.

If the program is allowed to finish and spin off the window, the trace looks
slightly different:
  #0  0x403837ae in _XEventsQueued () from /usr/X11R6/lib/libX11.so.6
  #1  0x403784aa in XEventsQueued () from /usr/X11R6/lib/libX11.so.6
  #2  0x402fd4dc in XtAppNextEvent () from /usr/X11R6/lib/libXt.so.6
  #3  0x402f33f0 in XtAppMainLoop () from /usr/X11R6/lib/libXt.so.6
  #4  0x400b9663 in _y_end_page ()
     from /remote/wave/jwoithe/lib.linux/libplot.so.2
  #5  0x40077cc1 in pl_closepl_r ()
  :

The common thread in this is that it seems the X event handler is getting
hung up about something.

Next I recompiled libplot after #undef'ing the X_THREAD_SUPPORT define in
config.h.  The resulting library did not exhibit any of the symptoms
described above.  Apart from calling XInitThreads() and 
XtToolkitThreadInitialize(), this define does not appear to have any other
effect on libplot - specifically, libplot doesn't appear to do anything
involving multi-threads itself.  This may in fact imply that the problem
lies within X itself rather than libplot.

Does anyone have any thoughts on this?  Is it a problem with libplot and the
way it implements its own event loop, or does the trouble lie with Xfree86?

Please CC me any replies since I don't subscribe to the list.

Best regards
  jonathan
-- 
* Jonathan Woithe    address@hidden                        *
*                    http://www.physics.adelaide.edu.au/~jwoithe            *
***-----------------------------------------------------------------------***
** "Time is an illusion; lunchtime doubly so"                              **
*  "...you wouldn't recognize a subtle plan if it painted itself purple and *
*   danced naked on a harpsichord singing 'subtle plans are here again'"    *



reply via email to

[Prev in Thread] Current Thread [Next in Thread]