vysheng / tg

telegram-cli
GNU General Public License v2.0
6.45k stars 1.53k forks source link

Stack trace on -6/--enable-ipv6 #880

Open DRiKE opened 8 years ago

DRiKE commented 8 years ago

When using the v6 mode, telegram-cli crashes with a stack trace. Valgrind points to line 1028 in mtproto-client.c. If more debugging info is needed, I'm happy to help.

==4804== Memcheck, a memory error detector
==4804== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==4804== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==4804== Command: ./bin/telegram-cli -6
==4804== 
Telegram-cli version 1.3.3, Copyright (C) 2013-2015 Vitaly Valtman
Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show_license' for details.
Telegram-cli uses libtgl version 2.0.3
Telegram-cli includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit. (http://www.openssl.org/)
Telegram-cli uses libpython version 3.5.0
I: config dir=[/home/luuk/.telegram-cli]
> ==4804== Invalid read of size 4
==4804==    at 0x49A331: create_session_connect (mtproto-client.c:1028)
==4804==    by 0x49C0C7: tglmp_dc_create_session (mtproto-client.c:1388)
==4804==    by 0x49D83D: tglq_send_query_ex (queries.c:185)
==4804==    by 0x49DB37: tglq_send_query (queries.c:220)
==4804==    by 0x4AA5B4: tgl_do_get_difference (queries.c:2947)
==4804==    by 0x4ADA6D: tgl_export_all_auth (queries.c:4115)
==4804==    by 0x4AE53F: tgl_sign_in (queries.c:4277)
==4804==    by 0x4AE76C: tgl_login (queries.c:4314)
==4804==    by 0x472388: loop (loop.c:861)
==4804==    by 0x46E3D7: inner_main (main.c:459)
==4804==    by 0x46F4A9: main (main.c:1009)
==4804==  Address 0x10 is not stack'd, malloc'd or (recently) free'd
==4804== 
SIGNAL received
S./bin/telegram-cli(print_backtrace+0x1f)[0x46ee78]
./bin/telegram-cli(termination_signal_handler+0x98)[0x46ef2f]
/usr/lib/libc.so.6(+0x33680)[0x10ad3680]
./bin/telegram-cli[0x49a331]
./bin/telegram-cli(tglmp_dc_create_session+0x74)[0x49c0c8]
./bin/telegram-cli(tglq_send_query_ex+0x94)[0x49d83e]
./bin/telegram-cli(tglq_send_query+0x50)[0x49db38]
./bin/telegram-cli(tgl_do_get_difference+0x146)[0x4aa5b5]
./bin/telegram-cli(tgl_export_all_auth+0xf7)[0x4ada6e]
./bin/telegram-cli(tgl_sign_in+0xac)[0x4ae540]
./bin/telegram-cli(tgl_login+0x113)[0x4ae76d]
./bin/telegram-cli(loop+0x372)[0x472389]
./bin/telegram-cli(inner_main+0x9)[0x46e3d8]
./bin/telegram-cli(main+0x44b)[0x46f4aa]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x10ac0610]
./bin/telegram-cli(_start+0x29)[0x46d6b9]
==4804== 
==4804== HEAP SUMMARY:
==4804==     in use at exit: 142,499 bytes in 282 blocks
==4804==   total heap usage: 3,264 allocs, 2,982 frees, 313,635 bytes allocated
==4804== 
==4804== LEAK SUMMARY:
==4804==    definitely lost: 10,099 bytes in 37 blocks
==4804==    indirectly lost: 755 bytes in 18 blocks
==4804==      possibly lost: 0 bytes in 0 blocks
==4804==    still reachable: 131,645 bytes in 227 blocks
==4804==         suppressed: 0 bytes in 0 blocks
==4804== Rerun with --leak-check=full to see details of leaked memory
frizzlywitch commented 7 years ago

https://github.com/vysheng/tg/pull/1409