-
Notifications
You must be signed in to change notification settings - Fork 82
SIGSEGV in timer_alarm #582
Comments
|
@himselfv, could you take a look please? Seems like this is related to changes in majn/tgl@64dccea, but I'm not sure yet where |
@bodqhrohro
But Any details on when the crash happened? Logs? |
There are no debug logs related to telegram-purple right before in this case, only some usual XMPP/GDK chitchatting. Happens when Pidgin is starting and telegram-purple fetches the messages it missed, possibly on reconnects too. |
So apparently, to understand what's happening I had to look at Issue 580 which details the setup and gives more logs. A connected instance of Pidgin is frozen, then network is disconnected/reconnected, forcing Pidgin to quickly disconnect/reconnect on unfreeze. The disconnection destroys the TLS* context, but some delayed download requests linger as timer_alarms for up to 10 seconds, and then fire with the broken TLS* pointer. If this is the reason, it should not happen on initial connect.
To fix this, I guess download_retry code should keep a list of all outstanding download_retry timers and cancel all of them on TLS* destruction (tgl_free_all). Or maybe TLS* should just cancel ALL timers created via TLS->timer_methods, on its destruction? I mean, all of them receive the TLS* pointer, so none can be safely called after it's destroyed. Summoning @EionRobb, if they even care about this project anymore. |
Prpls written by @EionRobb themself do, as a rule of thumb. That's what made me sure that corruptions happen in some other place before the timers there are fired, BTW. I had polluted numerous bug trackers for years because of this before finding the reason (time to close all of that, probably). |
Yay! Glad you found it :) @bodqhrohro so the fix is to move to tdlib-purple? :) |
Nope, I told already that I just rolled back to the tgl revision before the patch. It wasn't working ideally anyway, as I still was getting lots of non-downloaded pictures. |
Another use-after-free, seems like uncleared callbacks are at guilt there too: |
The text was updated successfully, but these errors were encountered: