Segmentation fault in on_sigint
Steps to reproduce:
- run
apk add
- pass SIGINT (well, ctrl+c) right after it prints the package db info, but before it quits. Takes a few tries, but I can quite reliably trigger it now.
- it segfaults
For triggering it in GDB, you additionally need to pass handle SIGINT noprint nostop pass
, because we don't want a break on SIGINT.
Backtrace:
#0 0x00007ffff7f8a933 in ?? () from /lib/ld-musl-x86_64.so.1
#1 0x00007ffff7f8acab in ?? () from /lib/ld-musl-x86_64.so.1
#2 0x00007ffff7f9d5cd in munmap () from /lib/ld-musl-x86_64.so.1
#3 0x0000555555566198 in db ()
#4 0x0000555555565880 in ?? ()
#5 0x0000000000000001 in ?? ()
#6 0x0000000000000030 in ?? ()
#7 0x00005555555661f8 in db ()
#8 0x00007ffff7cc67a0 in ?? () from /lib/libapk.so.3.12.0
#9 0x00007ffff782a210 in ?? ()
#10 0x00007ffff7ca739c in apk_db_close (db=0x555555565880 <db>) at src/database.c:1830
#11 0x0000555555558fc4 in on_sigint (s=2) at src/apk.c:424
#12 <signal handler called>
#13 0x00007ffff7f9d5cd in munmap () from /lib/ld-musl-x86_64.so.1
#14 0x00007ffff7ffdb7c in ?? () from /lib/ld-musl-x86_64.so.1
#15 0x0000000000002000 in ?? ()
#16 0x00007ffff7f8ae2a in ?? () from /lib/ld-musl-x86_64.so.1
#17 0x000000040000007f in ?? ()
#18 0x00007ffff7f8accc in ?? () from /lib/ld-musl-x86_64.so.1
#19 0x0000001d7fffffff in ?? ()
#20 0x00007ffff6b470a8 in ?? ()
#21 0x00007ffff6b47090 in ?? ()
#22 0x00005555555661c8 in db ()
#23 0x0000000000000000 in ?? ()