Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#75427 - [pacman] Segmentation fault

Attached to Project: Arch Linux
Opened by Daan De Meyer (DaanDeMeyer) - Tuesday, 26 July 2022, 13:24 GMT
Last edited by Toolybird (Toolybird) - Wednesday, 27 July 2022, 02:58 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

We've started seeing segmentation faults in pacman in mkosi CI: https://github.com/systemd/mkosi/runs/7519677330?check_suite_focus=true

The debug output from pacman can be found here: https://gist.github.com/DaanDeMeyer/fe5d42723e64f767da2750210fa24d19

Please let me know if any more information is needed.
This task depends upon

Closed by  Toolybird (Toolybird)
Wednesday, 27 July 2022, 02:58 GMT
Reason for closing:  Fixed
Additional comments about closing:  Reporter says "Bug is already fixed upstream"
Comment by Frantisek Sumsal (mrc0mmand) - Tuesday, 26 July 2022, 14:26 GMT
Stack trace from one of the crashes:

```
(gdb) bt full
#0 __pthread_kill_implementation (no_tid=0, signo=11, threadid=139950878517632) at ./nptl/pthread_kill.c:44
tid = <optimized out>
ret = 0
pd = 0x7f48da666980
old_mask = {__val = {4294967295, 94898335963780, 0, 0, 2, 18446744069414584320, 4294967295, 15, 0, 139947214372878, 2, 18446744069414584320, 4294967295, 139950934035076, 0, 6}}
ret = <optimized out>
pd = <optimized out>
old_mask = <optimized out>
ret = <optimized out>
tid = <optimized out>
ret = <optimized out>
resultvar = <optimized out>
resultvar = <optimized out>
__arg3 = <optimized out>
__arg2 = <optimized out>
__arg1 = <optimized out>
_a3 = <optimized out>
_a2 = <optimized out>
_a1 = <optimized out>
__futex = <optimized out>
resultvar = <optimized out>
__arg3 = <optimized out>
__arg2 = <optimized out>
__arg1 = <optimized out>
_a3 = <optimized out>
_a2 = <optimized out>
_a1 = <optimized out>
__futex = <optimized out>
__private = <optimized out>
__oldval = <optimized out>
result = <optimized out>
#1 __pthread_kill_internal (signo=11, threadid=139950878517632) at ./nptl/pthread_kill.c:78
No locals.
#2 __GI___pthread_kill (threadid=139950878517632, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
No locals.
#3 0x00007f48dda86476 in __GI_raise (sig=sig@entry=11) at ../sysdeps/posix/raise.c:26
ret = <optimized out>
#4 0x0000564f3d9add42 in segv_handler (signum=11) at ../pacman-6.0.1/src/pacman/sighandler.c:113
segvset = {__val = {1024, 14, 140733193388046, 140734763489280, 94898366244032, 0, 14, 0, 94898366244016, 0, 14, 140734763488448, 94898366244013, 0, 140733193388046, 0}}
msg = "\nerror: segmentation fault\nPlease submit a full bug report with --debug if appropriate.\n"
#5 <signal handler called>
No locals.
#6 0x00007f48ddd5ab3e in key_search_keyserver (handle=handle@entry=0x564f3f66d3e0, fpr=fpr@entry=0x564f3f694ae0 "991F6E3F0765CF6295888586139B09DA5BF0D338", pgpkey=pgpkey@entry=0x7fff5d95dab0) at ../pacman-6.0.1/lib/libalpm/signing.c:356
gpg_err = 0
ctx = 0x564f3f693f50
mode = <optimized out>
key = 0x564f3f688ea0
ret = -1
fpr_len = 40
full_fpr = 0x564f3f68e0e0 "0x991F6E3F0765CF6295888586139B09DA5BF0D338"
__func__ = "key_search_keyserver"
#7 0x00007f48ddd5b2b5 in _alpm_key_import (handle=handle@entry=0x564f3f66d3e0, uid=<optimized out>, fpr=0x564f3f694ae0 "991F6E3F0765CF6295888586139B09DA5BF0D338") at ../pacman-6.0.1/lib/libalpm/signing.c:529
ret = <optimized out>
fetch_key = {data = 0x564f3f688ea0, fingerprint = 0x564f3f68e9a0 "991F6E3F0765CF6295888586139B09DA5BF0D338", uid = 0x0, name = 0x0, email = 0x0, created = 0, expires = 0, length = 0, revoked = 0, pubkey_algo = 0 '\000'}
email = 0x0
question = {type = ALPM_QUESTION_IMPORT_KEY, import = 1, key = 0x7fff5d95dab0}
#8 0x00007f48ddd5c02b in _alpm_process_siglist (handle=handle@entry=0x564f3f66d3e0, identifier=0x564f3f711aa0 "libcap", siglist=0x564f3f683230, optional=<optimized out>, marginal=0, unknown=0) at ../pacman-6.0.1/lib/libalpm/signing.c:970
result = 0x564f3f688bc0
name = 0x564f3f694ae0 "991F6E3F0765CF6295888586139B09DA5BF0D338"
i = 0
retry = 0
#9 0x00007f48ddd5dfb5 in check_validity (handle=handle@entry=0x564f3f66d3e0, total=total@entry=26, total_bytes=total_bytes@entry=60316126) at ../pacman-6.0.1/lib/libalpm/sync.c:1025
v = 0x564f3f694a30
current = <optimized out>
current_bytes = <optimized out>
i = 0x564f3f68f4a0
errors = 0x564f3f68f4a0
event = {type = ALPM_EVENT_INTEGRITY_DONE, any = {type = ALPM_EVENT_INTEGRITY_DONE}, package_operation = {type = ALPM_EVENT_INTEGRITY_DONE, operation = 22095, oldpkg = 0x0, newpkg = 0x564f3f680ba0}, optdep_removal = {type = ALPM_EVENT_INTEGRITY_DONE, pkg = 0x0, optdep = 0x564f3f680ba0}, scriptlet_info = {type = ALPM_EVENT_INTEGRITY_DONE, line = 0x0}, database_missing = {type = ALPM_EVENT_INTEGRITY_DONE, dbname = 0x0}, pkgdownload = {type = ALPM_EVENT_INTEGRITY_DONE, file = 0x0}, pacnew_created = {type = ALPM_EVENT_INTEGRITY_DONE, from_noupgrade = 22095, oldpkg = 0x0, newpkg = 0x564f3f680ba0,
file = 0x564f3f6883f0 "8\a\233[JV"}, pacsave_created = {type = ALPM_EVENT_INTEGRITY_DONE, oldpkg = 0x0, file = 0x564f3f680ba0 "/var/cache/pacman/pkg/"}, hook = {type = ALPM_EVENT_INTEGRITY_DONE, when = (ALPM_HOOK_PRE_TRANSACTION | ALPM_HOOK_POST_TRANSACTION | unknown: 0x564c)}, hook_run = {type = ALPM_EVENT_INTEGRITY_DONE, name = 0x0, desc = 0x564f3f680ba0 "/var/cache/pacman/pkg/", position = 94898366219248, total = 119}, pkg_retrieve = {type = ALPM_EVENT_INTEGRITY_DONE, num = 0, total_size = 94898366188448}}
__func__ = "check_validity"
#10 0x00007f48ddd5f5c9 in _alpm_sync_load (handle=handle@entry=0x564f3f66d3e0, data=data@entry=0x7fff5d95dcd0) at ../pacman-6.0.1/lib/libalpm/sync.c:1173
i = <optimized out>
total = 26
total_bytes = 60316126
trans = 0x564f3f682bd0
#11 0x00007f48ddd5ffc6 in alpm_trans_commit (handle=0x564f3f66d3e0, data=data@entry=0x7fff5d95dcd0) at ../pacman-6.0.1/lib/libalpm/trans.c:188
trans = 0x564f3f682bd0
event = {type = 32767}
__func__ = "alpm_trans_commit"
#12 0x0000564f3d9af9eb in sync_prepare_execute () at ../pacman-6.0.1/src/pacman/sync.c:829
i = <optimized out>
packages = <optimized out>
data = 0x0
retval = 0
confirm = <optimized out>
#13 0x0000564f3d9afc84 in sync_trans (targets=targets@entry=0x564f3f6501d0) at ../pacman-6.0.1/src/pacman/sync.c:728
retval = 0
i = 0x0
#14 0x0000564f3d9afea4 in pacman_sync (targets=0x564f3f6501d0) at ../pacman-6.0.1/src/pacman/sync.c:958
sync_dbs = 0x564f3f680880
#15 0x0000564f3d9ac335 in main (argc=3, argv=0x7fff5d95dec8) at ../pacman-6.0.1/src/pacman/pacman.c:1258
ret = <optimized out>
myuid = <optimized out>
```

A gist link with the same stack trace, but a better formatting: https://gist.github.com/mrc0mmand/1f36977466df4fb82854ffcd4352e2e4
Comment by Frantisek Sumsal (mrc0mmand) - Tuesday, 26 July 2022, 15:02 GMT Comment by Frantisek Sumsal (mrc0mmand) - Tuesday, 26 July 2022, 15:41 GMT
This looks like a combination of the missing pacman patch mentioned above and a difference in gpg between Arch and Ubuntu Jammy (where this issue currently reproduces), as on Arch I get:

```
# gpg --debug 2 --receive-keys 991F6E3F0765CF6295888586139B09DA5BF0D338
gpg: reading options from '[cmdline]'
gpg: enabled debug flags: mpi
gpg: data source: https://162.213.33.8:443
gpg: armor header: Comment: Hostname:
gpg: armor header: Version: Hockeypuck 2.1.0-162-gff07af0
gpg: key 139B09DA5BF0D338: number of dropped non-self-signatures: 6
gpg: pub ed25519/139B09DA5BF0D338 2022-05-10 David Runge <dvzrv@archlinux.org>
gpg: using pgp trust model
gpg: key 139B09DA5BF0D338: public key "David Runge <dvzrv@archlinux.org>" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: secmem usage: 0/32768 bytes in 0 blocks
```

but on Ubuntu 22.04 I get

```
# gpg --debug 3 --receive-keys 991F6E3F0765CF6295888586139B09DA5BF0D338
gpg: reading options from '[cmdline]'
gpg: enabled debug flags: packet mpi
gpg: DBG: parse_packet(iob=1): type=6 length=51 (new_ctb) (parse.../../g10/import.c.930)
gpg: DBG: parse_packet(iob=1): type=14 length=51 (new_ctb) (parse.../../g10/import.c.930)
gpg: DBG: parse_packet(iob=1): type=2 length=126 (new_ctb) (parse.../../g10/import.c.930)
gpg: DBG: parse_packet(iob=1): type=14 length=56 (new_ctb) (parse.../../g10/import.c.930)
gpg: DBG: parse_packet(iob=1): type=2 length=126 (new_ctb) (parse.../../g10/import.c.930)
gpg: DBG: public key 139B09DA5BF0D338: timestamp: 2022-05-10 08:21:58 (1652170918)
gpg: DBG: subkey BCA1AA1BD6B976F5: timestamp: 2022-05-10 08:25:24 (1652171124)
gpg: DBG: sig: class: 0x18, issuer: 139B09DA5BF0D338, timestamp: 2022-05-10 08:25:24 (1652171124), digest: 51 9d
gpg: DBG: Good signature over last key or uid!
gpg: DBG: subkey 4B25DE8BCC520558: timestamp: 2022-05-10 08:21:58 (1652170918)
gpg: DBG: sig: class: 0x18, issuer: 139B09DA5BF0D338, timestamp: 2022-05-10 08:21:58 (1652170918), digest: 1e ac
gpg: DBG: Good signature over last key or uid!
gpg: key 139B09DA5BF0D338: new key but contains no user ID - skipped
gpg: Total number processed: 1
gpg: w/o user IDs: 1
gpg: secmem usage: 0/65536 bytes in 0 blocks
```

i.e. the key is missing a UUID on Ubuntu, which causes the segfault without the respective patch.

Loading...