d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
524 stars 40 forks source link

Crash on startup #218

Closed gilcu3 closed 2 months ago

gilcu3 commented 2 months ago

Description: App crashes on startup How to reproduce it: Build the app with any commit after 8f7b24e9406aaa58b7d3a962428ac46f01633de3 (i.e. using the commits from today).

Environment:

Logs:

unexpected termination 6
callstack:
/home/username/opt/nchat/build/lib/libncutil.so(_ZN7AppUtil13SignalHandlerEi+0x68)[0x7402306bfc88]
/usr/lib/libc.so.6(+0x3c770)[0x74022fe35770]
/usr/lib/libc.so.6(+0x8d32c)[0x74022fe8632c]
/usr/lib/libc.so.6(gsignal+0x18)[0x74022fe356c8]
/usr/lib/libc.so.6(abort+0xd7)[0x74022fe1d4b8]
/usr/lib/libstdc++.so.6(+0x9ca6f)[0x74023009ca6f]
/usr/lib/libstdc++.so.6(+0xb011c)[0x7402300b011c]
/usr/lib/libstdc++.so.6(+0xb0189)[0x7402300b0189]
/usr/lib/libstdc++.so.6(+0xb03ed)[0x7402300b03ed]
/usr/lib/libstdc++.so.6(_ZSt20__throw_out_of_rangePKc+0x44)[0x7402300a021d]
/home/username/opt/nchat/build/lib/libncutil.so(_ZNK6Config3GetERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x1cc)[0x7402306c10cc]
/home/username/opt/nchat/build/bin/../lib/libtgchat.so(_ZNK6TgChat4Impl21GetProfileDisplayNameB5cxx11Ev+0x88)[0x74022f05f528]
/home/username/opt/nchat/build/bin/../lib/libtgchat.so(_ZNK6TgChat21GetProfileDisplayNameB5cxx11Ev+0x21)[0x74022f05f591]
./build/bin/nchat(+0x5b278)[0x5b6b9c376278]
./build/bin/nchat(+0x7592d)[0x5b6b9c39092d]
./build/bin/nchat(+0x774c2)[0x5b6b9c3924c2]
./build/bin/nchat(+0x5a5ef)[0x5b6b9c3755ef]
./build/bin/nchat(+0x1a877)[0x5b6b9c335877]
./build/bin/nchat(+0x1404c)[0x5b6b9c32f04c]
/usr/lib/libc.so.6(+0x25cd0)[0x74022fe1ecd0]
/usr/lib/libc.so.6(__libc_start_main+0x8a)[0x74022fe1ed8a]
./build/bin/nchat(+0x15835)[0x5b6b9c330835]
d99kris commented 2 months ago

Hi @gilcu3 - thanks for reporting this issue and tracking down the last good commit. 👍

I was able to reproduce the issue after setting up nchat to use multiple profiles/accounts. The crash should be fixed with above commit. The root cause of the bug was introduction of a more parallel/threaded login sequence in 1621aff which did not cater for the multiple profiles/accounts use-case. For now I've effectively disabled the parallel login sequence, but I will come back to this eventually and re-enable it with handling for multiple profiles.