Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

status assertion failed #478

Closed
mynery opened this issue Jan 10, 2019 · 13 comments
Closed

status assertion failed #478

mynery opened this issue Jan 10, 2019 · 13 comments

Comments

@mynery
Copy link

mynery commented Jan 10, 2019

I am a bit confused as to what version i have exactly, since the AUR package is a bit confusing, but after building today I have

aur/telegram-purple-git 1.4.0.206ac2c-1 (+45 0.02%) (Installed: 1.4.0.2bf0d8a-1)

but it also fails the exact same way on 1.3.1.

Recently I started getting issues after minbif disconnects for whatever reason. journalctl:

Stack trace of thread 4116:
#0 0x00007f4afd338d7f raise (libc.so.6)
#1 0x00007f4afd323672 abort (libc.so.6)
#2 0x00007f4afd323548 __assert_fail_base.cold.0 (libc.so.6)
#3 0x00007f4afd331396 __assert_fail (libc.so.6)
#4 0x00007f4af227aade tglq_query_result (telegram-purple.so)
#5 0x00007f4af2273401 n/a (telegram-purple.so)
#6 0x00007f4af2260c11 n/a (telegram-purple.so)
#7 0x0000557133b7633f n/a (minbif)
#8 0x00007f4afdc4b8d1 g_main_context_dispatch (libglib-2.0.so.0)
#9 0x00007f4afdc4d5e9 n/a (libglib-2.0.so.0)
#10 0x00007f4afdc4e5c2 g_main_loop_run (libglib-2.0.so.0)
#11 0x0000557133b68e55 _ZN6Minbif4mainEiPPc (minbif)
#12 0x0000557133b69265 main (minbif)
#13 0x00007f4afd325223 __libc_start_main (libc.so.6)
#14 0x0000557133b6952a _start (minbif)

The minbif logs say

CRITICAL **: 21:32:55.738: purple_presence_is_online: assertion 'presence != NULL' failed
minbif: queries.c:470: tglq_query_result: Assertion `0' failed.

Removing and re-adding the account works, but is not a practical solution imho.

@BenWiederhake
Copy link
Collaborator

aur/telegram-purple-git 1.4.0.206ac2c-1 (+45 0.02%) (Installed: 1.4.0.2bf0d8a-1)

Sigh. Could someone very roughly shake the packager and tell them to read the version number? Now we will have to skip 1.4.0 just because someone couldn't read that the branch dev-1.4.0 is a) a branch, and therefore not a fixed thing yet, and b) a development version, so not a release yet. "rc" in there would have been fine, but … sigh. But I guess it's also out fault for not releasing. Ever.

2bf0d8a

That's the commit of the current dev-1.4.0. So I hope they packaged that version.

Just to be extra sure: If it does boot up, can you ask minbif for the plugin version? It should report something like this:

Version: 1.3.1
commit: 78737ef775
libtgl: 2.1.0

minbif

I hear about minbif the first time today. Hello, World! :)
I'm afraid I need to tell you that telegram-purple is unstable, and barely in development.
If you still want to use and improve tgp, great! :)

CRITICAL **: 21:32:55.738: purple_presence_is_online: assertion 'presence != NULL' failed

Since the failing assertion happens somewhere else, I assume it is mostly unrelated.

#4 0x00007f4af227aade tglq_query_result (telegram-purple.so)
#5 0x00007f4af2273401 n/a (telegram-purple.so)
#6 0x00007f4af2260c11 n/a (telegram-purple.so)

This is very unfortunate! Most of the debugging info has been lost, apparently. Does AUR strip debugging symbols?

In the function tglq_query_result, which starts at queries.c:438, there is only one assert(0). However, the observed behavior doesn't match, as the error message immediately before that assert doesn't show up.

In summary:

  • Does minbif have a "native" alternative?
  • If not, can you put debugging symbols back?

@mynery
Copy link
Author

mynery commented Jan 11, 2019

I will have a look at how it's built here and maybe build it manually to see if this helps with debug symbols.
Minbif is a bit like bitlbee, but imho it works way better with libpurple (even though it sadly seems to be dead, but still has less problems than bitlbee does).
I have been using telegra-purple just fine for quite some time. I am really confused about why this suddenly happens even on 1.3.1.
I will report back once I have more information at hand.

@mynery
Copy link
Author

mynery commented Jan 11, 2019

First things first: I forgot another minbif error:

CRITICAL **: 09:07:53.749: purple_presence_set_status_active: assertion 'status != NULL' failed

I built a newly cloned and built 2bf0d8a and now i got

Stack trace of thread 14710:
#0 0x00007f7b17675d7f raise (libc.so.6)
#1 0x00007f7b17660672 abort (libc.so.6)
#2 0x00007f7b17660548 __assert_fail_base.cold.0 (libc.so.6)
#3 0x00007f7b1766e396 __assert_fail (libc.so.6)
#4 0x00007f7b0c5bcaea tglq_query_result (telegram-purple.so)
#5 0x00007f7b0c5b55ad process_rpc_message (telegram-purple.so)
#6 0x00007f7b0c5a356f try_rpc_read (telegram-purple.so)
#7 0x0000555e83ff333f n/a (minbif)
#8 0x00007f7b17f888d1 g_main_context_dispatch (libglib-2.0.so.0)
#9 0x00007f7b17f8a5e9 n/a (libglib-2.0.so.0)
#10 0x00007f7b17f8b5c2 g_main_loop_run (libglib-2.0.so.0)
#11 0x0000555e83fe5e55 _ZN6Minbif4mainEiPPc (minbif)
#12 0x0000555e83fe6265 main (minbif)
#13 0x00007f7b17662223 __libc_start_main (libc.so.6)
#14 0x0000555e83fe652a _start (minbif)

@BenWiederhake
Copy link
Collaborator

Without line numbers, and without the actual failing assertion, I have no idea. My best guess is that some basic networking stuff fails.

Again, the status != NULL message is something else, and doesn't seem to be a critical issue.

@mynery
Copy link
Author

mynery commented Jan 11, 2019

I currently have no idea on how to get line numbers. I tried the gdb way for a pidgin stacktrace and gut pretty useless stuff

** (process:20964): CRITICAL **: 19:19:06.834: purple_presence_is_online: assertion 'presence != NULL' failed
minbif: queries.c:470: tglq_query_result: Assertion `0' failed.
[INFO] IPC: a child left: No such file or directory

Program received signal SIGINT, Interrupt.
0x00007ffff73a8be8 in poll () from /usr/lib/libc.so.6
(gdb) bt full
#0 0x00007ffff73a8be8 in poll () at /usr/lib/libc.so.6
#1 0x00007ffff7c04540 in () at /usr/lib/libglib-2.0.so.0
#2 0x00007ffff7c055c2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#3 0x0000555555581e55 in Minbif::main(int, char**) ()
#4 0x0000555555582265 in main ()

Any pointers on how to get more information?
I thought about just patching purple_presence_set_status_active myself, but I don't know enough about libpurple to know a sane default to replace a null pointer.

@EionRobb
Copy link
Contributor

try running handle SIGINT nostop in gdb to make it not stop on interrupts

@mynery
Copy link
Author

mynery commented Jan 11, 2019

Well, my problem was that I could not issue a bt full command in gdb unless I kill minbif since it will not close upon failing, just close my connection. Ignoring SIGINT won't stop that. I have pretty limited experience there.

@some-dani
Copy link

some-dani commented Jan 25, 2019

It seems i have the same problem. When i start pidgin it crashes on startup.

telegram-purple 1.3.1-3
Pidgin 2.13.0 (libpurple 2.13.0)
OS: 4.20.3-arch1-1-ARCH

here is my stacktrace, dunno if it is enough information:

(23:00:24) prpl-telegram: update_user_handler() (CREATED PHONE NAME FLAGS ACCESS_HASH)
(23:00:24) prpl-telegram: new user m allocated (CREATED CONTACT MUTUAL_CONTACT)
(23:00:24) prpl-telegram: 794283628: when=0
(23:00:24) prpl-telegram: mobile
(23:00:24) blist: Updating buddy status for m (Telegram)
(23:00:24) log: Failed to open log file "/home/d/.purple/logs/m.log" for reading: Datei oder Verzeichnis nicht gefunden
(23:00:24) prpl-telegram: photo id for m hasn't changed 0
(23:00:24) prpl-telegram: Skipped 1442 int out of 5116 (type messages.Dialogs) (query type get dialogs)
(23:00:24) prpl-telegram: 0x00000000 0x15ba6c40 0x1cb5c415 0x00000043
pidgin: queries.c:470: tglq_query_result: Zusicherung »0« nicht erfüllt.

Thread 1 "pidgin" received signal SIGABRT, Aborted.
0x00007ffff67ebd7f in raise () from /usr/lib/libc.so.6
(gdb) bt full
#0 0x00007ffff67ebd7f in raise () at /usr/lib/libc.so.6
#1 0x00007ffff67d6672 in abort () at /usr/lib/libc.so.6
#2 0x00007ffff67d6548 in _nl_load_domain.cold.0 () at /usr/lib/libc.so.6
#3 0x00007ffff67e4396 in () at /usr/lib/libc.so.6
#4 0x00007fffe85d1ade in tglq_query_result ()
at /usr/lib/purple-2/telegram-purple.so
#5 0x00007fffe85ca401 in () at /usr/lib/purple-2/telegram-purple.so
#6 0x00007fffe85b7c11 in () at /usr/lib/purple-2/telegram-purple.so
#7 0x00005555555c617f in ()
#8 0x00007ffff6ccc8d1 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#9 0x00007ffff6cce5e9 in () at /usr/lib/libglib-2.0.so.0
#10 0x00007ffff6ccf5c2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#11 0x00007ffff737cdf3 in gtk_main () at /usr/lib/libgtk-x11-2.0.so.0
#12 0x000055555558999b in main ()
(gdb)

@ngc92
Copy link

ngc92 commented Jan 26, 2019

I also get the tglq_query_result: Assertion 0' failed.. I don't know what exactly the vlogprintf` does, but I have replaced them with ordinary printf to receive the following error messages:

result for query #6650778101196024832. Size 13600 bytes
in_ptr = 0x7f0e2a96bf40, end_ptr = 0x7f0e2a97262c
Skipped 80 int out of 6587 (type updates.Difference) (query type get difference)
0x00000000 0x00f49ca0 0x1cb5c415 0x000000e1

@vuori
Copy link

vuori commented Feb 9, 2019

Fixed similar errors with the attached patch to tgl. Basically this just adds most of the "recent" (i.e. newer than 3 years old) MessageAction types from TDLib and makes the library ignore them. messageActionPinMessage is probably the most common reason for crashes.

tgl's age is starting to show quite a bit it seems.

diff --git a/scheme.tl b/scheme.tl
index ec69fc0..266e434 100644
--- a/scheme.tl
+++ b/scheme.tl
@@ -150,6 +150,14 @@ messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;
 messageActionChannelCreate#95d2ac92 title:string = MessageAction;
 messageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;
 messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;
+messageActionPinMessage#94bd38ed = MessageAction;
+messageActionHistoryClear#9fbab604 = MessageAction;
+messageActionGameScore#92a72876 game_id:long score:int = MessageAction;
+messageActionPaymentSent#40699cd0 currency:string total_amount:long = MessageAction;
+messageActionScreenshotTaken#4792929b = MessageAction;
+messageActionCustomAction#fae69f56 message:string = MessageAction;
+messageActionBotAllowed#abe9affe domain:string = MessageAction;
+

 dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog;
 dialogChannel#5b8496b2 peer:Peer top_message:int top_important_message:int read_inbox_max_id:int unread_count:int unread_important_count:int notify_settings:PeerNotifySettings pts:int = Dialog;
diff --git a/structures.c b/structures.c
index 6a2576f..50d4ef1 100644
--- a/structures.c
+++ b/structures.c
@@ -1106,7 +1106,9 @@ void tglf_fetch_message_action (struct tgl_state *TLS, struct tgl_message_action
     M->title = DS_STR_DUP (DS_MA->title);
     break;
   default:
-    assert (0);
+    vlogprintf (E_WARNING, "Unknown MessageAction code: magic = 0x%08x\n", DS_MA->magic);
+    M->type = tgl_message_action_noop;
+    break;
   }
 }

@some-dani
Copy link

Thank you very much @vuori, that solved the issue for me!

@BenWiederhake
Copy link
Collaborator

Looks like I'll have to look into merging this. Also: Thanks for keeping the diff on-topic, that gives me a good feeling about not breaking too much, if at all.

@BenWiederhake
Copy link
Collaborator

Should be merged in v1.4.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants