lib/printf regression on raspberry

Maximilian Eschenbacher maximilian+bird at eschenbacher.email
Wed Jul 17 22:33:32 CEST 2019


Hey everyone,

the following patch creates a testcase on top of the master branch for
bsprintf with %lR which fails on both my raspberrys (Raspbian Buster,
armv6l and armv7l, gcc version 8.3.0). I noticed it by looking at

$ birdc6 show babel entries

which prints all router ids as 00:00:00:00:00:00:00:00 (except for the
<self> prefixes). The issue exists in both tags v1.6.6 and v2.0.4.

Best regards,

Max

---

diff --git a/lib/printf_test.c b/lib/printf_test.c
index a2683d93..c1843f07 100644
--- a/lib/printf_test.c
+++ b/lib/printf_test.c
@@ -18,6 +18,14 @@
     bt_assert_msg(memcmp(buf, res, nw) == 0, "fmt=\"%s\" writes \"%*s\", want \"%*s\"", fmt, (n < nw ? n : nw), buf, nw, res); \
   } while (0)

+static int
+t_router_id(void)
+{
+  char buf[256];
+  BSPRINTF(23, "01:02:03:04:05:06:07:08", buf, "%lR", 0x102030405060708);
+  return 1;
+}
+
 static int
 t_simple(void)
 {
@@ -74,6 +82,7 @@ main(int argc, char *argv[])
   bt_init(argc, argv);

   bt_test_suite(t_simple, "printf without varargs");
+  bt_test_suite(t_router_id, "print router id");

   return bt_exit_value();
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20190717/c82559a9/attachment.sig>


More information about the Bird-users mailing list