From: Alan W. I. <ir...@be...> - 2013-11-05 08:45:14
|
To Maurice and Arjen: I need some help tracking down the cause of a segfault with the menubutton command in bindings/tk/plwidget.tcl. To follow what I have done you should be using the latest trunk version (revision 12650 or later) which corrects a few issues with the test for TEA compliance below. It has obviously been a long time since anyone tested the Tk bindings for PLplot this way, but it would be nice to get this test working again because TEA is a pretty important Tcl/Tk standard for extensions such as the Tk bindings for PLplot. The directions in examples/tk/README.tkdemos for testing TEA compliance from the wish environment for PLplot say use (after everything is built in the build tree that is required) wish lappend auto_path $prefix/share/plplot$VERSION | ../../bindings/tk package require Pltk source tkdemos.tcl That final source command or equivalently % plstdwin . % plxframe .plw segfaults with the Debian versions of Tcl/Tk8.5 and itcl... version 3. With a lot of puts commands, I finally discovered that segfault occurred as a result of menubutton $pmbut -text "Plot" -menu $pmenu($w) -relief raised in the plw::create_pmenu proc defined in bindings/tk/plwidget.tcl Here are the first few valgrind error messages associated with this issue: % lappend auto_path ../../bindings/tk /usr/share/tcltk/tcl8.5 /usr/lib /usr/local/lib/tcltk /usr/local/share/tcltk /usr/lib/tcltk /usr/share/tcltk /usr/share/tcltk/tk8.5 /usr/share/tcltk/tk8.5/ttk ../../bindings/tk % package require Pltk 5.9.10 % plstdwin . % plxframe .plw ==10307== Use of uninitialised value of size 8 ==10307== at 0x54A2124: pthread_mutex_lock (pthread_mutex_lock.c:50) ==10307== by 0x5701D86: XrmQGetResource (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==10307== by 0x56DE951: XGetDefault (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) [...] ==10307== Invalid read of size 4 ==10307== at 0x54A2124: pthread_mutex_lock (pthread_mutex_lock.c:50) ==10307== by 0x5701D86: XrmQGetResource (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) I suspect the common location of pthread_mutex_lock for these first two valgrind issues indicates some sort of thread difficulty with the above menubutton command. The above menubuttom command is executed as part of the create_pmenu procedure that is set up with pack append $w.ftop \ [plw::create_pmenu $w $w.ftop.pmenu] \ {left fill padx 12} So the above $pmbut variable corresponds to $w.ftop.pmenu in the calling environment. I also tried replacing the above menubutton syntax with menubutton $pmbut -text "Plot" -menu $pmbut.m -relief raised That syntax corresponds to how we use menubutton elsewhere in our scripts. However, that version of the command also caused an immediate segfault. Therefore, I suspect something is wrong with either $w or $w.ftop.pmenu in the above [plw::create_pmenu $w $w.ftop.pmenu] but I don't know what because I have pretty much come to the end of my limited Tcl/Tk expertise. Therefore, would one of you be willing to take over now and debug this segfault yourself? It would be good to be able to demonstrate compliance with the TEA standard for our PLplot Tk bindings again. That appeal for help is mostly directed at Maurice because he has access to Linux while there is a barrier to entry for Arjen's Cygwin platform. An important question on that platform is whether the Unix or Windows logic in bindings/tk/pkgIndex.tcl.in is being executed. If it is Windows, then from the comments in that part of the logic, there is likely some changes Arjen will have to make to get the above package require Pltk command executed under wish to provide the expected answer (5.9.10) that you get on Linux. But once he has gotten that far on Cygwin, then I suspect he will run into some sort of run-time trouble (as I do on Linux) with the source tkdemos.tcl command which will boil down to some issue with the way the above menubutton command is invoked. 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 __________________________ |
From: Alan W. I. <ir...@be...> - 2013-11-05 20:48:29
|
On 2013-11-05 00:45-0800 Alan W. Irwin wrote: [...] > % plstdwin . > % plxframe .plw > > segfaults with the Debian versions of Tcl/Tk8.5 and > itcl... version 3. I discovered by comparison with examples/tk/runAllDemos.tcl that the source of this issue (I am pretty sure, but I would appreciate confirmation from Maurice) is that you should use plframe rather than plxframe inside a wish environment. Accordingly I made the appropriate change in the tkdemos.tcl logic (revision 12663) and with two caveats ([1] a pretty rough logic hack that only works if you follow the examples/tk/README.tkdemos instructions religiously, and [2] a lack of access to libplplotd constants such as $::PLPLOT::PL_PI [namespace issues???]) I now have tkdemos.tcl working under wish. For example, the 10th and 12th examples work fine since they do not require libplplotd constants. These changes to tkdemos.tcl do not compromise its long-standing ability to work without issues under plserver. So we are back in business with tkdemos.tcl under wish after many years when it did not work at all. @Maurice and Arjen: as Tcl/Tk experts here would you be willing to follow up on those two caveats to extend the current proof-of-concept to a smooth and complete result? 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 __________________________ |
From: Arjen M. <Arj...@de...> - 2013-11-06 08:36:49
|
Hi Alan, I can definitely have a look - it has been a rather busy period for me, but after this week it should be more relaxed. Regards, Arjen > -----Original Message----- > From: Alan W. Irwin [mailto:ir...@be...] > Sent: Tuesday, November 05, 2013 9:48 PM > To: Maurice LeBrun; Arjen Markus > Cc: PLplot development list > Subject: Re: [Plplot-devel] Pltk segfault > > On 2013-11-05 00:45-0800 Alan W. Irwin wrote: > > [...] > > % plstdwin . > > % plxframe .plw > > > > segfaults with the Debian versions of Tcl/Tk8.5 and itcl... version 3. > > I discovered by comparison with examples/tk/runAllDemos.tcl that the source of this > issue (I am pretty sure, but I would appreciate confirmation from Maurice) is that you > should use plframe rather than plxframe inside a wish environment. Accordingly I > made the appropriate change in the tkdemos.tcl logic (revision 12663) and with two > caveats ([1] a pretty rough logic hack that only works if you follow the > examples/tk/README.tkdemos instructions religiously, and [2] a lack of access to > libplplotd constants such as $::PLPLOT::PL_PI [namespace > issues???]) I now have tkdemos.tcl working under wish. For example, the 10th and > 12th examples work fine since they do not require libplplotd constants. These > changes to tkdemos.tcl do not compromise its long-standing ability to work without > issues under plserver. > > So we are back in business with tkdemos.tcl under wish after many years when it did > not work at all. > > @Maurice and Arjen: as Tcl/Tk experts here would you be willing to follow up on > those two caveats to extend the current proof-of-concept to a smooth and complete > result? > > 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 > __________________________ DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail. |
From: Maurice L. <mj...@br...> - 2013-11-07 03:59:36
|
That would be great Arjen, as unfortunately I'd find it difficult to commit to anything right now. Maurice On Wednesday, November 6, 2013 at 08:36:40 (+0000) Arjen Markus writes: > Hi Alan, > > I can definitely have a look - it has been a rather busy period for me, but after this week > it should be more relaxed. > > Regards, > > Arjen > > > -----Original Message----- > > From: Alan W. Irwin [mailto:ir...@be...] > > Sent: Tuesday, November 05, 2013 9:48 PM > > To: Maurice LeBrun; Arjen Markus > > Cc: PLplot development list > > Subject: Re: [Plplot-devel] Pltk segfault > > > > On 2013-11-05 00:45-0800 Alan W. Irwin wrote: > > > > [...] > > > % plstdwin . > > > % plxframe .plw > > > > > > segfaults with the Debian versions of Tcl/Tk8.5 and itcl... version 3. > > > > I discovered by comparison with examples/tk/runAllDemos.tcl that the source of this > > issue (I am pretty sure, but I would appreciate confirmation from Maurice) is that you > > should use plframe rather than plxframe inside a wish environment. Accordingly I > > made the appropriate change in the tkdemos.tcl logic (revision 12663) and with two > > caveats ([1] a pretty rough logic hack that only works if you follow the > > examples/tk/README.tkdemos instructions religiously, and [2] a lack of access to > > libplplotd constants such as $::PLPLOT::PL_PI [namespace > > issues???]) I now have tkdemos.tcl working under wish. For example, the 10th and > > 12th examples work fine since they do not require libplplotd constants. These > > changes to tkdemos.tcl do not compromise its long-standing ability to work without > > issues under plserver. > > > > So we are back in business with tkdemos.tcl under wish after many years when it did > > not work at all. > > > > @Maurice and Arjen: as Tcl/Tk experts here would you be willing to follow up on > > those two caveats to extend the current proof-of-concept to a smooth and complete > > result? > > > > 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 > > __________________________ > > DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail. |