}
#endif /* USE_WINSOCK */
signal_handling_record();
- checklock_start();
#ifdef HAVE_SSL
# ifdef HAVE_ERR_LOAD_CRYPTO_STRINGS
ERR_load_crypto_strings();
int cmdline_cfg = 0;
#endif
+ checklock_start();
log_init(NULL, 0, NULL);
log_ident_default = strrchr(argv[0],'/')?strrchr(argv[0],'/')+1:argv[0];
log_ident_set_default(log_ident_default);
memset(&tls_list, 0, sizeof(tls_list));
/* lock debug start (if any) */
+ checklock_start();
log_ident_set("unbound-dnstap-socket");
log_init(0, 0, 0);
- checklock_start();
#ifdef SIGPIPE
if(signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
10 September 2021: Wouter
- Fix initialisation errors reported by gcc sanitizer.
+ - Fix lock debug code for gcc sanitizer reports.
8 September 2021: Wouter
- Merged #41 from Moritz Schneider: made outbound-msg-retry
const char* f;
const char* opt = NULL;
const char* cfgfile = CONFIGFILE;
+ checklock_start();
log_ident_set("unbound-checkconf");
log_init(NULL, 0, NULL);
- checklock_start();
#ifdef USE_WINSOCK
/* use registry config file in preference to compiletime location */
if(!(cfgfile=w_lookup_reg_str("Software\\Unbound", "ConfigFile")))
extern int check_locking_order;
check_locking_order = 0;
#endif /* USE_THREAD_DEBUG */
+ checklock_start();
log_ident_set("unbound-control");
log_init(NULL, 0, NULL);
- checklock_start();
#ifdef USE_WINSOCK
/* use registry config file in preference to compiletime location */
if(!(cfgfile=w_lookup_reg_str("Software\\Unbound", "ConfigFile")))
fprintf(stderr, "\n");
}
+/** delete lock ref */
+static void dellockref(rbnode_type* node, void* ATTR_UNUSED(arg))
+{
+ struct lock_ref* o = (struct lock_ref*)node;
+ if(!o) return;
+ free(o->file);
+ free(o);
+}
+
+/** delete lock node */
+static void delnode(rbnode_type* node, void* ATTR_UNUSED(arg))
+{
+ struct order_lock* o = (struct order_lock*)node;
+ if(!o) return;
+ free(o->create_file);
+ if(o->smaller) {
+ traverse_postorder(o->smaller, &dellockref, NULL);
+ free(o->smaller);
+ }
+ free(o);
+}
+
+/** delete allocated memory */
+static void locks_free(rbtree_type* all_locks)
+{
+ if(!all_locks)
+ return;
+ traverse_postorder(all_locks, &delnode, NULL);
+ free(all_locks);
+}
+
/** main program to verify all traces passed */
int
main(int argc, char* argv[])
usage();
return 1;
}
+ checklock_start();
log_init(NULL, 0, NULL);
log_ident_set("lock-verify");
/* init */
printf("checked %d locks in %d seconds with %d errors.\n",
(int)all_locks->count, (int)(time(NULL)-starttime),
errors_detected);
+ locks_free(all_locks);
if(errors_detected) return 1;
return 0;
}