antony-jr / AppImageUpdater

AppImage Updater for Humans built with QML/C++ with Qt5 :heart:.
GNU Lesser General Public License v3.0
40 stars 6 forks source link

n/w seqmentation fault when using libqxcb-glx-integration.so #26

Closed JuPlutonic closed 3 years ago

JuPlutonic commented 3 years ago

Last version 2.0.0 has seqmentation fault, 2.0.0beta1 hasn't got faults except the need to launch it with export QT_STYLE_OVERRIDE=Fusion OR -style=Fusion.

Linux userpc 5.4.0-72-generic #80~18.04.1-Ubuntu SMP Mon Apr 12 XXX 2021 x86_64 x86_64 x86_64 GNU/Linux OS: elementaryOS 5.12.9 Hera(Ubuntu 18.04 w/o any Qt installed) echo $QT_QPA_PLATFORMTHEME ``— empty, /home/user/.AppImageUpdater.lock and /home/user/core files — deleted.

//seqmentation fault when using libqxcb-glx-integration.so//
openat(AT_FDCWD, "/etc/os-release", O_RDONLY|O_CLOEXEC) = 12
fstat(12, {st_mode=S_IFREG|0644, st_size=393, ...}) = 0
read(12, "NAME=\"elementary OS\"\nVERSION=\"5."..., 393) = 393
close(12)                               = 0
write(11, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x20a5e70, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d364, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x209d360, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x20a5e70, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d364, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x209d360, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x20a5e70, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x209d360, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x20a5e70, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d364, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x209d360, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x20a5e70, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d364, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x209d360, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d364, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x209d360, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x20a5e70, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d364, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x209d360, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x20a5e70, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d364, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x209d360, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x209d364, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x209d310, FUTEX_WAKE_PRIVATE, 1) = 0
brk(0x212a000)                          = 0x212a000
access("/home/user/squashfs-root/usr/plugins/xcbglintegrations/.", F_OK) = 0
openat(AT_FDCWD, "/home/user/squashfs-root/usr/plugins/xcbglintegrations", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 12
fstat(12, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getdents(12, /* 3 entries */, 32768)    = 96
getdents(12, /* 0 entries */, 32768)    = 0
close(12)                               = 0
lstat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/user", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
lstat("/home/user/squashfs-root", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/user/squashfs-root/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/user/squashfs-root/usr/plugins", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/user/squashfs-root/usr/plugins/xcbglintegrations", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/user/squashfs-root/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so", {st_mode=S_IFREG|0644, st_size=74416, ...}) = 0
openat(AT_FDCWD, "/home/user/squashfs-root/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so", O_RDONLY|O_CLOEXEC) = 12
fstat(12, {st_mode=S_IFREG|0644, st_size=74416, ...}) = 0
fstat(12, {st_mode=S_IFREG|0644, st_size=74416, ...}) = 0
mmap(NULL, 74416, PROT_READ, MAP_SHARED, 12, 0) = 0x7fafaf5da000
close(12)                               = 0
munmap(0x7fafaf5da000, 74416)           = 0
access("/home/user/squashfs-root/usr/bin/xcbglintegrations/.", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/user/squashfs-root/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so.avx2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/home/user/squashfs-root/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so.avx2", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/user/squashfs-root/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so", O_RDONLY|O_CLOEXEC) = 12
read(12, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(12, {st_mode=S_IFREG|0644, st_size=74416, ...}) = 0
mmap(NULL, 76184, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 12, 0) = 0x7fafaf5da000
mmap(0x7fafaf5eb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 12, 0x10000) = 0x7fafaf5eb000
close(12)                               = 0
mprotect(0x7fafaf5eb000, 4096, PROT_READ) = 0
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base="b\0\3\0\3\0\0\0GLX\0", iov_len=12}], 1) = 12
futex(0x7ffd2d58bf58, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x2058068, FUTEX_WAKE_PRIVATE, 1) = 0
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base="\230\7\3\0\1\0\0\0\4\0\0\0", iov_len=12}], 1) = 12
futex(0x2058068, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x2058068, FUTEX_WAKE_PRIVATE, 1) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x30535f4d4f} ---
+++ killed by SIGSEGV (core dumped) +++
zsh: segmentation fault strace ~/squashfs-root/AppRun
JuPlutonic commented 3 years ago

But, when I run it run like ./AppImageUpdater-v2.0.0-x86_64.AppImage FreeTube_0.12.0_amd64_3d718a51d0088ee3984b5bc5b1933b33.AppImage (any .appimage file), it opens it like this:

QApplication: invalid style override passed, ignoring it.
    Available styles: Windows, Fusion
OS: elementary OS 5.1.7 Hera (5.1.7)
CPU Architecture: x86_64
Kernel Version: 5.4.0-72-generic
QAppImageUpdate Version: 2.0.2
LibTorrent Rasterbar Version: 1.2.8.0
AppImage Updater Commit: a8a4169
AppImage Updater Build Number: 77

W/o seqmentation error and w/o updating—processing of the file from the argument (FreeTube_0.12.0_amd64_3d718a51d0088ee3984b5bc5b1933b33.appimage).

-d --standalone-update-dialog works.

antony-jr commented 3 years ago

If the standalone update dialog works then it means that it's a QML error. I will look into it. Thanks for reporting.

antony-jr commented 3 years ago

@JuPlutonic I don't quite understand it.

I just ran v2.0.0 in elementary OS 5.1.7 Hera and there is only some error messages but the application seems to work fine. Also regarding passing arguments to the main applicatoin. There is no option for this due to design reasons and that's why we have standalone dialogs. Can you clearly explain what's your issue? is it segmentation fault?? Some ways I can reproduce?

elem

antony-jr commented 3 years ago

The main application you need to drag and drop desktop file, AppImage or directory with collection of AppImages. Or browse if you want but you can't pass a AppImage directly from the command line but you can use -d argument for that.

JuPlutonic commented 3 years ago

I restarted terminal and loose ends.

Only segmentation faul remainingif I dragging zsync-contained file then I alternate it with next file balenaEther (w/o zsync info), and, finally drugging again zsync-contained file.

    INFO:   setAppImage :  "/opt/Applications/appimage-cli-tool-0.1.4-x86_64.AppImage" . 
   INFO:   getInfo : AppImage is confirmed to be type 2. 
   INFO:   getInfo : mapping AppImage to memory. 
   INFO:   getInfo : AppImage architecture is x86_64 (64 bits). 
   INFO:   getInfo : updateString( "gh-releases-zsync|AppImageCrafters|appimage-cli-tool|latest|appimage-cli-tool-*x86_64.AppImage.zsync" ). 
   INFO:   getInfo : finished. 
   INFO:  setControlFileUrl : using github releases zsync transport. 
   INFO:  setControlFileUrl : github api request( QUrl("https://api.github.com/repos/AppImageCrafters/appimage-cli-tool/releases/latest") ). 
  FATAL:   handleNetworkError :  QNetworkReply::SslHandshakeFailedError . 
   INFO:   handleGithubAPIResponse : starting to parse github api response. 
Failed::  1
   INFO:   setAppImage :  "/opt/Applications/balenaEtcher-1.5.109-x64.AppImage" . 
   INFO:   getInfo : AppImage is confirmed to be type 2. 
   INFO:   getInfo : mapping AppImage to memory. 
   INFO:   getInfo : AppImage architecture is x86_64 (64 bits). 
  FATAL:   getInfo : update information is empty. 
Failed::  2
   INFO:   setAppImage :  "/opt/Applications/DB_Browser_for_SQLite--x86_64.AppImage" . 
   INFO:   getInfo : AppImage is confirmed to be type 2. 
   INFO:   getInfo : mapping AppImage to memory. 
   INFO:   getInfo : AppImage architecture is x86_64 (64 bits). 
   INFO:   getInfo : updateString( "gh-releases-zsync|sqlitebrowser|sqlitebrowser|continuous|DB_Browser_for_SQLite*-x86_64.AppImage.zsync" ). 
   INFO:   getInfo : finished. 
   INFO:  setControlFileUrl : using github releases zsync transport. 
   INFO:  setControlFileUrl : github api request( QUrl("https://api.github.com/repos/sqlitebrowser/sqlitebrowser/releases/tags/continuous") ). 
free(): double free detected in tcache 2
  FATAL:   handleNetworkError :  QNetworkReply::SslHandshakeFailedError . 
   INFO:   handleGithubAPIResponse : starting to parse github api response. 
zsh: abort (core dumped)  ./AppImageUpdater-v2.0.0-x86_64.AppImage
antony-jr commented 3 years ago

So first you dragged a AppImage with zsync update , then balenaEtcher which does not have zsync info and finally a AppImage with zsync info then it crashed like this.

The interesting part is,

FATAL:   handleNetworkError :  QNetworkReply::SslHandshakeFailedError
free(): double free in tcache2

I will look into this ASAP.

JuPlutonic commented 3 years ago

Yes, ok, I dumped crush https://gofile.io/d/atK9xE, it's actually 266Mb bzipped to 15M.

Yep, something happend to cache/tmp during zsync download.

antony-jr commented 3 years ago

@JuPlutonic This seems like a network problem of some sort. Are you using a proxy or some kind of special network or something. Thanks for the debug information but I really can't debug the dump since AppImages are not debugger friendly(I tried to). The application output in the terminal gives us more information.

Now I want to know when does this error occur, can you reproduce it everytime or randomly?? Because in my Virtual Installation I have no SSL errors or segmentation fault. I even tried to reproduce your case. I can't reproduce your case at all.

JuPlutonic commented 3 years ago

To reproduce i need 2 times drop / select appimages (with zsync).

Selecting different types of connection WAN/Cellular/torified-shell didn't make difference.

Update I overcome termination/crush when run LD_LIBRARY_PATH="/home/user/squashfs-root/usr/lib" ~/squashfs-root/AppRun -style=Fusion command (--appimage-expract (-ed)), also I deleted /home/user/.drirc file. Now I can work with /opt/AppImageUpdater-v2.0.0-x86_64.AppImage without crushing. Thank you for help!

antony-jr commented 3 years ago

Hmm... Nice to see it's fixed. But you should always execute the AppImage without extracting. LD_LIBRARY_PATH will be automatically set if you execute the AppImage not the AppRun directly.