Skip to content
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

Segfault while using "/ox discover" #1713

Closed
mdosch opened this issue May 26, 2022 · 0 comments · Fixed by #1715
Closed

Segfault while using "/ox discover" #1713

mdosch opened this issue May 26, 2022 · 0 comments · Fixed by #1715
Labels
Milestone

Comments

@mdosch
Copy link
Contributor

mdosch commented May 26, 2022

When doing "/ox discover certain_jid" profanity segfaults. Maybe the pubsub node for this certain jid is misconfigured. I will tell you the jid in private.

Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
74	../sysdeps/x86_64/multiarch/strlen-avx2.S: Datei oder Verzeichnis nicht gefunden.
(gdb) bt full
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
No locals.
#1  0x00005555555b1955 in _ox_metadata_result (stanza=0x55555ce959a0, userdata=0x0) at src/xmpp/ox.c:328
        fingerprint = 0x0
        pubsub = 0x55555c820d90
        items = 0x55555c48f9c0
        item = 0x55555c493d30
        publickeyslist = 0x55555cb62730
        pubkeymetadata = 0x55555ce954e0
#2  0x000055555559821e in _iq_handler (conn=0x555555b08380, stanza=0x55555ce959a0, userdata=0x555555b07540) at src/xmpp/iq.c:231
        keep = 21845
        handler = 0x55555ce921e0
        text = 0x555555af7650 "gG`\003PU"
        text_size = 469
        cont = 1
        type = 0x55555ce92170 "result"
        discoinfo = 0x0
        discoitems = 0x0
        lastactivity = 0x0
        version = 0x0
        ping = 0x0
        roster = 0x0
        blocking = 0x0
        id = 0x55555be09080 "8E5tofCn6OygNw5013b0c11be7398f3150c924067f0060d001a88f7"
#3  0x00007ffff7700379 in ?? () from target:/lib/x86_64-linux-gnu/libstrophe.so.0
No symbol table info available.
#4  0x00007ffff76fdb7c in ?? () from target:/lib/x86_64-linux-gnu/libstrophe.so.0
No symbol table info available.
#5  0x00007ffff770bdbf in ?? () from target:/lib/x86_64-linux-gnu/libstrophe.so.0
No symbol table info available.
#6  0x00007ffff680d9e4 in doContent (parser=parser@entry=0x555555713c00, startTagLevel=startTagLevel@entry=0, enc=<optimized out>, s=<optimized out>, end=<optimized out>, nextPtr=0x555555713c30, haveMore=1 '\001', 
    account=XML_ACCOUNT_DIRECT) at ../../src/lib/xmlparse.c:3047
        localPart = <optimized out>
        prefix = <optimized out>
        uri = <optimized out>
        len = <optimized out>
        rawName = 0x5555563a9839 "iq><r xmlns='urn:xmpp:sm:3'/>='text-single' var='muc#roominfo_lang'><value>en</value></field><field type='text-single' var='muc#roominfo_description' label='Description'><value>Discussion venue for th"...
        tag = 0x55555623a620
        next = 0x5555563a983c "<r xmlns='urn:xmpp:sm:3'/>='text-single' var='muc#roominfo_lang'><value>en</value></field><field type='text-single' var='muc#roominfo_description' label='Description'><value>Discussion venue for the S"...
        tok = <optimized out>
        accountAfter = <optimized out>
        dtd = 0x555555b0ae10
        eventPP = <optimized out>
        eventEndPP = 0x555555713e28
#7  0x00007ffff680e7aa in contentProcessor (parser=0x555555713c00, start=<optimized out>, end=<optimized out>, endPtr=<optimized out>) at ../../src/lib/xmlparse.c:2612
        result = <optimized out>
#8  0x00007ffff6808cc1 in XML_ParseBuffer (parser=0x555555713c00, len=499, isFinal=0) at ../../src/lib/xmlparse.c:2009
        start = <optimized out>
        result = XML_STATUS_OK
#9  0x00007ffff76ffcd4 in xmpp_run_once () from target:/lib/x86_64-linux-gnu/libstrophe.so.0
No symbol table info available.
#10 0x0000555555595e78 in connection_check_events () at src/xmpp/connection.c:148
No locals.
#11 0x0000555555595021 in session_process_events () at src/xmpp/session.c:264
        reconnect_sec = -1106108698
        conn_status = JABBER_CONNECTED
#12 0x000055555558e4de in prof_run (log_level=0x55555565d2ef "WARN", account_name=0x0, config_file=0x0, log_file=0x0, theme_name=0x0) at src/profanity.c:131
        cont = 1
        line = 0x0
#13 0x000055555562dc31 in main (argc=1, argv=0x7fffffffe178) at src/main.c:180
        entries = {{long_name = 0x55555565d2f4 "version", short_name = 118 'v', flags = 0, arg = G_OPTION_ARG_NONE, 
            arg_data = 0x5555556e8300 <version>, description = 0x55555565d2fc "Show version information", 
            arg_description = 0x0}, {long_name = 0x55555565d315 "account", short_name = 97 'a', flags = 0, 
            arg = G_OPTION_ARG_STRING, arg_data = 0x5555556e8318 <account_name>, 
            description = 0x55555565d320 "Auto connect to an account on startup", arg_description = 0x0}, {
            long_name = 0x55555565d346 "log", short_name = 108 'l', flags = 0, arg = G_OPTION_ARG_STRING, 
            arg_data = 0x5555556e8308 <log>, 
            description = 0x55555565d350 "Set logging levels, DEBUG, INFO, WARN (default), ERROR", 
            arg_description = 0x55555565d387 "LEVEL"}, {long_name = 0x55555565d38d "config", short_name = 99 'c', 
            flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556e8320 <config_file>, 
            description = 0x55555565d398 "Use an alternative configuration file", arg_description = 0x0}, {
            long_name = 0x55555565d3be "logfile", short_name = 102 'f', flags = 0, arg = G_OPTION_ARG_STRING, 
            arg_data = 0x5555556e8310 <log_file>, description = 0x55555565d3c6 "Specify log file", 
            arg_description = 0x0}, {long_name = 0x55555565d3d7 "theme", short_name = 116 't', flags = 0, 
            arg = G_OPTION_ARG_STRING, arg_data = 0x5555556e8328 <theme_name>, 
            description = 0x55555565d3dd "Specify theme name", 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}}
        error = 0x0
        context = 0x5555557109d0

Expected Behavior

Do not segfault.

Current Behavior

Segfault,

Possible Solution

Steps to Reproduce (for bugs)

  1. /ox discover user@example.org

Environment

Debian Unstable

profanity -v
Profanity, version 0.12.1dev.master.b4523d6c
Copyright (C) 2012 - 2019 James Booth <boothj5web@gmail.com>.
Copyright (C) 2019 - 2022 Michael Vetter <jubalh@iodoru.org>.
License GPLv3+: GNU GPL version 3 or later <https://www.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.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.16.0-unknown)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Disabled
GTK icons/clipboard: Disabled
MarcoPolo-PasTonMolo added a commit to MarcoPolo-PasTonMolo/profanity that referenced this issue May 26, 2022
`/ox discover` segfaults on some misconfigured? nodes because there are
newlines before and after some pubkey-metadata stanzas so the newlines
get treated as seperate stanzas. This commit just skips each stanza in
public-keys-list that doesn't have a fingerprint.

Fixes profanity-im#1713
@jubalh jubalh added the bug label May 26, 2022
@jubalh jubalh added this to the 0.13.0 milestone May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants