From: Alan W. I. <ir...@be...> - 2009-08-26 22:14:11
|
On 2009-08-26 13:48-0500 Hezekiah M. Carty wrote: > While testing the qtwidget and other PLplot qt output devices I ran in > to two issues. This is on Ubuntu 9.04 64bit, with the system Qt > version (4.5.0). > > The first issue is similar in feel to an long-lived, ongoing Cairo > problem - calling plinit and selecting a qt device after a call to > plend causes a segmentation fault. Simply calling "plinit(); plend(); > plinit();" (selecting a qt device each time) is enough to trigger the > bug here. I don't know if this happens for every qt device, but it > happens consistently for me with the qtwidget device. Similar to the > Cairo bug, calling plend1 rather than plend avoids this bug. Unlike > the Cairo bug, no text rendering is required to trigger the qt > segmentation fault. > > The second issue relates to using plend1. For example: > > plsdev "qtwidget"; > plinit (); > plenv 0. 1. 0. 1. 1 0; > plend1 (); > plsdev "qtwidget"; > plinit (); > plenv 0. 1. 0. 1. 1 0; > plend1 (); > > The first call to plend1 will not display a plot, just the plot window > with (on my system) a grey hatched background. The second plend1 call > will show the plot. > > I don't use the qt driver except for occasional testing, so I'm not > sure if these are PLplot bugs or bugs in some other library (for > example, Qt 4.5.0 vs a later release). When persistent memory management problems (segfaults, etc.) are identified like this, I think it is important to add a simple C test routine to demonstrate the problem so we have an exact test case to talk about since _the symptoms_ of fundamental memory management issues can come and go depending very much on minor programming detail variations as well as platform, phase of the moon, etc. IOW, relying on segfaults to tell us about memory management issues is a first step, but valgrind is the only way (at least on Linux) to get definitive results. I have made such a test case in revision 10348 (which demonstrates exactly how to add such a test for our build system). It will build automatically in the build tree for BUILD_TEST=ON and also automatically in the installed examples tree. For this particular test (plend1, then plend), all is well even for valgrind tests of -dev qtwidget and -dev xcairo, but if that first plend1 is replaced by plend there are huge memory management problems revealed by valgrind for both -dev xcairo and -dev qtwidget (but not -dev xwin or -dev psc). This is for Qt version 4.5.1 downloaded from trolltech. I have forgotten the exact differences between plend and plend1, but I know the former calls the latter than does a bit more to completely close the plplot library. I guess that "bit more" is causing the problems (or else the subsequent plinit after a complete close of plplot is exposing reinitialization bugs for both the cairo and qt devices.) Andrew, I intend to look at this (especially the differences between plend and plend1) a bit more, but you are our expert on memory management issues so I hope you take a look as well. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |