At least since Ubuntu 22.04 there are lots of (apparently non-fatal)
"DWARF error: could not find variable specification" errors generated
by bfd_find_nearest_line(). This also happens with addr2line, which
internally uses libbfd. No idea what the actual issue is (it still
happens with binutils 2.39 in Ubuntu 22.10), but since it doesn't seem
to affect the functionality we need this avoids filling the test logs
with useless messages.
return streq(a, b);
}
+/**
+ * Do not print internal errors by libbfd as we get quite a lot of
+ * "DWARF error: could not find variable specification" messages when running
+ * against Ubuntu 20.04's libcrypto (same with addr2line and still in 22.10).
+ */
+void suppress_bfd_errors (const char *fmt, va_list args)
+{
+}
+
/**
* See header.
*/
bfds = hashtable_create((hashtable_hash_t)bfd_hash,
(hashtable_equals_t)bfd_equals, 8);
bfd_mutex = mutex_create(MUTEX_TYPE_DEFAULT);
+ bfd_set_error_handler(suppress_bfd_errors);
}
/**