• Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Packages
  • Assigned To
    Andreas Baumann
  • Operating System pentium4
  • Severity Medium
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Arch Linux 32
Opened by Arvid Norlander - 27.01.2023
Last edited by Andreas Baumann - 31.01.2023

FS#317 - [pacutils] paccheck core dumps

$ paccheck pacman
pacman: all dependencies satisfied
zsh: segmentation fault (core dumped) paccheck pacman

It seems to be in the –files check (as with that the crash happens quicker).

Debuginfod doesn’t seem to work for ArchLinux32 (unlike standard ArchLinux) so no debug symbols, but here is the gdb backtrace:

(gdb) bt
#0 0xb7d1989a in strnlen () from /usr/lib/libc.so.6
#1 0xb7d197ac in strncpy () from /usr/lib/libc.so.6
#2 0x00402abe in ?? ()
#3 0x0040244a in ?? ()
#4 0xb7c96129 in ?? () from /usr/lib/libc.so.6
#5 0xb7c961fd in __libc_start_main () from /usr/lib/libc.so.6
#6 0x004026f5 in ?? ()

Valgrind does not seem to work properly on Arch32 either, so I can’t test that.

Closed by  Andreas Baumann
31.01.2023 17:44
Reason for closing:  Fixed
Arvid Norlander commented on 27.01.2023 16:48

Some more info. I built paccheck locally with debug symbols (directly from git repo, not from PKGBUILD). I get a little bit more info with the crash:

(gdb) bt
#0  0xb7d1989a in strnlen () from /usr/lib/libc.so.6
#1  0xb7d197ac in strncpy () from /usr/lib/libc.so.6
#2  0x0040332b in check_files (pkg=0x427470) at paccheck.c:387
#3  0x00404c97 in main (argc=2, argv=0xbffff0d4) at paccheck.c:835
(gdb) up
#1  0xb7d197ac in strncpy () from /usr/lib/libc.so.6
(gdb) up
#2  0x0040332b in check_files (pkg=0x427470) at paccheck.c:387
387	   strncpy(rel, file.name, space);
(gdb) print rel
$1 = 0xbfffdf8d "etc"
(gdb) print file.name
$2 = 0x0
(gdb) print space
$3 = 4095
(gdb) print file
$4 = {name = 0x0, size = 4973296, mode = 0}

Looks like the issue is a null pointer. I have no clue why this only happens on Arch32 though.

Arvid Norlander commented on 27.01.2023 16:56

Rebuilding with

-D_FILE_OFFSET_BITS=64

fixes the issue.

Upstream bug: https://github.com/andrewgregory/pacutils/issues/64

I would suggest that the Arch32 PKGBUILD is patched with this simple addition to CFLAGS until upstream fixes it.

Arvid Norlander commented on 27.01.2023 17:10

Unfortunately I cannot get the PKGBUILD to build. The unit tests fail on Arch32 for me. Even with this change.

Admin
Andreas Baumann commented on 29.01.2023 13:38

The 64bit file offset patch indeed fixes the failing tests, thanks for that. :-) No, sadly we don't have the debuginfod infrastrcture as upstream, but setting
debug (resp. not setting !debug) in /etc/makepkg.conf and the building the packgage
gives you a pacutils-debug-0.11.1-1-pentium4.pkg.tar.zst file along
pacutils-0.11.1-1-pentium4.pkg.tar.zst.

I cannot reproduce funny effects (at least not with the debug version):

paccheck –md5sum –files –file-properties –backup –noupgrade pacman
pacman: all files match database
pacman: '/etc/pacman.conf' modification time mismatch (expected 2022-11-05 16:54:35)
pacman: '/etc/pacman.conf' size mismatch (expected 2.69 K)
pacman: '/etc/pacman.conf' md5sum mismatch (expected 1d9a603c49776e294c5a2140df7445b2)

This looks quite ok to me..

Patching added:

https://git.archlinux32.org/packages/commit/community/pacutils/PKGBUILD

Thanks for investigating and reporting, much appreciated. :-)

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing