The "zone-reload" command occasionally causes a core dump.
zone-reload may cause a coredump after zonefile updated.
REASON
if zonefile been updated, main thread will create a event for the newzone in function zone_reload_modules to reload zonefile and generate zone_contents_t struct. this may cause assert failed.
HOW TO REPRODUCE
add sleep(1) after replan_events, before assert(newzone->contents == oldzone->contents) in function zone_reload_modules.
run new program, touch the zonefile and knotc zone-reload -f zone_name, this will cause the assert failed.
FIX
employ semaphore protection for the newzone to ensure that zone load events do not execute prior to the completion of zone_reload_modules.
this is fix PR: https://github.com/CZ-NIC/knot/pull/30