"bk clone bk://bkbits.net/u/bk/dev dev" segfaults after being built from the source tarball on mageia v8 x86-64

~/Download/unpack/to-del/ rm -fr dev
~/Download/unpack/to-del/ bk clone bk://bkbits.net/u/bk/dev dev
Clone bk://bkbits.net/u/bk/dev
   -> file:///home/shlomif/Download/unpack/to-del/dev
.                                  100% |==============================|
seg fault to addr 0x503128c
0/0 .                              100% |==============================| FAILED
~/Download/unpack/to-del/ which bk

Not much data here to reproduce this issue. Want to include bk version output from the version of bk using the clone? And a link to the source tree and some information about where that source was built.

Also running ‘make g’ should give you a debug binary and then running the clone with valgrind might give some useful hints.

Thanks! I’ll follow your advice and return to you.

Hi! See https://www.shlomifish.org/Files/files/text/bk-report.txt.xz for the compressed report of these two shell functions:

#! /bin/bash
# bk-report.bash
# Copyright (C) 2020 Shlomi Fish <shlomif@cpan.org>
# Distributed under terms of the MIT license.

set -e -x

export CPATH=/usr/include/tomcrypt
cd ~/Download/unpack/to-del
if test -e bk-bin
    chmod -R 777 bk-bin
rm -fr bk-"$ver" bk-bin
tar -xvf ~/Download/Arcs/bk-"$ver".src.tar.gz
cd bk-"$ver"
cd src
make -j4 g
make image
) 2>&1 | tee ~/bk-report.txt

    set -e -x
    export PATH="$PATH:/home/shlomif/Download/unpack/to-del/bk-bin"
    bk version
    if test -e dev
        rm -fr dev
    uname -a
    valgrind bk clone bk://bkbits.net/u/bk/dev dev
) 2>&1 | tee -a ~/bk-report.txt

Here is the important bit:

==27989== Invalid read of size 4
==27989==    at 0x51FD18: findrev (slib.c:1701)
==27989==    by 0x51FEB7: sccs_top (slib.c:1754)
==27989==    by 0x52A556: sccs_init (slib.c:5032)
==27989==    by 0x4C593E: proj_cset2key (proj.c:1394)
==27989==    by 0x5201E7: sccs_findrev (slib.c:1836)
==27989==    by 0x5324D1: sccs_get (slib.c:7672)
==27989==    by 0x40D0C5: aliasdb_init (alias.c:435)
==27989==    by 0x4B4C2D: nested_aliases (nested.c:775)
==27989==    by 0x447B82: clone2 (clone.c:1112)
==27989==    by 0x447296: clone (clone.c:901)
==27989==    by 0x44599F: clone_main (clone.c:393)
==27989==    by 0x407677: cmd_run (bk.c:982)

Looks like we are missing some error handling and I suspect the repository on bkbits is corrupted. I will look at this later.

Thanks! I guess I can wait.

Try it again. It works with the official binary, but I did fix some permission issues on the server.

Thanks @wscott ! I tried it again using the binary built from source and was able to “bk clone” the dev repo successfully. I’d like to try running the test suite later on.

Thanks again for the prompt reply.