Closed ajakk closed 2 years ago
Does it happen if you compile rizin without the ebuild with the usual instructions meson build && meson compile -C build
?
Yes.
Can you provide the instructions to reproduce on a clean docker container?
Very strange:
This is the v0.3.0 tag and:
florian@florian-gentoo ~/dev/rizin/test $ uname -a
Linux florian-gentoo 5.10.52-gentoo #1 SMP PREEMPT Sat Jul 24 01:34:11 -00 2021 aarch64 GNU/Linux
Actually, it is not weird at all. Looks like this also expects an installed prefix. By compiling with a random prefix and not installing, this is reproducible everywhere. cc @XVilka because this seems type-related.
Looks like it only works with install by chance because the cmd parser is initialized here:
Without install core->rcmd->language
is still null when the autocompletion is triggered.
Anyway, @ajakk this fixes the issue for the ebuild:
--- /home/florian/Downloads/rizin/rizin-0.3.0.ebuild 2021-10-04 16:41:05.000000000 +0200
+++ rizin-0.3.0.ebuild 2021-10-05 15:31:03.172000067 +0200
@@ -89,6 +89,7 @@
ln -sf "${BUILD_DIR}/librz/analysis/d" "${T}/usr/share/${PN}/${PV}/types" || die
ln -sf "${BUILD_DIR}/librz/syscall/d" "${T}/usr/share/${PN}/${PV}/syscall" || die
ln -sf "${BUILD_DIR}/librz/asm/d" "${T}/usr/share/${PN}/${PV}/opcodes" || die
+ ln -sf "${BUILD_DIR}/librz/flag/d" "${T}/usr/share/${PN}/${PV}/flag" || die
export RZ_PREFIX="${T}/usr"
meson_src_test
I would still consider this an issue for us though.
diff --git a/test/unit/test_autocmplt.c b/test/unit/test_autocmplt.c
index 18070d318..f6686200d 100644
--- a/test/unit/test_autocmplt.c
+++ b/test/unit/test_autocmplt.c
@@ -401,7 +401,7 @@ static bool test_autocmplt_seek(void) {
}
static bool test_autocmplt_global(void) {
- RzCore *core = rz_core_new();
+ RzCore *core = fake_core_new2();
mu_assert_notnull(core, "core should not be null");
RzAnalysisVarGlobal *glob1 = rz_analysis_var_global_new("GINT", 0x1337); // untyped global
@thestr4ng3r Could you apply this patch, and try building from your Gentoo setup and test it? I think this can fix it.
That patch seems to fix it for me!
@ajakk Just to confirm before I make changes, the following patch fixes the build issues on Gentoo, right?
diff --git a/test/unit/test_autocmplt.c b/test/unit/test_autocmplt.c index 18070d318..f6686200d 100644 --- a/test/unit/test_autocmplt.c +++ b/test/unit/test_autocmplt.c @@ -401,7 +401,7 @@ static bool test_autocmplt_seek(void) { } static bool test_autocmplt_global(void) { - RzCore *core = rz_core_new(); + RzCore *core = fake_core_new2(); mu_assert_notnull(core, "core should not be null"); RzAnalysisVarGlobal *glob1 = rz_analysis_var_global_new("GINT", 0x1337); // untyped global
@thestr4ng3r Could you apply this patch, and try building from your Gentoo setup and test it? I think this can fix it.
It does, but it also hides the issue that the cmd parser is not being initialized by default, but only after some command has been run. cc @ret2libc
Work environment
Building Rizin 0.3.0 and running the unit test suite via a Gentoo ebuild (in attached tarball)
Expected behavior
test_autocmplt
shouldn't segfaultActual behavior
test_autocmplt
segfaults (from the meson test log):The same happens when using bundled tree-sitter,
rizin.tar.gz