Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Possible Tk segfault bugfix

by zentara (Cardinal)
on Dec 18, 2005 at 11:28 UTC ( [id://517590]=perlmeditation: print w/replies, xml ) Need Help??

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

Replies are listed 'Best First'.
Re: Possible Tk segfault bugfix
by tinita (Parson) on Dec 21, 2005 at 17:36 UTC
    thank you very much for this article.

    i couldn't test it so far, and i have to wail till next year, but i'm pretty sure that it's exactly the problem that i experienced (tk script crashing when i open a gnome application; after i updated to ubuntu 'breezy')

    when i realized the problem i searched for other bug reports but found only one in a closed forum where i couldn't post without an account.

      Your welcome. Actually it was a fellow named Ben Crowell, who solved it. He saw the bug on Ubuntu and complained in comp.lang.perl.tk. I mentioned that I saw this bug myself, and pointed him to my debug output. He came up with the fix. Currently Nick Ing-Simmons is looking at it, and will probably issue a patch.

      I also am glad it's fixed. I was getting awfully tired of having to restart my Tk apps.


      I'm not really a human, but I play one on earth. flash japh
Re: Possible Tk segfault bugfix
by demerphq (Chancellor) on Dec 19, 2005 at 13:05 UTC

    Have you reported this elsewhere? A lot of module authors get pissed whe bugreports and fixes come to PM but not to them.

    ---
    $world=~s/war/peace/g

      Yeah, this has been reported to the Tk author, Nick Ing-Simmons. But either he is on holiday, working on something else, or confused by the myriad levels of Gtk2 libs. :-)

      He actually proposed the direction of the fix, but a fellow from the Ubuntu group, and myself, made the "educated guesses".

      From my experience with linux users, most of them will not look (or find) where bugs are reported on CPAN. They will ask in newsgroups or maillists for answers.


      I'm not really a human, but I play one on earth. flash japh
Re: Possible Tk segfault bugfix
by zentara (Cardinal) on Dec 22, 2005 at 12:32 UTC
    If any of you are following this, see the UPDATE in the original node.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://517590]
Approved by marto
Front-paged by ybiC
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-12-08 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (50 votes). Check out past polls.