Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Segfault in Glib/Gtk2 script

by Discipulus (Canon)
on May 25, 2018 at 14:53 UTC ( [id://1215217]=note: print w/replies, xml ) Need Help??


in reply to Segfault in Glib/Gtk2 script

Ouch! I'm really curious to know what your program does..

my 2 neurocents (I'd send you a msg iinstead of a probably unuseful post,if you were a named user..): I read: In my opinion crash happens because of direct call of perl exit() in GTK signal handlers. from an ubuntu forum.

They tell about a bug not always reproducible depending on library versions: in linux have you already tried to upgrade underlying libraries?

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Segfault in Glib/Gtk2 script
by Anonymous Monk on May 25, 2018 at 15:20 UTC

    Ouch! I'm really curious to know what your program does..

    It's a telnet/MUD client. I'll be uploading the source code to CPAN as soon as this segfault is resolved.

    in linux have you already tried to upgrade underlying libraries?

    Yes, the problem on the Ubuntu forum you referenced does sound a lot like my issue. And replacing the 'exit' statement and using 'Gtk2->main_quit()' instead does indeed remove the segfault.

    (I had tried using both ->main_quit and exit together, unsuccesfully; it hadn't occured to me to remove 'exit' and keep ->main_quit).

      Hi, I'm a little rusty on the old Gtk stuff, but I just want to mention something that may help you further.

      You have to be careful with the return value of a delete_event, or any Gtk sub for that matter. Adding a 1 or 0 at the end of the sub can be needed sometimes.

      #These are different in a very subtle manner. $window->signal_connect( 'destroy', sub { Gtk2->main_quit() } ); $window->signal_connect(delete_event => sub { Gtk2->main_quit(); 1;});

      See Gtk delete_event for more details.

      From a previous problem like yours on the gtk maillist:


      Returns: TRUE to stop other handlers from being invoked for the
      event. FALSE to propagate the event further."

      .... a return of TRUE from the delete-event
      handler means "i handled this event, stop propagation."

      I'm not really a human, but I play one on earth. ..... an animated JAPH

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1215217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2024-04-23 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found