UPDATE Dec 22, 2005 Nick Ing-Simmons( Perl/Tk authority) has said it would be cleaner to use
if( interp){ LangClientMessage(winPtr->mainPtr->interp, (Tk_Window) winPtr, eve +ntPtr); }

Hi, I first asked this question in Gtk2 apps are seg-faulting my Tk apps. It turned out that Gtk2 apps using the gtk+ lib at a version level greater than 2.8.0, would cause Perl/Tk apps to segfault, when a gtk button was clicked. This problem is becoming more widely noticed as people upgrade to newer distribution levels, which use > 2.8.6 level of the Gtk2 libs. The bug was reported in Tk report and Ubuntu report

Anyways, a possible fix may have been found if you experience it.

Change tkEvent.c line 989 from

LangClientMessage(winPtr->mainPtr->interp, (Tk_Window) winPtr, eventP +tr);
to
if (eventPtr && winPtr && winPtr->mainPtr) { LangClientMessage(winPtr->mainPtr->interp, (Tk_Window) winPtr, e +ventPtr); }

This fix has not been analyzed as to the ramifications it may have elsewhere in Tk, but it seems to work OK. Any comments on it's side effects, or improvements to it are welcome.

And of course, keeps your eyes and ears open for people complaining about Tk segfaulting, and point them to this. Thanks.


I'm not really a human, but I play one on earth. flash japh

In reply to Possible Tk segfault bugfix by zentara

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.