From 29d3541b7414b8b87c114d3af6de0a544e9954a3 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 16 Jul 2018 16:07:25 +0200 Subject: [PATCH 1/3] lib: Downgrade BUG* assertions to work-around crashes #2 Same as b1ac865abdc017bb824aab452da37e026d3a9a4c but for the drivers API. --- libfprint/drivers_api.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libfprint/drivers_api.h b/libfprint/drivers_api.h index 2bf547a..5eb844c 100644 --- a/libfprint/drivers_api.h +++ b/libfprint/drivers_api.h @@ -42,8 +42,14 @@ #define fp_warn g_warning #define fp_err g_error -#define BUG_ON(condition) g_assert(!(condition)) -#define BUG() g_assert_not_reached() +#define BUG_ON(condition) G_STMT_START \ + if (condition) { \ + char *s; \ + s = g_strconcat ("BUG: (", #condition, ")", NULL); \ + g_warning ("%s: %s() %s:%d", s, G_STRFUNC, __FILE__, __LINE__); \ + g_free (s); \ + } G_STMT_END +#define BUG() BUG_ON(1) enum fp_dev_state { DEV_STATE_INITIAL = 0, From 19e7b217c1c460d0bf2bb1e722d49174e608f4de Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 16 Jul 2018 16:08:12 +0200 Subject: [PATCH 2/3] lib: Downgrade fp_err() to be non-fatal Similarly to b1ac865abdc017bb824aab452da37e026d3a9a4c, downgrade fp_err() to be non-fatal. A number of drivers would spit out an error when encountering this call, but not crash, carry on and most of the time recover. Make sure we don't assert in those cases. --- libfprint/drivers_api.h | 2 +- libfprint/fp_internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libfprint/drivers_api.h b/libfprint/drivers_api.h index 5eb844c..2679c77 100644 --- a/libfprint/drivers_api.h +++ b/libfprint/drivers_api.h @@ -40,7 +40,7 @@ #define fp_dbg g_debug #define fp_info g_debug #define fp_warn g_warning -#define fp_err g_error +#define fp_err g_warning #define BUG_ON(condition) G_STMT_START \ if (condition) { \ diff --git a/libfprint/fp_internal.h b/libfprint/fp_internal.h index 3611f76..e750182 100644 --- a/libfprint/fp_internal.h +++ b/libfprint/fp_internal.h @@ -42,7 +42,7 @@ #define fp_dbg g_debug #define fp_info g_debug #define fp_warn g_warning -#define fp_err g_error +#define fp_err g_warning #define BUG_ON(condition) G_STMT_START \ if (condition) { \ From 22277c727723579a0c63abda17171acec05101c9 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 17 Jul 2018 13:24:35 +0200 Subject: [PATCH 3/3] build: Downgrade meson in CI script It failed to finish the build otherwise: https://github.com/mesonbuild/meson/issues/3892 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05e8306..91bc1a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ variables: before_script: - - dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES + - dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES && rpm -Uvh --oldpackage https://kojipkgs.fedoraproject.org//packages/meson/0.46.1/2.fc29/noarch/meson-0.46.1-2.fc29.noarch.rpm build: