profanity-im / profanity

Ncurses based XMPP client
https://profanity-im.github.io/
Other
1.32k stars 185 forks source link

profanity 0.12 crashes upon /sendfile #1679

Closed omar-polo closed 2 years ago

omar-polo commented 2 years ago

Hello,

Yesterday I've updated profanity to 0.12. In previous versions of profanity the /sendfile command didn't work for me, it was stuck at 0% all the time, but after the update it actually segfaults.

It doesn't seem to matter if OMEMO is enabled or not for the current chat, /sendfile <path> always crashes regardless of omemo.

I'm using my own custom prosody server, but other xmpp clients (conversations, dino) don't have problems with sending and receiving files. I'm using the prosody new module (introduced in 0.12 -- yep, profanity and prosody have the same version now!) mod_http_file_share. Conversations shows that XEP-0363 "HTTP File Upload" is enabled and has a maximum of 20MiB. The files I tried to send from profanity were way below this limit. I'm using TLS to connect to the server.

Here's the backtrace:

(gdb) bt
#0  strcmp () at /usr/src/lib/libc/arch/amd64/string/strcmp.S:59
#1  0x000004097999fad5 in http_file_put (userdata=0x40b99aeb380)
    at /home/_pobj/profanity-0.12.0/profanity-0.12.0/src/tools/http_upload.c:190
#2  0x0000040c4c504421 in _rthread_start (v=<optimized out>)
    at /usr/src/lib/librthread/rthread.c:96
#3  0x0000040bd597138a in __tfork_thread ()
    at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:84
(gdb) f 1
#1  0x000004097999fad5 in http_file_put (userdata=0x40b99aeb380)
    at /home/_pobj/profanity-0.12.0/profanity-0.12.0/src/tools/http_upload.c:190
190         gboolean insecure = strcmp(account->tls_policy, "trust") == 0;
(gdb) p account->tls_policy
$1 = (gchar *) 0x0
(gdb) p *account
$2 = {name = 0x40c32f1b670 "me", jid = 0x40c32f19ce0 "<redacted>",
  password = 0x40c32f33160 "<redacted>", eval_password = 0x0,
  resource = 0x40c32f1c4b0 "home", server = 0x0, port = 0,
  last_presence = 0x40c32f1b930 "online",
  login_presence = 0x40c32f1bdd0 "online", priority_online = 0,
  priority_chat = 0, priority_away = 0, priority_xa = 0, priority_dnd = 0,
  muc_service = 0x40c32f196e0 "<redacted>",
  muc_nick = 0x40c32f20dc0 "op", enabled = 1, otr_policy = 0x0,
  otr_manual = 0x0, otr_opportunistic = 0x0, otr_always = 0x0,
  omemo_policy = 0x0, omemo_enabled = 0x40c35e06b00,
  omemo_disabled = 0x40c4516ee20, pgp_keyid = 0x0, startscript = 0x0,
  theme = 0x0, tls_policy = 0x0, auth_policy = 0x0}

environment:

% uname -a
OpenBSD venera 7.1 GENERIC.MP#448 amd64
% profanity -v
Profanity, version 0.12.0
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: Disabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.17.1)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Disabled
GTK icons/clipboard: Disabled
% pkg_info | grep '^glib2-'
glib2-2.70.5        general-purpose utility library
jubalh commented 2 years ago

Fixed in https://github.com/profanity-im/profanity/commit/f11ad1671449f0c83ce28f0cd67af87ca4a585e5 Profanity 0.12.1 should come next week.

If you have time you could test if it works with the above mentioned patch.

omar-polo commented 2 years ago

Yes, it works now. I'm able to send files from profanity finally, thanks a lot!