New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random crash #500

Closed
LemonBoy opened this Issue Jun 24, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@LemonBoy
Member

LemonBoy commented Jun 24, 2016

Reported by KindOne on irc.

gdb backtrace & script list are available.
The culprit is this line.

(edited to include logs in the ticket description)


Internet connection went a little crazy and I got this crash when znc was constantly reconnecting to networks.

irssi <---> localhost <---> znc <---> irc networks 
username@localhost ~ $ irssi -v
irssi 0.8.20-g1a6ec1b (20160518 1657)

username@localhost ~ $ znc -v
ZNC 1.7.x-git-611-b7309cd - http://znc.in
IPv6: yes, SSL: yes, DNS: threads, charset: yes, build: autoconf, i18n: no
Program received signal SIGSEGV, Segmentation fault.
__strchr_sse2_bsf () at ../sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S:97
97  ../sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: No such file or directory.
No locals.
#1  0x08087d51 in sig_nicklist_new (channel=0x8aa8160, nick=0x8aac738) at fe-messages.c:622
        firstnick = 0x8aace20
        newnick = <optimized out>
        nickhost = <optimized out>
        p = <optimized out>
        n = <optimized out>
#2  0x080d1713 in signal_emit_real (rec=rec@entry=0x81593f8, params=params@entry=3, va=<optimized out>, 
    va@entry=0xbffff3a8 "`\201\252\b Ϊ\bQV\252\b`\201\252\b", first_hook=0x81a4138) at signals.c:242
        arglist = {0x8aa8160, 0x8aace20, 0x8aa5651, 0x0, 0x0, 0x0}
        prev_emitted_signal = 0x818b610
        hook = 0x81a4138
        prev_emitted_hook = 0x818b630
        i = <optimized out>
        stopped = 0
        stop_emit_count = 0
        continue_emit_count = 0
        __func__ = "signal_emit_real"
#3  0x080d1bcb in signal_emit (signal=0x80e6d6e "nicklist changed", params=3) at signals.c:286
        rec = 0x81593f8
        va = 0xbffff3a8 "`\201\252\b Ϊ\bQV\252\b`\201\252\b"
        signal_id = <optimized out>
        __func__ = "signal_emit"
#4  0x080c943d in nicklist_rename_list (new_nick_id=new_nick_id@entry=0x0, old_nick=old_nick@entry=0x8aa5651 "KindOne_", 
    new_nick=new_nick@entry=0x89eaa59 "KindOne", nicks=0x94ede48, server=<optimized out>) at nicklist.c:149
        channel = 0x8aa8160
        nickrec = 0x8aace20
        tmp = 0x94ede48
#5  0x080c948b in nicklist_rename (server=0x94ede48, old_nick=0x8aa5651 "KindOne_", new_nick=0x89eaa59 "KindOne") at nicklist.c:157
No locals.
#6  0x080a3488 in event_nick (server=0x844a1f0, data=0x90b9673 ":KindOne", orignick=0x8aa5651 "KindOne_") at irc-nicklist.c:403
        params = 0x89eaa58 ":KindOne"
        nick = 0x89eaa59 "KindOne"
        __func__ = "event_nick"
#7  0x080d1713 in signal_emit_real (rec=rec@entry=0x818b610, params=params@entry=4, va=<optimized out>, 
    va@entry=0xbffff4c8 "\360\241D\bs\226\v\tQV\252\bZV\252\b", first_hook=0x818b630) at signals.c:242
        arglist = {0x844a1f0, 0x90b9673, 0x8aa5651, 0x8aa565a, 0x0, 0x0}
        prev_emitted_signal = 0x8189418
        hook = 0x818b630
        prev_emitted_hook = 0x818f508
        i = <optimized out>
        stopped = 0
        stop_emit_count = 0
        continue_emit_count = 0
        __func__ = "signal_emit_real"
#8  0x080d1bcb in signal_emit (signal=0x90b9668 "event nick", params=4) at signals.c:286
        rec = 0x818b610
---Type <return> to continue, or q <return> to quit---
        va = 0xbffff4c8 "\360\241D\bs\226\v\tQV\252\bZV\252\b"
        signal_id = <optimized out>
        __func__ = "signal_emit"
#9  0x0809d7fb in irc_server_event (server=0x844a1f0, line=0x8aa566a "NICK :KindOne", nick=0x8aa5651 "KindOne_", 
    address=0x8aa565a "KindOne@0.0.0.0") at irc.c:308
        signal = <optimized out>
        event = 0x90b9668 "event nick"
        args = 0x90b9673 ":KindOne"
        __func__ = "irc_server_event"
#10 0x080d1713 in signal_emit_real (rec=rec@entry=0x8189418, params=params@entry=4, va=<optimized out>, 
    va@entry=0xbffff5a8 "\360\241D\bjV\252\bQV\252\bZV\252\b", first_hook=0x818f508) at signals.c:242
        arglist = {0x844a1f0, 0x8aa566a, 0x8aa5651, 0x8aa565a, 0x0, 0x0}
        prev_emitted_signal = 0x818f538
        hook = 0x818f508
        prev_emitted_hook = 0x818f558
        i = <optimized out>
        stopped = 0
        stop_emit_count = 0
        continue_emit_count = 0
        __func__ = "signal_emit_real"
#11 0x080d1c21 in signal_emit_id (signal_id=95, params=4) at signals.c:304
        rec = 0x8189418
        va = 0xbffff5a8 "\360\241D\bjV\252\bQV\252\bZV\252\b"
        __func__ = "signal_emit_id"
#12 0x0809d674 in irc_parse_incoming_line (server=0x844a1f0, line=<optimized out>) at irc.c:362
        nick = 0x8aa5651 "KindOne_"
        address = 0x8aa565a "KindOne@0.0.0.0"
        __func__ = "irc_parse_incoming_line"
#13 0x080d1713 in signal_emit_real (rec=rec@entry=0x818f538, params=params@entry=2, va=<optimized out>, 
    va@entry=0xbffff668 "\360\241D\bPV\252\b(\265\030\bPV\252\b\001", first_hook=0x818f558) at signals.c:242
        arglist = {0x844a1f0, 0x8aa5650, 0x0, 0x0, 0x0, 0x0}
        prev_emitted_signal = 0x0
        hook = 0x818f558
        prev_emitted_hook = 0x0
        i = <optimized out>
        stopped = 0
        stop_emit_count = 0
        continue_emit_count = 0
        __func__ = "signal_emit_real"
#14 0x080d1c21 in signal_emit_id (signal_id=203, params=2) at signals.c:304
        rec = 0x818f538
        va = 0xbffff668 "\360\241D\bPV\252\b(\265\030\bPV\252\b\001"
        __func__ = "signal_emit_id"
#15 0x0809d974 in irc_parse_incoming (server=0x844a1f0) at irc.c:383
        str = 0x8aa5650 ":KindOne_"
        count = 2
        ret = <optimized out>
        server = 0x844a1f0
---Type <return> to continue, or q <return> to quit---
        count = 0
        ret = 0
#16 0x080c43e8 in irssi_io_invoke (source=0x888eca8, condition=G_IO_IN, data=0x844ad58) at misc.c:55
        rec = 0x844ad58
        icond = <optimized out>
#17 0xb7c56a9e in g_io_unix_dispatch (source=0x865a370, callback=0x80c43a0 <irssi_io_invoke>, user_data=0x844ad58)
    at /build/glib2.0-YzaC_a/glib2.0-2.48.1/./glib/giounix.c:165
        func = 0x80c43a0 <irssi_io_invoke>
        watch = 0x865a370
        buffer_condition = <optimized out>
#18 0xb7c0fd8b in g_main_dispatch (context=0x8158d00) at /build/glib2.0-YzaC_a/glib2.0-2.48.1/./glib/gmain.c:3154
        dispatch = 0xb7c56a60 <g_io_unix_dispatch>
        prev_source = 0x0
        was_in_call = 0
        user_data = 0x844ad58
        callback = 0x80c43a0 <irssi_io_invoke>
        cb_funcs = <optimized out>
        cb_data = 0x865a3c8
        need_destroy = <optimized out>
        source = 0x865a370
        current = 0x860cdb0
        i = 0
#19 g_main_context_dispatch (context=0x8158d00) at /build/glib2.0-YzaC_a/glib2.0-2.48.1/./glib/gmain.c:3769
No locals.
#20 0xb7c10179 in g_main_context_iterate (context=context@entry=0x8158d00, block=block@entry=1, dispatch=dispatch@entry=1, 
    self=<optimized out>) at /build/glib2.0-YzaC_a/glib2.0-2.48.1/./glib/gmain.c:3840
        max_priority = 2147483647
        timeout = 551
        some_ready = 1
        nfds = 19
        allocated_nfds = <optimized out>
        fds = <optimized out>
#21 0xb7c10244 in g_main_context_iteration (context=0x8158d00, may_block=1) at /build/glib2.0-YzaC_a/glib2.0-2.48.1/./glib/gmain.c:3901
        retval = <optimized out>
#22 0x0805a9c3 in main (argc=1, argv=0xbffff914) at irssi.c:336
        version = 0
        options = {{long_name = 0x80e2683 "dummy", short_name = 100 'd', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x8152d18 <dummy>, 
            description = 0x80e2689 "Use the dummy terminal mode", arg_description = 0x0}, {long_name = 0x80e4cea "version", 
            short_name = 118 'v', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x8152d0c <version>, 
            description = 0x80e26a5 "Display irssi version", arg_description = 0x0}, {long_name = 0x0, short_name = 0 '\000', flags = 0, 
            arg = G_OPTION_ARG_NONE, arg_data = 0x0, description = 0x0, arg_description = 0x0}}
        loglev = <optimized out>
(gdb)
16:05:20 Loaded scripts:
16:05:20 clones          /home/jj/.irssi/scripts/autorun/clones.pl
16:05:20 nicklist        /home/jj/.irssi/scripts/autorun/nicklist.pl
16:05:20 dispatch        /home/jj/.irssi/scripts/autorun/dispatch.pl
16:05:20 mirc_colour_popup /home/jj/.irssi/scripts/autorun/mirc_colour_popup.pl
16:05:20 chansort        /home/jj/.irssi/scripts/autorun/chansort.pl
16:05:20 bansearch       /home/jj/.irssi/scripts/autorun/bansearch.pl
16:05:20 showhilight     /home/jj/.irssi/scripts/autorun/showhilight.pl
16:05:20 cron            /home/jj/.irssi/scripts/autorun/cron.pl
16:05:20 word_replace    /home/jj/.irssi/scripts/autorun/word-replace.pl
16:05:20 format_quiet    /home/jj/.irssi/scripts/autorun/format_quiet.pl
16:05:20 trigger         /home/jj/.irssi/scripts/autorun/trigger.pl
16:05:20 autowhois       /home/jj/.irssi/scripts/autorun/autowhois.pl
16:05:20 bantime         /home/jj/.irssi/scripts/autorun/bantime.pl

https://dl.dropboxusercontent.com/u/16148324/irssi/scripts.tar

@LemonBoy LemonBoy added the bug label Jun 25, 2016

@ailin-nemui

This comment has been minimized.

Contributor

ailin-nemui commented Jun 25, 2016

hard for me to see what's going on here. is the core still available? what was the content of the nick struct of frame 1?

@ailin-nemui

This comment has been minimized.

Contributor

ailin-nemui commented Aug 12, 2016

ok upon further static analysis I can see that if it were to take code path https://github.com/irssi/irssi/blob/master/src/fe-common/core/fe-messages.c#L613 then it may be possible that the host is NULL. so should the check https://github.com/irssi/irssi/blob/master/src/fe-common/core/fe-messages.c#L606-L607 simply be moved down or is further analysis needed? can ownnick be without host? (probably yes right after connect)

@ailin-nemui

This comment has been minimized.

Contributor

ailin-nemui commented Sep 29, 2016

please reopen if you have more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment