Yes, I have reproduced it multiple times on two separate hosts (Windows 10 and Ubuntu 20.04)
Annoyingly, it does not segfault when I install strace first. Installing gdb first also segfaults (but installing strace first, then gdb, works) Installing valgrind first, then installing --cifs-utils does not segfault, but it reports some errors:
> valgrind apk add --update cifs-utils==12== Memcheck, a memory error detector==12== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.==12== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info==12== Command: apk add --update cifs-utils==12==(1/18) Installing libcap (2.46-r0)(2/18) Installing keyutils-libs (1.6.3-r0)(3/18) Installing krb5-conf (1.0-r2)(4/18) Installing libcom_err (1.45.6-r1)(5/18) Installing libverto (0.3.1-r1) 2% ## ==12== Invalid read of size 8==12== at 0x4B6415C: fetch_cache_put (in /lib/libapk.so.3.12.0)==12== by 0x4B6804C: ??? (in /lib/libapk.so.3.12.0)==12== by 0x4B65200: fetchIO_close (in /lib/libapk.so.3.12.0)==12== by 0x4B622F3: ??? (in /lib/libapk.so.3.12.0)==12== by 0x4B62564: ??? (in /lib/libapk.so.3.12.0)==12== by 0x4B63382: apk_tar_parse (in /lib/libapk.so.3.12.0)==12== by 0x4B59759: ??? (in /lib/libapk.so.3.12.0)==12== by 0x4B59A04: apk_db_install_pkg (in /lib/libapk.so.3.12.0)==12== by 0x4B5CC39: apk_solver_commit_changeset (in /lib/libapk.so.3.12.0)==12== by 0x4B5D388: apk_solver_commit (in /lib/libapk.so.3.12.0)==12== by 0x10DA7C: ??? (in /sbin/apk)==12== by 0x10CC5F: ??? (in /sbin/apk)==12== Address 0x51c8640 is 128 bytes inside a block of size 136 free'd==12== at 0x48A2794: free (vg_replace_malloc.c:538)==12== by 0x4B64A9C: fetch_close (in /lib/libapk.so.3.12.0)==12== by 0x4B64152: fetch_cache_put (in /lib/libapk.so.3.12.0)==12== by 0x4B6804C: ??? (in /lib/libapk.so.3.12.0)==12== by 0x4B65200: fetchIO_close (in /lib/libapk.so.3.12.0)==12== by 0x4B622F3: ??? (in /lib/libapk.so.3.12.0)==12== by 0x4B62564: ??? (in /lib/libapk.so.3.12.0)==12== by 0x4B63382: apk_tar_parse (in /lib/libapk.so.3.12.0)==12== by 0x4B59759: ??? (in /lib/libapk.so.3.12.0)==12== by 0x4B59A04: apk_db_install_pkg (in /lib/libapk.so.3.12.0)==12== by 0x4B5CC39: apk_solver_commit_changeset (in /lib/libapk.so.3.12.0)==12== by 0x4B5D388: apk_solver_commit (in /lib/libapk.so.3.12.0)==12== Block was alloc'd at==12== at 0x48A3737: calloc (vg_replace_malloc.c:760)==12== by 0x4B63D13: fetch_reopen (in /lib/libapk.so.3.12.0)==12== by 0x4B63F16: fetch_connect (in /lib/libapk.so.3.12.0)==12== by 0x4B68D1F: http_request (in /lib/libapk.so.3.12.0)==12== by 0x4B6242D: apk_istream_from_fd_url_if_modified (in /lib/libapk.so.3.12.0)==12== by 0x4B595CF: ??? (in /lib/libapk.so.3.12.0)==12== by 0x4B59A04: apk_db_install_pkg (in /lib/libapk.so.3.12.0)==12== by 0x4B5CC39: apk_solver_commit_changeset (in /lib/libapk.so.3.12.0)==12== by 0x4B5D388: apk_solver_commit (in /lib/libapk.so.3.12.0)==12== by 0x10DA7C: ??? (in /sbin/apk)==12== by 0x10CC5F: ??? (in /sbin/apk)==12== by 0x401CA02: ??? (in /lib/ld-musl-x86_64.so.1)==12==(6/18) Installing krb5-libs (1.18.3-r1)(7/18) Installing talloc (2.3.1-r0)(8/18) Installing gmp (6.2.1-r0)(9/18) Installing nettle (3.7-r0)(10/18) Installing libffi (3.3-r2)(11/18) Installing p11-kit (0.23.22-r0)(12/18) Installing libtasn1 (4.16.0-r1)(13/18) Installing libunistring (0.9.10-r0)(14/18) Installing gnutls (3.7.0-r0)(15/18) Installing tevent (0.10.2-r0)(16/18) Installing samba-util-libs (4.13.3-r1)(17/18) Installing libwbclient (4.13.3-r1)(18/18) Installing cifs-utils (6.12-r0)Executing busybox-1.32.1-r0.triggerOK: 119 MiB in 33 packages==12====12== HEAP SUMMARY:==12== in use at exit: 262,152 bytes in 2 blocks==12== total heap usage: 1,200,046 allocs, 1,200,044 frees, 2,303,615,740 bytes allocated==12====12== LEAK SUMMARY:==12== definitely lost: 0 bytes in 0 blocks==12== indirectly lost: 0 bytes in 0 blocks==12== possibly lost: 0 bytes in 0 blocks==12== still reachable: 262,152 bytes in 2 blocks==12== suppressed: 0 bytes in 0 blocks==12== Rerun with --leak-check=full to see details of leaked memory==12====12== For lists of detected and suppressed errors, rerun with: -s==12== ERROR SUMMARY: 14 errors from 1 contexts (suppressed: 0 from 0)
Does apk create crash dumps so I can first run the failing command, then analyze the dump? I'm not well-versed in Linux debugging, so I will probably require some help.
Thanks for this. I think I know what the issue is, and will soon push a fix. Though, I am wondering what is causing this. Would it be possible to see the repositories file? Is it going through proxy, or some server giving HTTP redirect responses?
Is it one or more proxies? Would it be possible to see the proxy related config, and if DNS used, the DNS entries present? Actual IP:s are not needed, I just would like to understand is there a pool of proxies, or single address?