Infactum / tg2sip

Telegram <-> SIP voice gateway
GNU General Public License v2.0
273 stars 104 forks source link

Unhandled exception: map::at on every incoming call from Telegram side #63

Open sergei-mironov opened 2 years ago

sergei-mironov commented 2 years ago

tg2sip began to crash on every incoming Telegram call.

[19:06:44.699][t:450211][p:449859][core][critical] Unhandled exception: map::at

Tried both pull #61 and c45b30924cb1ab365d78992dd556b7ec251756f2 with the same effect

sergei-mironov commented 2 years ago

A related core dump

   34                 Stack trace of thread 452718:                                    
   35                 #0  0x00007f41f001fbda raise (libc.so.6 + 0x3bbda)               
   36                 #1  0x00007f41f000a533 abort (libc.so.6 + 0x26533)               
   37                 #2  0x0000000000412839 _ZZ4mainENUlvE_4_FUNEv.cold (tg2sip + 0x12839)
   38                 #3  0x00007f41f07f6eb6 n/a (libstdc++.so.6 + 0xadeb6)            
   39                 #4  0x00007f41f07f6f21 _ZSt9terminatev (libstdc++.so.6 + 0xadf21)
   40                 #5  0x00007f41f07f7174 __cxa_throw (libstdc++.so.6 + 0xae174)    
   41                 #6  0x00007f41f07edd54 _ZSt20__throw_out_of_rangePKc (libstdc++.so.6 + 0xa4d54)
   42                 #7  0x000000000062b64e _ZN6tgvoip14VoIPController22EvaluateUdpPingResultsEv (tg2sip + 0x22b64e)
   43                 #8  0x000000000064676e _ZN6tgvoip13MessageThread3RunEv (tg2sip + 0x24676e)
   44                 #9  0x00000000006399e4 _ZN6tgvoip6Thread16ActualEntryPointEPv (tg2sip + 0x2399e4)
   45                 #10 0x00007f41f0340d40 start_thread (libpthread.so.0 + 0x8d40)   
   46                 #11 0x00007f41f00e003f __clone (libc.so.6 + 0xfc03f)   
tonikpro commented 2 years ago

could you please provide more details? maybe you can make a PR?

sergei-mironov commented 2 years ago

A related core dump

   34                 Stack trace of thread 452718:                                    
   35                 #0  0x00007f41f001fbda raise (libc.so.6 + 0x3bbda)               
   36                 #1  0x00007f41f000a533 abort (libc.so.6 + 0x26533)               
   37                 #2  0x0000000000412839 _ZZ4mainENUlvE_4_FUNEv.cold (tg2sip + 0x12839)
   38                 #3  0x00007f41f07f6eb6 n/a (libstdc++.so.6 + 0xadeb6)            
   39                 #4  0x00007f41f07f6f21 _ZSt9terminatev (libstdc++.so.6 + 0xadf21)
   40                 #5  0x00007f41f07f7174 __cxa_throw (libstdc++.so.6 + 0xae174)    
   41                 #6  0x00007f41f07edd54 _ZSt20__throw_out_of_rangePKc (libstdc++.so.6 + 0xa4d54)
   42                 #7  0x000000000062b64e _ZN6tgvoip14VoIPController22EvaluateUdpPingResultsEv (tg2sip + 0x22b64e)
   43                 #8  0x000000000064676e _ZN6tgvoip13MessageThread3RunEv (tg2sip + 0x24676e)
   44                 #9  0x00000000006399e4 _ZN6tgvoip6Thread16ActualEntryPointEPv (tg2sip + 0x2399e4)
   45                 #10 0x00007f41f0340d40 start_thread (libpthread.so.0 + 0x8d40)   
   46                 #11 0x00007f41f00e003f __clone (libc.so.6 + 0xfc03f)   

Likely related https://github.com/Infactum/tg2sip/blob/c45b30924cb1ab365d78992dd556b7ec251756f2/libtgvoip/VoIPController.cpp#L3510

afeno commented 2 years ago

This is happening since Thursday (5/5/2022) with all the libraries using libtgvoip (madeline, pytgvoip, etc.). The call is stuck on the "Exchanging private keys" step. Not sure how it can be fixed....

sergei-mironov commented 2 years ago

This is happening since Thursday (5/5/2022) with all the libraries using libtgvoip (madeline, pytgvoip, etc.). The call is stuck on the "Exchanging private keys" step. Not sure how it can be fixed....

Yep, I see the same symptom on the client side. I think that calling this endpoints.at(currentEndpoint) is a real bug in libtgvoip which we didn't trigger before. But the real cause is the absence of some server-side endpoints which existed previously.

afeno commented 2 years ago

Did someone try what is @tgtglove suggested? There is any progress on this? What about funding $4K for someone to implement Voip calls using the new method? Nobody else is intrested?

lipunis commented 2 months ago

That would be very cool.