ctdb-tests: Avoid segfault by initializing logging
authorAmitay Isaacs <amitay@gmail.com>
Thu, 21 Jun 2018 10:00:41 +0000 (20:00 +1000)
committerMartin Schwenke <martins@samba.org>
Wed, 4 Jul 2018 21:56:42 +0000 (23:56 +0200)
commitaf697008531bd74546656841dd3a1ed92522fc57
treec4653bd10a9fcd1bc03ea7b03a87a517ca4d6b87
parentb977ded38a79e1eadd6965e8b7fd49f86322b4d6
ctdb-tests: Avoid segfault by initializing logging

Setting DEBUGLEVEL before calling debug_init() causes segmentation
violation with gcc8.  DEBUGLEVEL_CLASS is statically initialized to
debug_class_list_initial which is defined as const.  Only after
debug_init() is called, DEBUGLEVEL_CLASS becomes a talloc'd array.

So before modifying DEBUGLEVEL, ensure debug_init() is called via
setup_logging().  (debug_init is a static function.)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
12 files changed:
ctdb/tests/src/fetch_loop.c
ctdb/tests/src/fetch_loop_key.c
ctdb/tests/src/fetch_readonly.c
ctdb/tests/src/fetch_readonly_loop.c
ctdb/tests/src/fetch_ring.c
ctdb/tests/src/g_lock_loop.c
ctdb/tests/src/message_ring.c
ctdb/tests/src/transaction_loop.c
ctdb/tests/src/tunnel_test.c
ctdb/tests/src/update_record.c
ctdb/tests/src/update_record_persistent.c
ctdb/wscript