EionRobb / purple-pulsesms

GNU General Public License v3.0
21 stars 2 forks source link

Crash with Bitlbee on connection #9

Open uriel1998 opened 2 years ago

uriel1998 commented 2 years ago

I'm getting a crash on login after updating my debian system. Oddly, the full on crash only happens with bitlbee; if I use pidgin it connects, and will send messages, but I'm not recieving any on my end. Crashlog from bitlbee attached; not sure how much help that is. I've rebuilt the plugin locally, redone the account entirely from scratch, so I'm not entirely sure what changed (there were a bunch of things in my last apt upgrade).

crash.log

EionRobb commented 2 years ago

Sorry about the crashing :( Unfortunately the backtrace isn't much help as it doesn't have debugging symbols (compile with -ggdb) so it's not really pointing to where the crash is other than "somewhere in the pulsesms plugin"

uriel1998 commented 2 years ago

Okay, so to make sure I understand this properly: To effectively debug I should rebuild bitlbee from source instead of the Debian package, compile it with make -ggdb, and then give it a go? I got GDB to spit out something that may be useful to you... gdboutput.txt

uriel1998 commented 2 years ago

Valgrind output and gdb backtrace of the coredump valgrind.log valgrind-backtrace.txt

EionRobb commented 2 years ago

Doesn't look like valgrind managed to run successfully (valgrind itself is crashing, not bitlbee/the plugin), but yeah, compiling the plugin from source would be a good way to get the debug symbols in there, or there might have been a -dbg debian package? (I dont think those are very common nowadays)

Probably should have linked you to https://wiki.bitlbee.org/DebuggingCrashes which has some helpful info, particularly

Otherwise, if you happen to have a coredump file, you can open it in gdb like this (assuming it's called core.1234) gdb -ex bt bitlbee core.1234 which would have talked about how to use the existing core dump.

Sadly, the gdboutput.txt still doesn't have the debugging info in there, again it's just saying that it's "somewhere in libpulsesms.so" that its crashing, although slightly more helpfully it says when calling strlen() which could point to one of three places, including during the login step.

Is it crashing as soon as you connect to the account? If you look in the accounts.xml file that bitlbee creates (I'm not too sure where bitlbee creates that though, sorry), does it have anything about "account_id" and "salt" as empty/null strings?

simonpatap0n commented 2 years ago

i have the same issue.

it is crashing as soon as it connects.

I did recompile bitlbee with ./configure --debug=1 --purple=1

do i have to compile the plugin with special flags also?

all my XML files dont have account id/salt /var/lib/bitlbee/purple/Disc0rd/accounts.xml /var/lib/bitlbee/purple/Inst4gram/accounts.xml /var/lib/bitlbee/purple/M4trix/accounts.xml /var/lib/bitlbee/purple/IQC/accounts.xml /var/lib/bitlbee/purple/pulSe/accounts.xml /var/lib/bitlbee/purple/sl4ck/accounts.xml

<?xml` version='1.0' encoding='UTF-8' ?>
<account version='1.0'/>

i will try to post debug thank you for your plugins!!

simonpatap0n commented 2 years ago

I am very new to this

https://pastebin.com/M98LvkBG

uriel1998 commented 2 years ago

Is it crashing as soon as you connect to the account? If you look in the accounts.xml file that bitlbee creates (I'm not too sure where bitlbee creates that though, sorry), does it have anything about "account_id" and "salt" as empty/null strings?

They're in /var/lib/bitlbee by default; the purple specific xml are in /var/lib/bitlbee/purple/accountname.

This is bitlbee's user.xml for that account

<user password="STRINGIREMOVED" nick="ssaus" version="1">
    <setting name="last_version">198144</setting>
    <setting name="private">false</setting>
    <account protocol="eionrobb-pulsesms" handle="steven@stevesaus.com" password="STRINGIREMOVED" autoconnect="false" tag="eionrobb-pulsesms"/>
    <channel name="&amp;bitlbee" type="control">
        <setting name="auto_join">true</setting>
    </channel>
</user>

And the three in the /purple specific all appear to be default values (see attached, renamed to TXT so they'd upload). Checking if taking the pidgin account and pasting it in for bitlbee works first.

accounts.txt blist.txt prefs.txt

uriel1998 commented 2 years ago

Doesn't look like valgrind managed to run successfully (valgrind itself is crashing, not bitlbee/the plugin), but yeah, compiling the plugin from source would be a good way to get the debug symbols in there, or there might have been a -dbg debian package? (I dont think those are very common nowadays)

I apologize for my relative n00bness here. I just compiled bitlbee from source with debugging, and the output from GDB looked exactly the same. Then I realized you said recompiling the plugin with debugging, and since there's not a ./configure --debugging=1 or something, I realized I don't know what to do to help here. :/

If it helps, I'm using the testing version of these three libraries (mostly for other programs, so downgrading them to bullseye's stable would be a pain:

libpurple-dev 2.14.9-2 libglib2.0-dev 2.72.1-1 lijson-glib-dev 1.6.6-1

uriel1998 commented 2 years ago

Just tried the nightly build of bitlbee-libpurple as well; same behavior:

DEBUG certificate: Successfully verified certificate for api.messenger.klinkerapps.com
DEBUG http: Request 0x5555559bc5c0 performed without success.

(bitlbee:1861644): Json-CRITICAL **: 14:31:48.808: json_object_get_string_member: assertion 'node != NULL' failed

(bitlbee:1861644): Json-CRITICAL **: 14:31:48.808: json_object_get_string_member: assertion 'node != NULL' failed

(bitlbee:1861644): Json-CRITICAL **: 14:31:48.808: json_object_get_string_member: assertion 'node != NULL' failed

Thread 1 "bitlbee" received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-vec.S:133
133     ../sysdeps/x86_64/multiarch/strlen-vec.S: No such file or directory.
#0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-vec.S:133
#1  0x00007ffff399496f in  () at /usr/lib/x86_64-linux-gnu/purple-2/libpulsesms.so
#2  0x00007ffff399755c in  () at /usr/lib/x86_64-linux-gnu/purple-2/libpulsesms.so
#3  0x00007ffff3999498 in  () at /usr/lib/x86_64-linux-gnu/purple-2/libpulsesms.so
#4  0x00007ffff3999b50 in  () at /usr/lib/x86_64-linux-gnu/purple-2/libpulsesms.so
#5  0x000055555557c138 in  ()
#6  0x00007ffff7d69e94 in g_main_context_dispatch ()
    at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007ffff7d6a238 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007ffff7d6a523 in g_main_loop_run ()
    at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x0000555555564c81 in main ()
simonpatap0n commented 2 years ago
Thread 1 "bitlbee" received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-vec.S:133
133 ../sysdeps/x86_64/multiarch/strlen-vec.S: Aucun fichier ou dossier de ce type.
(gdb) bt full
#0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/strlen-vec.S:133
#1  0x00007f107fde696f in pulsesms_got_login
    (http_conn=<optimized out>, response=<optimized out>, user_data=0x55e806b10f40) at libpulsesms.c:628
        psa = 0x55e806b10f40
        len = 34
        data = <optimized out>
        info = 0x55e806de4330
        password = 0x55e806aec0c0 "***********"
        salt2 = 0x0
        dklen = 32
        rounds = 10000
        DK = "\310\376n\203\063\000\000\000\000!?e\377\177\000\000\247E\002\006\350U\000\000@}\343\006\350U\000"
        hash = <optimized out>
#2  0x00007f107fde955c in purple_http_connection_terminate (hc=0x55e806e3cbe0) at purple2compat/http.c:1725
        __func__ = "purple_http_connection_terminate"
#3  0x00007f107fdeb4a8 in _purple_http_recv_loopbody (hc=hc@entry=0x55e806e3cbe0, fd=<optimized out>)
    at purple2compat/http.c:1293
        redirect = <optimized out>
        len = <optimized out>
        buf = "0\r\n\r\n\332\016\245\333\"\000\000\000\r\n\310IM,NU(\316\317)KU(JuN,(I\316HT\252\005\000\000\000\377\377\r\n: Fri, 04 Nov 2022 01:58:38 GMT\r\nConnection: keep-alive\r\nContent-Type: application/json; charset=utf-8\r\nVary: Accept-Encoding, Origin\r\nContent-Encoding: g"...
        got_anything = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
#4  0x00007f107fdebb30 in _purple_http_recv (_hc=0x55e806e3cbe0, fd=<optimized out>, cond=<optimized out>) at purple2compat/http.c:1304
        hc = 0x55e806e3cbe0
#5  0x000055e80600f54f in gaim_io_invoke (source=0x55e806e40b80, condition=G_IO_IN, data=0x55e806b0ca60) at events_glib.c:92
        closure = 0x55e806b0ca60
        gaim_cond = B_EV_IO_READ
        st = 21992
#6  0x00007f1083b5ed6f in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f1083b5f118 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007f1083b5f40b in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x000055e80600f4a9 in b_main_run () at events_glib.c:59
#10 0x000055e80600c53c in main (argc=2, argv=0x7fff653f35d8) at unix.c:203
        i = 0
        old_cwd = 0x0
        sig = {__sigaction_handler = {sa_handler = 0x55e80600c9dd <sighandler_shutdown>, sa_sigaction = 0x55e80600c9dd <sighandler_shutdown>}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = -2147483648, sa_restorer = 0x0}
        old = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0, 140734892028736, 94455021373888, 0, 0, 140734892028736, 94455021499991, 0, 0, 94455021376819, 25769803777, 8589934592, 94455033016320, 94455032886336, 109586456960, 140734892028752}}, sa_flags = 0, sa_restorer = 0x0}
        unused = {0x55e80600c50a <main+1557>}

bitlbee was compiled with ./configure --purple=1 --debug=1 This is what i got after launching with BITLBEE_DEBUG=1 /usr/local/sbin/bitlbee -Dnv then i used gdb /usr/local/sbin/bitlbee PID

hope it helps, i really miss this plugin