On 2009-04-24 23:00-0500 Geoffrey Furnish wrote:
> So, thanks to all for the help today.
>
> This note is to summarize what I have learned about the fabled Tk segfault.
>
> When I finally managed to find a way to exhibit the problem under gdb, I
> found that the program was inside a pthread op. That was at a different
> computer than where I am now. As I recall, it was trying to unlock a mutex,
> and segfaulted.
>
> I've spent a little time trying to debug the xwin HAVE_PTHREAD code. I
> couldn't figure it out (yet). In the end, I found that you can throw
> -DHAVE_PTHREAD=off on the cmake line, and that cures the segfault.
I confirm this. That is a nice breakthrough.
>
> The Pthreads code in xwin, according to "git log -p", was written by Joao in
> the 2003 time frame.
>
> I know Tk has worked in release since then. I've been puzzling over this
> seemingly contradictory empirical result.
>
> Is it possible that HAVE_PTHREAD was an option in the code, but not enabled
> by default in the past, and that CBS was changed to enable it by default
> sometime in the last couple of years or so?
Yep, exactly.
>
> In any event, my opinion is:
>
> 1) The pthread support is implicated. I believe there is a bug in mutex
> handling, though I haven't proven that by exhibiting a corrective patch
> yet.
>
> 2) The pthread code is suspect. Not to malign others' work, but in my
> attempts to review it today, I really could not convince myself that it
> even "looked right" to me. So, without meaning to sound over-the-top, I'm
> just saying, I'm suspicious that the pthread code isn't really worked out
> yet.
>
> 3) I think the CBS should be changed to keep HAVE_PTHREAD off by default, and
> list it as an experimental feature. A user/developer who wants to try it
> should be able to turn it on, but be warned that it is known to interact
> fatally with at least the Tk driver. Since the code in question is in
> xwin.c, there is also the possibility that it would negatively impact other
> X-only PLplot applications.
>
> 4) Tcl/Tk should stay on by default if CBS finds the needed stuff.
I agree (3) is the right thing to do unless and until somebody makes it work
with Tk. Does anybody object to that move? (I recall there was quite
a bit of support for
enabling HAVE_PTHREAD by default before
we made the decision to do that, but we didn't realize at the time how
if affected Tk, and I believe that issue means we must deprecate it again\
(i.e., turn it off by default).
(4) is more problematic, unfortunately.
The problem is that two of the four Tk examples are
still not working for me for the -DENABLE_tk=ON -DHAVE_PTHREAD=OFF case.
./xtk01 -f tk01
and
plserver -f tk03
seem to work fine, but the other two error out as follows:
softw...@raven> ./xtk02 -f tk02
invalid command name "Pltkwin"
while executing
"Pltkwin .plw"
(file "tk02" line 48)
invoked from within
"source tk02"
softw...@raven> ./xtk04 -f tk04
invalid command name "PLXWin"
while executing
"PLXWin .plw"
(file "tk04" line 37)
invoked from within
"source tk04"
Geoffrey, can you replicate the above issues?
Just in case not (i.e., this is a Tcl/Tk version-dependent issue), here is
what is relevant to Tk/Tcl in my cmake output:
softw...@raven> egrep -i '(tcl|tk)' cmake.out
-- Looking for include paths and libraries for Tcl/Tk
-- Looking for include paths and libraries for Tcl/Tk - found
-- Looking for tclsh
-- Looking for tclsh - found
-- TCL_TCLSH = /usr/bin/tclsh
-- HAVE_TCL_GT_84 = 1
-- TCL_INCLUDE_PATH = /usr/include/tcl8.5
-- TCL_LIBRARY = /usr/lib/libtcl8.5.so
-- Looking for itcl.h
-- Looking for itcl.h - not found
-- WARNING: Disabling incr Tcl interface code
-- TK_INCLUDE_PATH = /usr/include/tcl8.5;/usr/include
-- TK_LIBRARY =
/usr/lib/libtk8.5.so;/usr/lib/libSM.so;/usr/lib/libICE.so;/usr/lib/libX11.so;/usr/lib/libXext.so
TCL_DIR /home/software/plplot_cvs/installcmake/share/plplot5.9.2/tcl
DRIVERS_LIST:
cairo;cgm;qt;hpgl;mem;null;pbm;ps;psttf;svg;tk;tkwin;wxwidgets;xfig;xwin
DEVICES_LIST:
extcairo;pdfcairo;pngcairo;pscairo;svgcairo;xcairo;cgm;epsqt;pdfqt;qtwidget;bmpqt;jpgqt;pngqt;ppmqt;tiffqt;svgqt;hp7470;hp7580;lj_hpgl;mem;null;pbm;ps;psttf;svg;tk;tkwin;wxwidgets;xfig;xwin
ENABLE_tcl: ON ENABLE_itcl: OFF
ENABLE_tk: ON ENABLE_itk: OFF
Also, I have 64-bit hardware running Debian Lenny, and my CMake version
is 2.6.0 if any of that is relevant.
>
> It's been my intention to look into the threading support. This certainly
> accentuates in my own mind, the need for me to pick up this line of inquiry
> at some point, as soon as I can manage. But, I won't be able to do any more
> than this before the coming release.
>
> I hope this was at least a little bit helpful.
Yes, and thanks. You have made substantial progress on a problem that
has been intractible for everybody else.
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
__________________________
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel