AppImageUpdate icon indicating copy to clipboard operation
AppImageUpdate copied to clipboard

Segfaults when updating itself

Open probonopd opened this issue 6 years ago • 12 comments

me@host:~$ sudo /isodevice/Applications/AppImageUpdate-x86_64.AppImage /isodevice/Applications/AppImageUpdate-x86_64.AppImage
AppImageUpdate version 1-alpha (commit d855332), build 410 built on 2019-07-29 14:59:00 UTC
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Fetching release information for tag "continuous" from GitHub API.
Updating from GitHub Releases via ZSync
zsync2: /isodevice/Applications/AppImageUpdate-x86_64.AppImage found, using as seed file
zsync2: /isodevice/Applications/AppImageUpdate-x86_64.AppImage.part found, using as seed file
zsync2: Target file: /isodevice/Applications/AppImageUpdate-x86_64.AppImage
zsync2: Reading seed file: /isodevice/Applications/AppImageUpdate-x86_64.AppImage
zsync2: Usable data from seed files: 100.000000%
zsync2: Renaming temp file
zsync2: Fetching remaining blocks
zsync2: Verifying downloaded file
zsync2: checksum matches OK
zsync2: Unable to backup /isodevice/Applications/AppImageUpdate-x86_64.AppImage to /isodevice/Applications/AppImageUpdate-x86_64.AppImage.zs-old
zsync2: used 25841664 local, fetched 0
Segmentation fault

probonopd avatar Aug 03 '19 10:08 probonopd

Can't reproduce this behavior. Works fine.

Please add more details, which are obviously needed for debugging.

TheAssassin avatar Aug 03 '19 17:08 TheAssassin

me@host:~$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

me@host:~$ sudo /isodevice/Applications/AppImageUpdate-x86_64.AppImage /isodevice/Applications/AppImageUpdate-x86_64.AppImage
AppImageUpdate version 1-alpha (commit d855332), build 410 built on 2019-07-29 14:59:00 UTC
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Fetching release information for tag "continuous" from GitHub API.
Updating from GitHub Releases via ZSync
zsync2: /isodevice/Applications/AppImageUpdate-x86_64.AppImage found, using as seed file
zsync2: /isodevice/Applications/AppImageUpdate-x86_64.AppImage.part found, using as seed file
zsync2: Target file: /isodevice/Applications/AppImageUpdate-x86_64.AppImage
zsync2: Reading seed file: /isodevice/Applications/AppImageUpdate-x86_64.AppImage
zsync2: Usable data from seed files: 100.000000%
zsync2: Renaming temp file
zsync2: Fetching remaining blocks
zsync2: Verifying downloaded file
zsync2: checksum matches OK
zsync2: Unable to backup /isodevice/Applications/AppImageUpdate-x86_64.AppImage to /isodevice/Applications/AppImageUpdate-x86_64.AppImage.zs-old
zsync2: used 25841664 local, fetched 0
Segmentation fault

me@host:~$ ls /isodevice/Applications/AppImageUpdate*
me@host:~$ ls -lh /isodevice/Applications/AppImageUpdate*
-rwxr-xr-x 1 root root    0 Nov  4  2018 /isodevice/Applications/AppImageUpdater-continuous-x86_64.AppImage.zs-old.part
-rwxr-xr-x 1 root root  25M Jul 31 11:16 /isodevice/Applications/AppImageUpdate-x86_64.AppImage
-rwxr-xr-x 1 root root  25M Aug  4 11:38 /isodevice/Applications/AppImageUpdate-x86_64.AppImage.part

I would not be entirely surprised if the .part and .zs-old.part stuff might somehow have to do with it.

Please add more details

Please let me know which kind of additional information is needed. I am running my usual setup:

  • System running from Live ISO
  • /isodevice/Applications is FAT32 and only writable by root

probonopd avatar Aug 04 '19 09:08 probonopd

Relevant strace output:

(...)
[pid  3671] read(17, "", 4096)          = 0
[pid  3671] close(17)                   = 0
[pid  3671] openat(AT_FDCWD, "/isodevice/Applications/AppImageUpdate-x86_64.AppImage", O_RDONLY) = 17
[pid  3671] close(17)                   = 0
[pid  3671] unlink("/isodevice/Applications/AppImageUpdate-x86_64.AppImage.zs-old") = -1 ENOENT (No such file or directory)
[pid  3671] stat("/isodevice/Applications/AppImageUpdate-x86_64.AppImage", {st_mode=S_IFREG|0755, st_size=25841640, ...}) = 0
[pid  3671] chmod("/isodevice/Applications/AppImageUpdate-x86_64.AppImage.part", 0100755) = 0
[pid  3671] link("/isodevice/Applications/AppImageUpdate-x86_64.AppImage", "/isodevice/Applications/AppImageUpdate-x86_64.AppImage.zs$
[pid  3671] madvise(0x7ffaceffe000, 8368128, MADV_DONTNEED) = 0
[pid  3671] exit(0)                     = ?
[pid  3671] +++ exited with 0 +++
[pid  3663] <... poll resumed> )        = 0 (Timeout)
[pid  3663] write(2, "zsync2: checksum matches OK", 27zsync2: checksum matches OK) = 27
[pid  3663] write(2, "\n", 1
)           = 1
[pid  3663] write(7, "\1\0\0\0\0\0\0\0", 8) = 8
[pid  3663] write(2, "zsync2: Unable to backup /isodev"..., 144zsync2: Unable to backup /isodevice/Applications/AppImageUpdate-x86_64$
[pid  3663] write(2, "\n", 1
)           = 1
[pid  3663] write(7, "\1\0\0\0\0\0\0\0", 8) = 8
[pid  3663] write(2, "zsync2: used 25841664 local, fet"..., 38zsync2: used 25841664 local, fetched 0) = 38
[pid  3663] write(2, "\n", 1
)           = 1
[pid  3663] write(7, "\1\0\0\0\0\0\0\0", 8) = 8
[pid  3663] write(7, "\1\0\0\0\0\0\0\0", 8) = 8
[pid  3663] lstat("/isodevice", {st_mode=S_IFDIR|0755, st_size=32768, ...}) = 0
[pid  3663] lstat("/isodevice/Applications", {st_mode=S_IFDIR|0755, st_size=32768, ...}) = 0
[pid  3663] lstat("/isodevice/Applications/AppImageUpdate-x86_64.AppImage", {st_mode=S_IFREG|0755, st_size=25841640, ...}) = 0
[pid  3663] openat(AT_FDCWD, "/isodevice/Applications/AppImageUpdate-x86_64.AppImage.zs-old", O_RDONLY) = -1 ENOENT (No such file or $
[pid  3663] lseek(-1, 0, SEEK_END)      = -1 EBADF (Bad file descriptor)
[pid  3663] mmap(NULL, 18446744073709551615, PROT_READ, MAP_SHARED, -1, 0) = -1 EBADF (Bad file descriptor)
[pid  3663] close(-1)                   = -1 EBADF (Bad file descriptor)
[pid  3663] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x3} ---
[pid  3669] <... poll resumed> <unfinished ...>) = ?
[pid  3668] <... poll resumed> <unfinished ...>) = ?
[pid  3669] +++ killed by SIGSEGV +++
[pid  3668] +++ killed by SIGSEGV +++

probonopd avatar Aug 04 '19 09:08 probonopd

It also crashes if I do this:

me@host:~$ sudo cp /isodevice/Applications/AppImageUpdate-x86_64.AppImage /home/me/
me@host:~$ /home/me/AppImageUpdate-x86_64.AppImage /home/me/AppImageUpdate-x86_64.AppImage 
AppImageUpdate version 1-alpha (commit d855332), build 410 built on 2019-07-29 14:59:00 UTC
Fetching release information for tag "continuous" from GitHub API.
Updating from GitHub Releases via ZSync
zsync2: /home/me/AppImageUpdate-x86_64.AppImage found, using as seed file
zsync2: Target file: /home/me/AppImageUpdate-x86_64.AppImage
zsync2: Reading seed file: /home/me/AppImageUpdate-x86_64.AppImage
zsync2: Usable data from seed files: 100.000000%
zsync2: Renaming temp file
zsync2: Fetching remaining blocks
zsync2: Verifying downloaded file
zsync2: checksum matches OK
zsync2: Unable to backup /home/me/AppImageUpdate-x86_64.AppImage to /home/me/AppImageUpdate-x86_64.AppImage.zs-old
zsync2: used 25841664 local, fetched 0
Segmentation fault
me@host:~$ ls /home/me/AppImageUpdate-x86_64.AppImage*
/home/me/AppImageUpdate-x86_64.AppImage  /home/me/AppImageUpdate-x86_64.AppImage.part

In this case, it is a permissions problem, because the following works:

me@host:~$ sudo chown -R $USER .
me@host:~$ /home/me/AppImageUpdate-x86_64.AppImage /home/me/AppImageUpdate-x86_64.AppImage 
AppImageUpdate version 1-alpha (commit d855332), build 410 built on 2019-07-29 14:59:00 UTC
Fetching release information for tag "continuous" from GitHub API.
Updating from GitHub Releases via ZSync
zsync2: /home/me/AppImageUpdate-x86_64.AppImage found, using as seed file
zsync2: /home/me/AppImageUpdate-x86_64.AppImage.part found, using as seed file
zsync2: Target file: /home/me/AppImageUpdate-x86_64.AppImage
zsync2: Reading seed file: /home/me/AppImageUpdate-x86_64.AppImage
zsync2: Usable data from seed files: 100.000000%
zsync2: Renaming temp file
zsync2: Fetching remaining blocks
zsync2: Verifying downloaded file
zsync2: checksum matches OK
zsync2: used 25841664 local, fetched 0

But why does it crash in the case above, where I am running AppImageUpdate with sudo?

So, 2 issues:

  • In case of a permissions problem, it should either work around the permissions problem or at least show a non-misleading error instead of segfaulting
  • In case it is run with sudo, it should not have a permissions problem, right?

probonopd avatar Aug 04 '19 09:08 probonopd

A stacktrace would be helpful. AFAIR AppImageUpdate is built with debug info. Perhaps you can update something root-owned with an extracted AIU that you run with gdb? That'll point us to the offending line in the code.

TheAssassin avatar Aug 04 '19 12:08 TheAssassin

Sure I can do that if you show me the exact commands. I am not a gdb guru ;)

probonopd avatar Aug 04 '19 12:08 probonopd

https://www.geeksforgeeks.org/gdb-step-by-step-introduction/ will show you the basics.

TheAssassin avatar Aug 04 '19 12:08 TheAssassin

No, I meant copy&pasteable. I don't want to figure it out myself

probonopd avatar Aug 04 '19 12:08 probonopd

You should, though. Every app author is happy if the user just provides some stacktrace for debugging...

Just go to the page, it shows how to run an app through gdb. If the app really segfaults, you'll be shown. Then you can create a backtrace using the commands shown there.

You want the bug fixed, so I can expect a little effort from you, right? I mean, after all, you want me to spend quite some time on looking into a problem affecting you?

TheAssassin avatar Aug 04 '19 12:08 TheAssassin

I cannot spend time on debugging this right now, sorry. Once you have some time please see if you can reproduce it.

probonopd avatar Aug 04 '19 12:08 probonopd

I can not, I also have no time. Then we can close this.

TheAssassin avatar Aug 04 '19 12:08 TheAssassin

Not having time does not mean there is no bug. Someone will need to look at this at some time.

probonopd avatar Aug 04 '19 12:08 probonopd