telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.98k stars 5.15k forks source link

Failed to set real-time priority for thread #16189

Closed mrLSD closed 3 years ago

mrLSD commented 3 years ago

After updating to v2.7.2 I can't run Telegram.:

$ ./Telegram 
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)

OS: Ubuntu 16.04

$ uname -a
Linux iMac 4.15.0-142-generic #146~16.04.1-Ubuntu SMP Tue Apr 13 09:27:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Crash report:

UserTag: 6888370ffdf78c4c
Version: 2007002

Caught signal 11 (SIGSEGV) in thread 140544522823936

Backtrace:
/home/pc/Music/Telegram/Telegram[0x2165034]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fd3106c9390]

Google Breakpad caught a crash, minidump written in thread 140544522823936
Minidump: /home/pc/.local/share/TelegramDesktop/tdata/dumps/bce1eee8-10f6-4430-a9e6cab5-5fd51011.dmp

Backtrace:
/home/pc/Music/Telegram/Telegram[0x2165034]
/home/pc/Music/Telegram/Telegram[0x216550c]
/home/pc/Music/Telegram/Telegram(_ZN15google_breakpad16ExceptionHandler12GenerateDumpEPNS0_12CrashContextE+0x375)[0x30e7965]
/home/pc/Music/Telegram/Telegram(_ZN15google_breakpad16ExceptionHandler13SignalHandlerEiP9siginfo_tPv+0xb0)[0x30e7cb0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fd3106c9390]
Jorilx commented 3 years ago

Same problem here, running on Devuan 2.1 (similar to Debian 9) Here's a gdb backtrace:

#0  0x0000000000000000 in ?? ()
#1  0x00007ffff75768ce in g_socket_control_message_deserialize () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#2  0x00007ffff756cc8a in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#3  0x00007ffff7570671 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007ffff7570c16 in g_socket_receive_message () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#5  0x00007ffff75f2951 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#6  0x00007ffff75f32ef in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#7  0x00007ffff75f397c in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#8  0x00007ffff7553bf7 in g_initable_new_valist () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#9  0x00007ffff7553ca6 in g_initable_new () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#10 0x00007ffff7557450 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#11 0x00000000012ce365 in base::Platform::NetworkAvailable() ()
#12 0x00000000012d80f5 in base::NetworkReachability::NetworkReachability() ()
#13 0x00000000012d837e in base::NetworkReachability::Instance() ()
#14 0x0000000001b7c006 in MTP::Instance::Private::Private(gsl::not_null<MTP::Instance*>, MTP::Instance::Mode, MTP::Instance::Fields&&) ()
#15 0x0000000001b5c2db in MTP::Instance::Instance(MTP::Instance::Mode, MTP::Instance::Fields&&) ()
#16 0x0000000001c5243e in Main::Account::startMtp(std::unique_ptr<MTP::Config, std::default_delete<MTP::Config> >) ()
#17 0x0000000001c53cd2 in Main::Account::start(std::unique_ptr<MTP::Config, std::default_delete<MTP::Config> >) ()
#18 0x000000000195c8bc in Storage::Domain::startModern(QByteArray const&) ()
#19 0x000000000195cb09 in Storage::Domain::start(QByteArray const&) ()
#20 0x0000000001c2b8a4 in Main::Domain::start(QByteArray const&) ()
#21 0x00000000021a0cdd in Core::Application::startDomain() ()
#22 0x00000000021af25c in Core::Application::run() ()
#23 0x00000000021808d6 in Core::Sandbox::notify(QObject*, QEvent*) ()
#24 0x0000000003f5bf6a in ?? ()
#25 0x0000000003f5fab5 in ?? ()
#26 0x0000000003fb5343 in ?? ()
#27 0x00007ffff5de27f7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007ffff5de2a60 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007ffff5de2b0c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x0000000003fb547e in ?? ()
#31 0x0000000003f5ae9e in ?? ()
#32 0x0000000003f63f66 in ?? ()
#33 0x000000000218686b in Core::Sandbox::start() ()
#34 0x000000000218a478 in Core::Launcher::executeApplication() ()
#35 0x000000000218a615 in Core::Launcher::exec() ()
#36 0x0000000001040538 in main ()
Struppi commented 3 years ago

I got the same error, here with: Linux .... 4.9.0-15-amd64 #1 SMP Debian 4.9.258-1 (2021-03-08) x86_64 GNU/Linux

There is a bug report for the same message (but another application) at ArchLinux which seems to be an problem of the user rights. The solution don't work for me. https://github.com/RPCS3/rpcs3/issues/9816

clckwrkbdgr commented 3 years ago

i don't think that message has something to do with the crash; I've seen it long before current update. However I've got the same core with the same exact stack, also Debian 9. Linux debian 4.19.0-0.bpo.9-amd64 #1 SMP Debian 4.19.118-2+deb10u1~bpo9+1 (2020-06-09) x86_64 GNU/Linux

pmelnik commented 3 years ago

Same thing on Debian.

uname -a
Linux T420s 4.9.0-14-amd64 #1 SMP Debian 4.9.240-2 (2020-10-30) x86_64 GNU/Linux
pmelnik@T420s:/opt/Telegram$ ./Telegram
 [ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
 Segmentation fault

Previous version https://updates.tdesktop.com/tlinux/tsetup.2.7.1.tar.xz

cubotto commented 3 years ago

Same for me! (on Devuan)

[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1) Segmentation fault

ilya-fedin commented 3 years ago

Crash is not related to that message, openal prints it for a ~year

ilya-fedin commented 3 years ago

Here's a gdb backtrace

looks like a crash inside glib

ilya-fedin commented 3 years ago

You need to install debug symbols for glib and get backtrace again.

dognew commented 3 years ago

The same for me too! After the update broke the application.

Linuxmint 18.3 with Xfce

$ ./Telegram QApplication: invalid style override 'gtk' passed, ignoring it. Available styles: qt5ct-style, Windows, Fusion [ALSOFT] (EE) Failed to set real-time priority for thread: Operação não permitida (1) Falha de segmentação

Log.txt [2021.04.26 19:51:13] Launched version: 2007002, install beta: [FALSE], alpha: 0, debug mode: [FALSE] [2021.04.26 19:51:13] Executable dir: /home/dognew/opt/Telegram/, name: Telegram [2021.04.26 19:51:13] Initial working dir: /home/dognew/opt/Telegram/ [2021.04.26 19:51:13] Working dir: /home/dognew/.local/share/TelegramDesktop/ [2021.04.26 19:51:13] Command line: ./Telegram [2021.04.26 19:51:13] Executable path before check: /home/dognew/opt/Telegram/Telegram [2021.04.26 19:51:13] Logs started [2021.04.26 19:51:13] Launcher filename: appimagekit_0dc15462c9a53be1b899cb29ee706c62-Telegram_Desktop.desktop [2021.04.26 19:51:13] Error: failed to load 'gdk_display_get_monitor' function! [2021.04.26 19:51:13] Error: failed to load 'gdk_display_get_primary_monitor' function! [2021.04.26 19:51:13] Error: failed to load 'gdk_monitor_get_scale_factor' function! [2021.04.26 19:51:13] Connecting local socket to /run/user/1000/0d21ba248dc97b6786e6d8da3e76e968-{87A94AB0-E370-4cde-98D3-ACC110C5967D}... [2021.04.26 19:51:13] Socket connect error 0, starting server and app... [2021.04.26 19:51:13] Moved logging from '/home/dognew/.local/share/TelegramDesktop/log_start0.txt' to '/home/dognew/.local/share/TelegramDesktop/log.txt'! [2021.04.26 19:51:13] Opened '/home/dognew/.local/share/TelegramDesktop/tdata/working' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: 897 [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic' [2021.04.26 19:51:14] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium' [2021.04.26 19:51:14] Update Info: MTP is unavailable. [2021.04.26 19:51:16] App Error: _basePath is empty in writeSettings() [2021.04.26 19:51:16] Primary screen DPI: 96 [2021.04.26 19:51:18] OpenAL Logging Level: (not set) [2021.04.26 19:51:18] Audio Playback Devices: Áudio interno Estéreo analógico [2021.04.26 19:51:18] Audio Playback Default Device: Áudio interno Estéreo analógico [2021.04.26 19:51:18] Audio Capture Devices: Áudio interno Estéreo analógico;Monitor of Áudio interno Estéreo analógico [2021.04.26 19:51:18] Audio Capture Default Device: Áudio interno Estéreo analógico [2021.04.26 19:51:19] Not using D-Bus global menu. [2021.04.26 19:51:19] Not using Unity launcher counter. [2021.04.26 19:51:19] System tray available: [TRUE]

I never performed this procedure, I don't know if I did it correctly or what the expected result would be.

$ gcc $(pkg-config --cflags --libs gio-2.0) -o network_available network_available.c /tmp/ccvlaiZF.o: na função main': network_available.c:(.text+0x10): referência indefinida parag_network_monitor_get_default' network_available.c:(.text+0x18): referência indefinida para `g_network_monitor_get_network_available' collect2: error: ld returned 1 exit status

Version 2.7.0 runs perfectly, but it also displays a similar message:

$ ./Telegram QApplication: invalid style override 'gtk' passed, ignoring it. Available styles: qt5ct-style, Windows, Fusion [ALSOFT] (EE) Failed to set real-time priority for thread: Operação não permitida (1) error: : cannot open error: : cannot open error: : cannot open OpenType support missing for "DAOpenSansSemibold", script 20 QCoreApplication::postEvent: Unexpected null receiver

cubotto commented 3 years ago

You need to install debug symbols for glib and get backtrace again.

how?

ilya-fedin commented 3 years ago

how?

I don't know, I'm not a Devuan user :thinking:

cubotto commented 3 years ago

argh!

ilya-fedin commented 3 years ago

I can't reproduce the issue on any of my Linux VMs, including Linux Mint 20

ilya-fedin commented 3 years ago

Try to build this code

#include <gio/gio.h>

int main(int argc, char** argv) {
    g_network_monitor_get_network_available(g_network_monitor_get_default());
    return 0;
}

with gcc $(pkg-config --cflags --libs gio-2.0) -o network_available network_available.c (don't forget to install build-essential and dev package for glib).

It it crashes, then you should report a bug for glib to your distro bugtracker with this minimal reproducer.

v98765 commented 3 years ago

❯ uname -a Linux abc-MS-1244 4.15.0-112-generic #113~16.04.1-Ubuntu SMP Fri Jul 10 04:37:08 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

~/Telegram ❯ ./Telegram [ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1) Segmentation fault

ninthcrow commented 3 years ago

Same at Linux 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

ilya-fedin commented 3 years ago

uname string doesn't give anything meaningful. It's just your kernel version.

ilya-fedin commented 3 years ago

As far as I understand, the problem is only on two systems (and their derivatives): Ubuntu 16.04 and Debian 9. No need to write messages like "same for me" if you running any of these systems. If you want to move the issue forward, you should provide a backtrace with glib debug symbols or test the code I provided above. "same for me" messages won't move the issue forward.

nightbuster commented 3 years ago

Try to build this code ... It it crashes, then you should report a bug for glib to your distro bugtracker with this minimal reproducer.

Build completed successfully without errors. Debian 9

ilya-fedin commented 3 years ago

Build is successful of course, I meant segfault after launching resulting binary

nightbuster commented 3 years ago

Nothing happens

ilya-fedin commented 3 years ago

Nothing happens

What do you mean?

nightbuster commented 3 years ago

just empty output update error also persists

ilya-fedin commented 3 years ago

Then we still need a backtrace with installed glib debug symbols in order to move the issue forward.

ilya-fedin commented 3 years ago

@nightbuster I wonder, will crash a variant with main loop or not:

#include <gio/gio.h>

static void print_network_available() {
    g_print(g_network_monitor_get_network_available(g_network_monitor_get_default()) ? "true\n" : "false\n");
}

static void network_available_changed(GApplication* application) {
    print_network_available();
    g_application_release(application);
}

static void activate(GApplication* application) {
    g_application_hold(application);
    print_network_available();
    g_signal_connect_swapped(
        g_network_monitor_get_default(),
        "notify::network-available",
        G_CALLBACK(network_available_changed),
        application);
}

int main(int argc, char** argv) {
    GApplication* app = g_application_new(NULL, G_APPLICATION_FLAGS_NONE);
    g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
    int status = g_application_run(app, argc, argv);
    g_object_unref(app);
    return status;
}
nightbuster commented 3 years ago

Now writes the following information to the app logs:

> [2021.04.27 10:16:35] Update Info: MTP is unavailable.
> [2021.04.27 10:16:35] Update Error: could not get current version 1
> [2021.04.27 10:16:35] App Error: _basePath is empty in writeSettings()
$ ./network_available 
> true
>
ilya-fedin commented 3 years ago

This won't change anything with tdesktop itself. It's not a fix, I'm trying to create a minimal reproducer.

nightbuster commented 3 years ago

Unfortunately, I don’t know how to read the backtrace with debug symbols for glib

ilya-fedin commented 3 years ago

I'm starting to think that maybe your issue is another, not like @Jorilx's

nightbuster commented 3 years ago

When running from the command line, I also get a Segmentation error if I press the Skip button:

[ALSOFT] (EE) Failed to set real-time priority for thread: Permission denied (1)
Segmentation error
ilya-fedin commented 3 years ago

I press the Skip button

That window should have a backtrace. Is it the same like @Jorilx's?

ilya-fedin commented 3 years ago

@Dees7 you should have dev package for glib installed

nightbuster commented 3 years ago

@ilya-fedin This is how it became after running your compiled code

$ cat ~/.local/share/TelegramDesktop/log.txt

[2021.04.27 11:02:41] Launched version: 2007002, install beta: [FALSE], alpha: 0, debug mode: [FALSE]
[2021.04.27 11:02:41] Executable dir: /home/user/downloads/tsetup.2.7.0/Telegram/, name: Telegram
[2021.04.27 11:02:41] Initial working dir: /home/user/.local/share/TelegramDesktop/
[2021.04.27 11:02:41] Working dir: /home/user/.local/share/TelegramDesktop/
[2021.04.27 11:02:41] Command line: /home/user/downloads/tsetup.2.7.0/Telegram/Telegram -workdir /home/user/.local/share/TelegramDesktop/ --
[2021.04.27 11:02:41] Executable path before check: /home/user/downloads/tsetup.2.7.0/Telegram/Telegram
[2021.04.27 11:02:41] Logs started
[2021.04.27 11:02:41] Launcher filename: appimagekit_364396e0c7cba6a16ae96547934b7220-Telegram_Desktop.desktop
[2021.04.27 11:02:41] Connecting local socket to /run/user/1000/715a4117cbf86d4f042d56fd70379a4e-{87A94AB0-E370-4cde-98D3-ACC110C5967D}...
[2021.04.27 11:02:41] Socket connect error 0, starting server and app...
[2021.04.27 11:02:41] Moved logging from '/home/user/.local/share/TelegramDesktop/log_start0.txt' to '/home/user/.local/share/TelegramDesktop/log.txt'!
[2021.04.27 11:02:41] Opened '/home/user/.local/share/TelegramDesktop/tdata/working' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: 965
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf' loaded 'DAOpenSansRegularItalic'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAVazirRegular.ttf' loaded 'DAVazirRegular'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf' loaded 'DAOpenSansSemibold'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
[2021.04.27 11:02:41] Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf' loaded 'DAVazirMedium'
[2021.04.27 11:02:41] Update Info: MTP is unavailable.
[2021.04.27 11:02:44] Update Error: could not get current version 1
[2021.04.27 11:02:44] App Error: _basePath is empty in writeSettings()
ilya-fedin commented 3 years ago

@nightbuster compiled code can't change how tdesktop crashes. I asked you a backtrace from the crash report window, not a log.

nightbuster commented 3 years ago

sorry, where is it?

ilya-fedin commented 3 years ago

sorry, where is it?

"from the crash report window" - in the crash report window, it's logical :thinking:

Dees7 commented 3 years ago

"from the crash report window" - in the crash report window, it's logical thinking

There is no crash report window on ubuntu

you should have dev package for glib installed

I have it installed

Reading state information... Done
libglib2.0-0 is already the newest version (2.48.2-0ubuntu4.8).
libglib2.0-0-dbg is already the newest version (2.48.2-0ubuntu4.8).
libglib2.0-dev is already the newest version (2.48.2-0ubuntu4.8).

dpkg -S gio/gio.h
libglib2.0-dev: /usr/include/glib-2.0/gio/gio.h

I'd like help but don't know how

ilya-fedin commented 3 years ago

There is no crash report window on ubuntu

You should use official static binary from desktop.telegram.org (not snap or flatpak) in order to have it.

Dees7 commented 3 years ago

You should use official static binary

Yes I do.

ilya-fedin commented 3 years ago

That's bad.

Dees7 commented 3 years ago

might it help (after bt app freezed)

./Telegram &
[1] 11836

(gdb) attach 11836
Attaching to process 11836
[New LWP 11840]
[New LWP 11841]
[New LWP 11842]
[New LWP 11843]
[New LWP 11844]
[New LWP 11845]
[New LWP 11846]
[New LWP 11847]
[New LWP 11848]
[New LWP 11849]
[New LWP 11850]
[New LWP 11851]
[New LWP 11853]
[New LWP 11876]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f962169180d in poll () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) bt
#0  0x00007f962169180d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f96220cd45c in g_main_context_iterate (priority=2147483647, n_fds=4, fds=0x6b95c30, timeout=<optimized out>, context=0x69e3bd0)
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./glib/gmain.c:4135
#2  0x00007f96220cd45c in g_main_context_iterate (context=context@entry=0x69e3bd0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./glib/gmain.c:3835
#3  0x00007f96220cd56c in g_main_context_iteration (context=0x69e3bd0, may_block=1) at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./glib/gmain.c:3901
#4  0x0000000003fb547e in  ()
#5  0x0000000003f5ae9e in  ()
#6  0x0000000003f63f66 in  ()
#7  0x000000000218686b in Core::Sandbox::start() ()
#8  0x000000000218a478 in Core::Launcher::executeApplication() ()
#9  0x000000000218a615 in Core::Launcher::exec() ()
#10 0x0000000001040538 in main ()
ilya-fedin commented 3 years ago

might it help (after bt app freezed)

No.

gdb ./Telegram
run

when it crashes: bt full

Dees7 commented 3 years ago
(gdb) run
Starting program: /home/user/Telegram/new/Telegram 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeb49d700 (LWP 12086)]
[New Thread 0x7fffeac9c700 (LWP 12087)]
[New Thread 0x7fffea49b700 (LWP 12088)]
QApplication: invalid style override 'gtk' passed, ignoring it.
 Available styles: qt5ct-style, Windows, Fusion
[New Thread 0x7fffe9c9a700 (LWP 12089)]
[New Thread 0x7fffe92b2700 (LWP 12090)]
[New Thread 0x7fffe8ab1700 (LWP 12091)]
[New Thread 0x7fffd3fff700 (LWP 12092)]
[New Thread 0x7fffd37fe700 (LWP 12093)]
[New Thread 0x7fffd2ffd700 (LWP 12094)]
[New Thread 0x7fffd0829700 (LWP 12095)]
[New Thread 0x7fffbbd7d700 (LWP 12096)]
[New Thread 0x7fffbb57c700 (LWP 12097)]
[New Thread 0x7fffbad7b700 (LWP 12098)]
[New Thread 0x7fffba57a700 (LWP 12099)]
[New Thread 0x7fffaa211700 (LWP 12101)]
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[New Thread 0x7fffa9a10700 (LWP 12102)]
[New Thread 0x7fffa920f700 (LWP 12103)]
[New Thread 0x7fffa8a0e700 (LWP 12104)]

Thread 1 "Telegram" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt full
#0  0x0000000000000000 in  ()
#1  0x00007ffff7583ede in g_socket_control_message_deserialize (level=1, type=2, size=12, data=0x7fffffffbe80) at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/gsocketcontrolmessage.c:196
        class = 0x7317520
        message = 0x0
        message_types = 0x73198c0
        n_message_types = 3
        i = 2
#2  0x00007ffff757a300 in input_message_from_msghdr (msg=msg@entry=0x7fffffffc710, message=message@entry=0x7fffffffc6d0, socket=socket@entry=0x69103d0 [GSocket])
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/gsocket.c:4135
        control_message = <optimized out>
        my_messages = 0x0
        cmsg = 0x7fffffffbe70
        __func__ = "input_message_from_msghdr"
#3  0x00007ffff757dcb1 in g_socket_receive_message_with_timeout (socket=0x69103d0 [GSocket], address=address@entry=0x0, vectors=<optimized out>, 
    vectors@entry=0x7fffffffc820, num_vectors=<optimized out>, 
    num_vectors@entry=1, messages=messages@entry=0x0, num_messages=num_messages@entry=0x0, flags=0x7fffffffc7fc, timeout=-1, cancellable=0x0, error=0x7fffffffc800)
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/gsocket.c:4848
        input_message = {address = 0x0, vectors = 0x7fffffffc820, num_vectors = 1, bytes_received = 0, flags = 1073741858, control_messages = 0x0, num_control_messages = 0x0}
        msg = {msg_name = 0x0, msg_namelen = 0, msg_iov = 0x7fffffffc820, msg_iovlen = 1, msg_control = 0x7fffffffbe70, msg_controllen = 32, msg_flags = 1073741856}
        result = <optimized out>
        one_vector = {buffer = 0x2, size = 9223372036854775822}
        one_byte = 0 '\000'
        start_time = 3843095798
        __func__ = "g_socket_receive_message_with_timeout"
#4  0x00007ffff757e246 in g_socket_receive_message (socket=<optimized out>, address=address@entry=0x0, vectors=vectors@entry=0x7fffffffc820, num_vectors=num_vectors@entry=1, messages=messages@entry=0x0, num_messages=num_messages@entry=0x0, flags=0x7fffffffc7fc, cancellable=0x0, error=0x7fffffffc800) at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/gsocket.c:5313
#5  0x00007ffff75acfb1 in read_netlink_messages (socket=socket@entry=0x0, condition=condition@entry=G_IO_IN, user_data=user_data@entry=0x68f33d0)
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/gnetworkmonitornetlink.c:311
        nl = 0x68f33d0 [GNetworkMonitorNM]
        iv = {buffer = 0x0, size = 0}
        len = <optimized out>
        flags = 34
        error = 0x0
        addr = 0x0
        msg = <optimized out>
        rtmsg = <optimized out>
        attr = <optimized out>
        source_sockaddr = {nl_family = 13184, nl_pad = 1679, nl_pid = 0, nl_groups = 4124864092}
        attrlen = <optimized out>
        dest = <optimized out>
        gateway = <optimized out>
        oif = <optimized out>
        retval = 1
#6  0x00007ffff75ad93f in g_network_monitor_netlink_initable_init (initable=0x68f33d0, cancellable=<optimized out>, error=0x0)
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/gnetworkmonitornetlink.c:141
        nl = 0x68f33d0 [GNetworkMonitorNM]
        sockfd = 49
        snl = {nl_family = 16, nl_pad = 0, nl_pid = 0, nl_groups = 1088}
---Type <return> to continue, or q <return> to quit--- 
#7  0x00007ffff75adfc6 in g_network_monitor_nm_initable_init (initable=0x68f33d0, cancellable=0x0, error=0x0) at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/gnetworkmonitornm.c:298
        nm = 0x68f33d0 [GNetworkMonitorNM]
        parent_iface = <optimized out>
#8  0x00007ffff7561a6f in g_initable_new_valist (object_type=<optimized out>, first_property_name=0x0, var_args=0x7fffffffc930, cancellable=0x0, error=0x0)
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/ginitable.c:228
        obj = 0x68f33d0 [GNetworkMonitorNM]
#9  0x00007ffff7561b26 in g_initable_new (object_type=<optimized out>, cancellable=cancellable@entry=0x0, error=error@entry=0x0, first_property_name=first_property_name@entry=0x0)
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/ginitable.c:146
        object = <optimized out>
Python Exception <class 'gdb.error'> Attempt to dereference a generic pointer.: 
#10 0x00007ffff75650b6 in try_implementation (extension=<optimized out>, verify_func=verify_func@entry=0x0) at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/giomodule.c:769
        type = <optimized out>
        impl = <optimized out>
#11 0x00007ffff7565230 in _g_io_module_get_default (extension_point=0x7ffff7615fc9 "gio-network-monitor", envvar=0x7ffff7617ade "GIO_USE_NETWORK_MONITOR", verify_func=0x0)
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./gio/giomodule.c:871
        default_modules_lock = {p = 0x6de06a0, i = {0, 0}}
        default_modules = 0x690bb00
        use_this = <optimized out>
        l = 0x68e98c0
        ep = <optimized out>
        extension = <optimized out>
        preferred = 0x0
        impl = 0x6ae8850
        __func__ = "_g_io_module_get_default"
#12 0x00000000012ce365 in base::Platform::NetworkAvailable() ()
#13 0x00000000012d80f5 in base::NetworkReachability::NetworkReachability() ()
#14 0x00000000012d837e in base::NetworkReachability::Instance() ()
#15 0x0000000001b7c006 in MTP::Instance::Private::Private(gsl::not_null<MTP::Instance*>, MTP::Instance::Mode, MTP::Instance::Fields&&) ()
#16 0x0000000001b5c2db in MTP::Instance::Instance(MTP::Instance::Mode, MTP::Instance::Fields&&) ()
#17 0x0000000001c5243e in Main::Account::startMtp(std::unique_ptr<MTP::Config, std::default_delete<MTP::Config> >) ()
#18 0x0000000001c53cd2 in Main::Account::start(std::unique_ptr<MTP::Config, std::default_delete<MTP::Config> >) ()
#19 0x000000000195c8bc in Storage::Domain::startModern(QByteArray const&) ()
#20 0x000000000195cb09 in Storage::Domain::start(QByteArray const&) ()
#21 0x0000000001c2b8a4 in Main::Domain::start(QByteArray const&) ()
#22 0x00000000021a0cdd in Core::Application::startDomain() ()
#23 0x00000000021af25c in Core::Application::run() ()
#24 0x00000000021808d6 in Core::Sandbox::notify(QObject*, QEvent*) ()
#25 0x0000000003f5bf6a in  ()
#26 0x0000000003f5fab5 in  ()
#27 0x0000000003fb5343 in  ()
#28 0x00007ffff5df3267 in g_main_context_dispatch (context=0x68dd930) at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./glib/gmain.c:3154
        dispatch = 0x3fb5330
        prev_source = 0x0
        was_in_call = 0
        user_data = 0x0
        callback = 0x0
        cb_funcs = <optimized out>
        cb_data = <optimized out>
        need_destroy = <optimized out>
---Type <return> to continue, or q <return> to quit---
        source = 0x6a88130
        current = 0x690d3a0
        i = 0
#29 0x00007ffff5df3267 in g_main_context_dispatch (context=context@entry=0x68dd930) at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./glib/gmain.c:3769
#30 0x00007ffff5df34c0 in g_main_context_iterate (context=context@entry=0x68dd930, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./glib/gmain.c:3840
        max_priority = 0
        timeout = 0
        some_ready = 1
        nfds = <optimized out>
        allocated_nfds = 4
        fds = 0x6ac8810
#31 0x00007ffff5df356c in g_main_context_iteration (context=0x68dd930, may_block=1) at /build/glib2.0-XBSKIw/glib2.0-2.48.2/./glib/gmain.c:3901
        retval = <optimized out>
#32 0x0000000003fb547e in  ()
#33 0x0000000003f5ae9e in  ()
#34 0x0000000003f63f66 in  ()
#35 0x000000000218686b in Core::Sandbox::start() ()
#36 0x000000000218a478 in Core::Launcher::executeApplication() ()
#37 0x000000000218a615 in Core::Launcher::exec() ()
#38 0x0000000001040538 in main ()
ilya-fedin commented 3 years ago

I have it installed

What does pkg-config --cflags --libs gio-2.0 output? :thinking:

Dees7 commented 3 years ago

$pkg-config --cflags --libs gio-2.0 -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgio-2.0 -lgobject-2.0 -lglib-2.0

ilya-fedin commented 3 years ago

Oh, probably so old pkg-config version doesn't understand both arguments, so it should be gcc $(pkg-config --cflags gio-2.0) $(pkg-config --libs gio-2.0) -o network_available network_available.c

Dees7 commented 3 years ago

the same

$gcc $(pkg-config --cflags gio-2.0) $(pkg-config --libs gio-2.0) -o network_available network_available.c
/tmp/cc5OoSZw.o: In function `print_network_available':
network_available.c:(.text+0x5): undefined reference to `g_network_monitor_get_default'
network_available.c:(.text+0xd): undefined reference to `g_network_monitor_get_network_available'
network_available.c:(.text+0x2a): undefined reference to `g_print'
/tmp/cc5OoSZw.o: In function `network_available_changed':
network_available.c:(.text+0x4f): undefined reference to `g_application_release'
/tmp/cc5OoSZw.o: In function `activate':
network_available.c:(.text+0x6a): undefined reference to `g_application_hold'
network_available.c:(.text+0x79): undefined reference to `g_network_monitor_get_default'
network_available.c:(.text+0x9e): undefined reference to `g_signal_connect_data'
/tmp/cc5OoSZw.o: In function `main':
network_available.c:(.text+0xbf): undefined reference to `g_application_new'
network_available.c:(.text+0xea): undefined reference to `g_signal_connect_data'
network_available.c:(.text+0xff): undefined reference to `g_application_run'
network_available.c:(.text+0x10e): undefined reference to `g_object_unref'
collect2: error: ld returned 1 exit status
ilya-fedin commented 3 years ago

What does pkg-config --libs gio-2.0 output?

Dees7 commented 3 years ago

pkg-config --libs gio-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0

ilya-fedin commented 3 years ago

That's weird, it should work