On 2015-03-21 11:57-0700 Alan W. Irwin wrote: > Hi Andrew: > > I have now (commit fa0c879) solved this release-critical regression. > > The crux of the problem is redundant linking of qt_example to both > plplot (which contained all of the code in plplotqt for this > ENABLE_DYNDRIVERS=NO case) and plplotqt. examples/c++/qt_example had no severe > memory management issues if I manipulated visibility so that I used > either the plplotqt symbols from just plplot or just plplotqt. > However, if both sets of symbols are made visible (the change that > formally caused this regression), it caused severe memory management > issues when the libraries were closed at plend. The obvious fix for > this issue has been applied which is to drop the redundant linking of > qt_example to libplplotqt for the ENABLE_DYNDRIVERS=NO case. > > There are obvious broader implications here now that we have a clear > case of plend memory management issues caused by redundant linking to > two sets of the identical code located in two different libraries. I > frankly never expected this to be an issue since I thought the linker > would choose one set or the other with no other consequences. But from > this experience this is obviously not the case (probably due to all > the behind-the-scenes shenanigans that go on when libraries are > closed). Anyhow, since I have not been aware of this issue for all the > years I have been trying to maintain correct PLplot linking, I am > virtually positive there are similar instances of this same problem > for other device drivers. Note, for example, that for the > ENABLE_DYNDRIVERS=NO case there is necessarily always two copies of > the device driver binding code (e.g., like the libplplotqt binding > code) to break circular linking issues. > > So my current plan is to look very carefully for such issues and fix > them (likely most of those fixes will occur post-release if there is > not a clear regression from 5.10.0 results) in the hope this > refinement of our linking model will ultimately resolve a substantial > number of the plend memory management issues we have been > encountering.
It turns out this is not an issue at all for wxwidgets because that driver code does not depend on bindings/wxwidgets code. So the only maintained drivers where for ENABLE_DYNDRIVERS=NO duplicate code occurs in two separate libraries is for -dev tk and -dev tkwin. But the plplot library currently does not have visible symbols corresponding to the libplplottcltk symbols so from the experience with plplot and plplotqt there should be no memory management issues for Windows and Unix forms of gcc if the gcc compile option -fvisibility=hidden is used and also no such issues for the MSVC case. Therefore, for Linux I dropped the gcc -fvisibility=hidden option in anticipation that would generate severe memory management issues for -dev tk, but it did not. So experience with the C++ qt device driver does not predict exactly what will happen for the C tk device driver. Nevertheless, we do have a large number of outstanding plend memory management issues for anything having to do with Tcl and Tk, and at least in the C++ case, duplicate symbols defined in two separate libraries does lead to plend memory management trouble. Therefore, as a post-release project I plan to make visible all the libplplottcltk symbols that are currently not visible in plplot, and then drop libplplottcltk from all link commands to see whether that fixes some of the current plend issues with Tcl/Tk. 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); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); 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 __________________________ ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel