irssi-import / bugs.irssi.org

bugs.irssi.org archive
https://github.com/irssi/irssi/issues
0 stars 0 forks source link

Segfault on "gui print text finished" signal and "Irssi::UI::Window::view" subroutine. #899

Open irssibot opened 10 years ago

irssibot commented 10 years ago

When function handling "gui print text finished" or "gui print text" signal calls "Irssi::UI::Window::view()" function Irssi crashes with segmentation fault. See test.pl for example.

Further more after it crashes all calls to the view() function will fail with "Undefined subroutine" Perl error. This also breaks scripts that were working fine before and are calling the view(). The point is the segfault broke something permanently.

To reproduce: ulimit -c unlimited

 mkdir -p ~/.irssi_test/scripts
 cp test.pl ~/.irssi_test/scripts
 irssi --home=~/.irssi_test
 /run test.pl

 gdb irssi core
 set logging file bt.log
 set logging on
 bt
 set logging off
 quit
irssibot commented 10 years ago

test.pl

use strict;
use warnings;
use vars qw($VERSION %IRSSI);

$VERSION = '1.0';
%IRSSI = (
    authors     => '',
    name        => '',
    description => '',
    license     => '',
    url         => ''
);

sub on_scrolling {
    my $window = Irssi::active_win();
    my $view = Irssi::UI::Window::view($window);
}

Irssi::signal_add('gui print text finished', \&on_scrolling);
#Irssi::signal_add('gui print text', \&on_scrolling);
irssibot commented 10 years ago

bt.log

GNU gdb (GDB) 7.6 (Debian 7.6-5)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/irssi...(no debugging symbols found)...done.
[New LWP 12629]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Core was generated by `irssi --home=~/.irssi_test'.
Program terminated with signal 11, Segmentation fault.
#0  0x00062ad4 in g_istr_hash ()
(gdb) set logging file bt.log
(gdb) set logging on
Copying output to bt.log.
(gdb) bt
#0  0x00062ad4 in g_istr_hash ()
#1  0x402d2ece in g_hash_table_lookup () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
#2  0x0003e9f0 in format_get_text_theme_charargs ()
#3  0x0003ebf2 in format_get_text_theme_args ()
#4  0x0003ec0c in format_get_text_theme ()
#5  0x0003edfc in format_get_line_start ()
#6  0x00041aea in ?? ()
#7  0x00041aea in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) set logging off
Done logging to bt.log.
(gdb) quit