svm: fix svmtool and svmdbtool segment fault. 82/21282/2
authorGuanghua Zhang <[email protected]>
Mon, 12 Aug 2019 01:04:35 +0000 (09:04 +0800)
committerDave Barach <[email protected]>
Wed, 14 Aug 2019 15:10:31 +0000 (15:10 +0000)
Type: fix
Ticket: VPP-1741

Signed-off-by: Guanghua Zhang <[email protected]>
Change-Id: Ifd3abaa5ec912378dbc7b73c4863aad26777dd7e
(cherry picked from commit 60f16c22b44625d517830b4266a225d3abaccefc)

src/svm/svmdbtool.c
src/svm/svmtool.c

index d50ca7b..ca8201b 100644 (file)
@@ -378,6 +378,8 @@ main (int argc, char **argv)
   struct group _grp, *grp;
   char *s, buf[128];
 
+  clib_mem_init_thread_safe (0, 128 << 20);
+
   svmdbtool_main.uid = geteuid ();
   svmdbtool_main.gid = getegid ();
 
index 6d1a2b1..643b484 100644 (file)
@@ -458,6 +458,8 @@ main (int argc, char **argv)
   char *chroot_path = 0;
   u8 *chroot_u8;
 
+  clib_mem_init_thread_safe (0, 128 << 20);
+
   unformat_init_command_line (&input, argv);
 
   while (unformat_check_input (&input) != UNFORMAT_END_OF_INPUT)