Menu

#1426 Segfault in perl scripting engine.

closed-fixed
nobody
None
5
2010-08-11
2010-01-26
Anonymous
No

Sample code follows description. Perl.so crashes with a segfault on the following conditions: a variable has a timer hook assigned to it. That hook is unhooked and a second timer hook is assigned to it. The second hook is unhooked and the variable is undefined. Immediately following the undef is the end of the function.

uname -a: Linux oberus 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 17:01:44 UTC 2009 x86_64 GNU/Linux
Xchat version: 2.8.6-4ubuntu2
Perl version: v5.10.0 built for x86_64-linux-gnu-thread-multi
Sample code:

use strict;
use warnings;
use Xchat;

my $hook;

Xchat::register("A testing bot", "0.0", "testbot");
$hook = Xchat::hook_timer(1000, "my_sub1");

sub my_sub1 {
Xchat::unhook($hook);
Xchat::print("unhooked first");
$hook = Xchat::hook_timer(1000, "my_sub2");
Xchat::print("unhooked second");
}

sub my_sub2 {
Xchat::unhook($hook);
Xchat::print("unhooked second");
undef $hook;
}

###########################################
HOWEVER, the following does *not* crash
###########################################

use strict;
use warnings;
use Xchat;

my $hook;

Xchat::register("A testing bot", "0.0", "testbot");
$hook = Xchat::hook_timer(1000, "my_sub1");

sub my_sub1 {
Xchat::unhook($hook);
Xchat::print("unhooked first");
$hook = Xchat::hook_timer(1000, "my_sub2");
Xchat::print("unhooked second");
}

sub my_sub2 {
Xchat::unhook($hook);
Xchat::print("unhooked second");
undef $hook;
Xchat::print("undefined hook");
}

Discussion

  • Lian Wan Situ

    Lian Wan Situ - 2010-01-26

    This has already been fixed in SVN by r1305

     
  • Peter Zelezny.

    Peter Zelezny. - 2010-05-16
    • status: open --> open-fixed
     
  • Brian Evans

    Brian Evans - 2010-08-11
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.