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 when trying to message myself #1488

Closed
mdosch opened this issue Feb 18, 2021 · 6 comments
Closed

Segfault when trying to message myself #1488

mdosch opened this issue Feb 18, 2021 · 6 comments
Assignees
Labels
Milestone

Comments

@mdosch
Copy link
Contributor

mdosch commented Feb 18, 2021

I tried to message myself (the JID which is also used with profanity).

Thread 1 "profanity" received signal SIGSEGV, Segmentation fault.
sv_ev_incoming_message (message=0x5555557f2070) at src/event/server_events.c:603
603	            looking_for_jid = message->to_jid->barejid;
(gdb) bt full
#0  sv_ev_incoming_message (message=0x5555557f2070) at src/event/server_events.c:603
        mybarejid = 0x5555557c5f80 "martin@mdosch.de"
        new_win = 0
        chatwin = 0x5555562f7040
        looking_for_jid = 0x5555557e3340 "martin@mdosch.de"
#1  0x00005555555a0b8d in _handle_chat (stanza=0x555561c59c10, is_mam=1, is_carbon=0, result_id=0x555561916d80 "2021-02-12-c72f5653c9ad2775", timestamp=0x5555562f6a00) at src/xmpp/message.c:1350
        mucuser = 0x0
        body = 0x55555f1b2b30
        from = 0x55555ff08970 "martin@mdosch.de/Conversations.4YCW"
        jid = 0x555561fab090
        message = 0x5555557f2070
        to = 0x0
        id = 0x555561c5b0c0 "98192251-a677-4934-a9b6-c9a167e8e123"
        replace_id_stanza = 0x0
        encrypted = 0x0
        ox = 0x0
#2  0x00005555555a0dc6 in _handle_mam (stanza=0x5555619160b0) at src/xmpp/message.c:1414
        result = 0x55555e4a18e0
        forwarded = 0x5555622e2ea0
        result_id = 0x555561916d80 "2021-02-12-c72f5653c9ad2775"
        timestamp = 0x5555562f6a00
        message_stanza = 0x555561c59c10
#3  0x000055555559e32c in _message_handler (conn=0x555556276f00, stanza=0x5555619160b0, userdata=0x555556253c00) at src/xmpp/message.c:174
        conference = 0x55555617f370
        mucuser = 0x55555e4a18e0
        captcha = 0x28
        receipts = 0x7ffff67a3ca6
        event = 0x7fffffffcb90
        msg_stanza = 0x7ffff67ad130 <xmpp_stanza_get_child_by_ns+48>
        is_carbon = 0
        carbons = 0x7fffffffcc50
        type = 0x0
#4  0x00007ffff67a30cd in ?? () from target:/lib/x86_64-linux-gnu/libstrophe.so.0
No symbol table info available.
#5  0x00007ffff679fc8b in ?? () from target:/lib/x86_64-linux-gnu/libstrophe.so.0
No symbol table info available.
#6  0x00007ffff67ae93f in ?? () from target:/lib/x86_64-linux-gnu/libstrophe.so.0
No symbol table info available.
#7  0x00007ffff61a144a in doContent (parser=parser@entry=0x5555561a8e20, startTagLevel=startTagLevel@entry=0, enc=<optimized out>, s=<optimized out>, end=<optimized out>, nextPtr=0x5555561a8e50, haveMore=1 '\001')
    at ../../src/lib/xmlparse.c:2864
        localPart = <optimized out>
        prefix = <optimized out>
        uri = <optimized out>
        len = <optimized out>
        rawName = 0x555556489bd5 "message><message to='martin@mdosch.de/OO5A4l2L'><result xmlns='urn:xmpp:mam:2' id='2021-02-12-6ece97a4c7485a01'><forwarded xmlns='urn:xmpp:forward:0'><delay stamp='2021-02-12T13:34:46Z' xmlns='urn:xmp"...
        tag = 0x555556236780
        next = 0x555556489bdd "<message to='martin@mdosch.de/OO5A4l2L'><result xmlns='urn:xmpp:mam:2' id='2021-02-12-6ece97a4c7485a01'><forwarded xmlns='urn:xmpp:forward:0'><delay stamp='2021-02-12T13:34:46Z' xmlns='urn:xmpp:delay'"...
        tok = <optimized out>
        dtd = 0x5555561e6a90
        eventPP = 0x5555561a9040
        eventEndPP = 0x5555561a9048
#8  0x00007ffff61a21ac in contentProcessor (parser=0x5555561a8e20, start=<optimized out>, end=<optimized out>, endPtr=<optimized out>) at ../../src/lib/xmlparse.c:2464
        result = <optimized out>
#9  0x00007ffff61a4801 in XML_ParseBuffer (parser=0x5555561a8e20, len=4096, isFinal=0) at ../../src/lib/xmlparse.c:1912
        start = <optimized out>
        result = XML_STATUS_OK
#10 0x00007ffff67a2a08 in xmpp_run_once () from target:/lib/x86_64-linux-gnu/libstrophe.so.0
No symbol table info available.
#11 0x0000555555596cc0 in connection_check_events () at src/xmpp/connection.c:121
No locals.
#12 0x0000555555596198 in session_process_events () at src/xmpp/session.c:265
        reconnect_sec = -469766343
        conn_status = JABBER_CONNECTED
#13 0x000055555558f926 in prof_run (log_level=0x5555556551ca "WARN", account_name=0x0, config_file=0x0, log_file=0x0, theme_name=0x0) at src/profanity.c:130
        line = 0x0
#14 0x0000555555628629 in main (argc=1, argv=0x7fffffffe138) at src/main.c:185
        entries = {{long_name = 0x5555556551cf "version", short_name = 118 'v', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x5555556dba58 <version>, description = 0x5555556551d7 "Show version information", arg_description = 0x0}, {
            long_name = 0x5555556551f0 "account", short_name = 97 'a', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556dba70 <account_name>, description = 0x5555556551f8 "Auto connect to an account on startup", 
            arg_description = 0x0}, {long_name = 0x55555565521e "log", short_name = 108 'l', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556dba60 <log>, 
            description = 0x555555655228 "Set logging levels, DEBUG, INFO, WARN (default), ERROR", arg_description = 0x55555565525f "LEVEL"}, {long_name = 0x555555655265 "config", short_name = 99 'c', flags = 0, 
            arg = G_OPTION_ARG_STRING, arg_data = 0x5555556dba78 <config_file>, description = 0x555555655270 "Use an alternative configuration file", arg_description = 0x0}, {long_name = 0x555555655296 "logfile", short_name = 102 'f', 
            flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556dba68 <log_file>, description = 0x55555565529e "Specify log file", arg_description = 0x0}, {long_name = 0x5555556552af "theme", short_name = 116 't', flags = 0, 
            arg = G_OPTION_ARG_STRING, arg_data = 0x5555556dba80 <theme_name>, description = 0x5555556552b5 "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 = 0x555555707520

Expected Behavior

I message myself sometimes to share some info or links between different devices. I expected to be able to message myself.

Current Behavior

After opening the chatwindow /msg MY_JID profanity crashes.

Environment

  • Debian Testing
Profanity, version 0.10.0dev.master.5c5c4532
Copyright (C) 2012 - 2019 James Booth <boothj5web@gmail.com>.
Copyright (C) 2019 - 2021 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.14.0-unknown)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Enabled (3.9.1+)
GTK icons: Enabled

@jubalh jubalh added the bug label Feb 18, 2021
@jubalh jubalh added this to the 0.11.0 milestone Feb 18, 2021
@jubalh
Copy link
Member

jubalh commented Feb 26, 2021

Using 5c5c453, both /msg MY_JID and /msg MY_JID hi result for me in:

26/02/21 17:59:00 - me: hi
26/02/21 17:59:00 - me: hi

Anything special you are using?

@mdosch
Copy link
Contributor Author

mdosch commented Feb 26, 2021 via email

@jubalh
Copy link
Member

jubalh commented Mar 5, 2021

I just tried to message myself today. This time with OMEMO enabled. Again didn't segfault.

I forgot to mention it here. But I remembered that I restored
Conversations from a backup before this happened. Don't know if this
could play a role in regards to outdated OMEMO keys or something.

@StefanKropp do you have an idea reagarding this part?

@jubalh
Copy link
Member

jubalh commented Mar 5, 2021

looking_for_jid = message->to_jid->barejid; is actually run if its a MAM message.

@jubalh
Copy link
Member

jubalh commented Mar 5, 2021

@StefanKropp nevermind. I think it's not a OMEMO problem but a mistake I made.

jubalh added a commit that referenced this issue Mar 5, 2021
Regards #1488

Actually I would have loved to see the stanza that caused the segfault
since I'm not entirely sure whether this actually means that we do
something wrong earlier on.

Right now I don't know why the to_jid should be empty.

Let's prevent the segfault for now and see whether we get further
bugreports later.

Segfaulting issue got introduced with dd566d8.
@jubalh jubalh self-assigned this Mar 5, 2021
@jubalh
Copy link
Member

jubalh commented Mar 5, 2021

If you ever do something similar please check whether it works as expected or whether a wrong window will be opened.

@jubalh jubalh closed this as completed Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants