Subject: Re: APK Package Name Issue on armel port

From: Carl Chave <[email-masked]>
Date: Thu, 20 Feb 2020 20:14:23 -0500

> Sorry for not being more clear.
>
> You need to add apk-tools-dbg subpackage, rebuild that way, and then crash all in gdb after making sure the debug symbols are installed.
>
> Ariadne

Is this any better?

localhost:~# gdb apk
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "armv5-alpine-linux-musleabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from apk...
Reading symbols from /usr/lib/debug//sbin/apk.debug...
(gdb) run apk list
Starting program: /sbin/apk apk list

Program received signal SIGBUS, Bus error.
0x0040b7fc in csum_hash (csum=...) at src/database.c:130
130    src/database.c: No such file or directory.
(gdb) backtrace
#0  0x0040b7fc in csum_hash (csum=...) at src/database.c:130
#1  0x0040ddd4 in apk_hash_from_key (h=0x43e0e4 <db+1600>, key=...)
    at src/apk_hash.h:58
#2  apk_hash_get (h=h@entry=0x43e0e4 <db+1600>, key=...) at src/apk_hash.h:70
#3  0x0040f440 in apk_db_pkg_add (db=db@entry=0x43daa4 <db>,
    pkg=pkg@entry=0x48f1b0) at src/database.c:528
#4  0x004105b0 in apk_db_index_read (db=db@entry=0x43daa4 <db>,
    bs=bs@entry=0x48f180, repo=repo@entry=-1) at src/database.c:792
#5  0x00411a68 in apk_db_read_state (db=db@entry=0x43daa4 <db>, flags=1)
    at src/database.c:1165
#6  0x0041215c in apk_db_open (db=0x43daa4 <db>, dbopts=0x7efffc9c)
    at src/database.c:1668
#7  0x00404590 in main (argc=2, argv=0x7efffe28) at src/apk.c:625
(gdb)

---

From: Timo Teras <[email-masked]>
Date: Fri, 21 Feb 2020 09:36:33 +0200

On Thu, 20 Feb 2020 20:14:23 -0500
Carl Chave <[email-masked]> wrote:

> > You need to add apk-tools-dbg subpackage, rebuild that way, and
> > then crash all in gdb after making sure the debug symbols are
> > installed.
> 
> Is this any better?
> 
> localhost:~# gdb apk
>[snip]...
> 
> #2  apk_hash_get (h=h@entry=0x43e0e4 <db+1600>, key=...) at
> src/apk_hash.h:70 #3  0x0040f440 in apk_db_pkg_add
> (db=db@entry=0x43daa4 <db>, pkg=pkg@entry=0x48f1b0) at
> src/database.c:528 #4  0x004105b0 in apk_db_index_read
> (db=db@entry=0x43daa4 <db>, bs=bs@entry=0x48f180, repo=repo@entry=-1)
> at src/database.c:792 #5  0x00411a68 in apk_db_read_state
> (db=db@entry=0x43daa4 <db>, flags=1) at src/database.c:1165

This is perfect!

Should be fixed now in:
https://gitlab.alpinelinux.org/alpine/apk-tools/commit/c054fbc11e9beca0d45285c3e1f448c81416c5ce

Hopefully this was the last one (I did try to grep for similar things a
bit)...

Thanks!
Timo

---

From: Carl Chave <[email-masked]>
Date: Fri, 21 Feb 2020 22:31:53 -0500

> Hopefully this was the last one (I did try to grep for similar things a

I recompiled apk-tools with the latest patch and everything looks
good.  Thanks a lot for the help Timo, Ariadne, and arw.

Cheers,
Carl

---

From: Timo Teras <[email-masked]>
Date: Sat, 22 Feb 2020 11:21:12 +0200

On Fri, 21 Feb 2020 22:31:53 -0500
Carl Chave <[email-masked]> wrote:

> > Hopefully this was the last one (I did try to grep for similar
> > things a bit)...
> 

Wonderful! Thank you for the report and debugging help.

Timo