Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paccheck crashes on ArchLinux32 #64

Open
VorpalBlade opened this issue Jan 27, 2023 · 1 comment
Open

paccheck crashes on ArchLinux32 #64

VorpalBlade opened this issue Jan 27, 2023 · 1 comment

Comments

@VorpalBlade
Copy link

This happens with the version from this repo as well as from the Arch32 package.

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

Analysis with gdb:

(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}

Rebuilding like this fixes the issue:

make CFLAGS='-D_FILE_OFFSET_BITS=64' PREFIX=/

Presumably -D_FILE_OFFSET_BITS=64 needs to be set on 32-bit platforms. Maybe it is a mismatch in build flags between libalpm and pacutils?

Downstream Arch32 bug: https://bugs.archlinux32.org/index.php?do=details&task_id=317

@VorpalBlade
Copy link
Author

There does seem to be additional issues on 32-bit, I cannot get the unit tests to pass. But that should probably be a separate bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant