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.

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?

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.

--

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.

-- 
Geoff

------------------------------------------------------------------------------
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
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to