Segfault in "Trying to list upgradable packages"
Summary
I've tried to work around #18 (closed) with a transitional package, that has the old name, but depends on the new package:
pkgname=postmarketos-config-firefox
pkgver=1.0.1
pkgrel=0
pkgdesc="Firefox tweaks for mobile and privacy (transition package)"
url="https://gitlab.com/postmarketOS/mobile-config-firefox"
source=""
arch="noarch"
license="GPL-3.0-or-later"
options="!check" # No tests
depends="mobile-config-firefox"
package() {
mkdir -p "$pkgdir"
}
How to reproduce
- flash the pinephone factory image
- build the package above on your pc
- host it in a local repository, add that repo to your phone
- login via ssh, run
$ ulimit -c unlimited # enable core dumps
$ sudo apk add -u apk-polkit apk-polkit-dbg musl-dbg openssl-dbg
$ sudo /usr/libexec/apk-polkit/apkd-dbus-server --replace --debug 3
APKINDEX files causing the crash
/var/cache/apk/APKINDEX.*.tar.gz
:
Logs
Debug logs
sudo /usr/libexec/apk-polkit/apkd-dbus-server --replace --debug 3
2020-09-02T09:25:57.774 [trace] DbusServer.d:110:this Trying to acquire DBus name dev.Cogitri.apkPolkit.Helper.
2020-09-02T09:25:57.786 [trace] DbusServer.d:670:onBusAcquired Acquired the DBus connection
2020-09-02T09:25:57.791 [trace] DbusServer.d:686:onNameAcquired Acquired the DBus name 'dev.Cogitri.apkPolkit.Helper'
2020-09-02T09:26:08.224 [trace] DbusServer.d:583:methodHandler Handling method GetAll from sender :1.75
2020-09-02T09:26:08.247 [info] Polkit.d:68:queryPolkitAuth Polkit authorized operation dev.Cogitri.apkPolkit.Helper.getAll
2020-09-02T09:26:08.850 [trace] DbusServer.d:583:methodHandler Handling method updateRepositories from sender :1.75
2020-09-02T09:26:08.863 [info] Polkit.d:68:queryPolkitAuth Polkit authorized operation dev.Cogitri.apkPolkit.Helper.updateRepositories
2020-09-02T09:26:08.863 [trace] DbusServer.d:374:updateRepositories Trying to update repositories.
fetch http://192.168.1.37:8000/aarch64/APKINDEX.tar.gz
fetch http://postmarketos1.brixit.nl/postmarketos/v20.05/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/APKINDEX.tar.gz
2020-09-02T09:26:11.283 [trace] DbusServer.d:382:updateRepositories Successfully updated repositories.
2020-09-02T09:26:12.475 [trace] DbusServer.d:583:methodHandler Handling method listUpgradablePackages from sender :1.75
2020-09-02T09:26:12.489 [info] Polkit.d:68:queryPolkitAuth Polkit authorized operation dev.Cogitri.apkPolkit.Helper.listUpgradablePackages
2020-09-02T09:26:12.490 [trace] DbusServer.d:331:listUpgradablePackages Trying to list upgradable packages
(process:3543): GLib-CRITICAL **: 09:26:13.779: g_variant_get_child_value: assertion 'index_ < g_variant_n_children (value)' failed
Segmentation fault
Stack trace (not sure if done properly):
$ gdb -q /usr/libexec/apk-polkit/apkd-dbus-server core
Reading symbols from /usr/libexec/apk-polkit/apkd-dbus-server...
Reading symbols from /usr/lib/debug//usr/libexec/apk-polkit/apkd-dbus-server.debug...
warning: core file may not match specified executable file.
[New LWP 3623]
[New LWP 3624]
[New LWP 3625]
[New LWP 3636]
[New LWP 3626]
warning: Can't read pathname for load map: No error information.
Core was generated by `/usr/libexec/apk-polkit/apkd-dbus-server --replace --debug 3'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000ffff96a6598c in _D16apkd_dbus_server10DBusServerQm16getNumOfPackagesFC4glib7VariantQiZm () from /usr/lib/libapkd-dbus-server.so
[Current thread is 1 (LWP 3623)]
(gdb) bt
#0 0x0000ffff96a6598c in _D16apkd_dbus_server10DBusServerQm16getNumOfPackagesFC4glib7VariantQiZm () from /usr/lib/libapkd-dbus-server.so
#1 0x0000ffff96a66c10 in _D16apkd_dbus_server10DBusServerQm13methodHandlerUPS3gio1c5types15GDBusConnectionxPaxQdxQgxQjPS4glibQBsQBt8GVariantPSQCnQCmQCn21GDBusMethodInvocationPvZv () from /usr/lib/libapkd-dbus-server.so
#2 0x0000ffff961cbdf4 in ?? () from /usr/lib/libgio-2.0.so.0
#3 0x0000ffff9634e348 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#4 0x0000ffff9634e590 in ?? () from /usr/lib/libglib-2.0.so.0
#5 0x0000ffff9634e9f0 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#6 0x0000ffff96c9a63c in _D4glib8MainLoopQj3runMFZv () from /usr/lib/libglibd-2.0.so.2
#7 0x0000aaaadc37cee4 in apkd_dbus_server.main._main(immutable(char)[][]) ()
#8 0x0000ffff964f8520 in _D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv () from /usr/lib/libdruntime-ldc-shared.so.90
#9 0x0000ffff964f82d8 in _d_run_main2 () from /usr/lib/libdruntime-ldc-shared.so.90
#10 0x0000ffff964f8168 in _d_run_main () from /usr/lib/libdruntime-ldc-shared.so.90
#11 0x0000aaaadc37cbb4 in main ()