failure in module initialization crashes the server
=================================================================
==24724==ERROR: AddressSanitizer: heap-use-after-free on address 0x61300000d158 at pc 0x0000005ec163 bp 0x7fe7584e25b0 sp 0x7fe7584e25a8
READ of size 8 at 0x61300000d158 thread T2
2015-06-22T13:50:32 info: [child.example] loaded, serial 0 -> 2
#0 0x5ec162 in worker_main /home/fcelda/devel/knot/src/knot/worker/pool.c:74:3
#1 0x588284 in thread_ep /home/fcelda/devel/knot/src/knot/server/dthreads.c:166:4
#2 0x7fe75ef60554 in start_thread (/lib64/libpthread.so.0+0x7554)
#3 0x7fe75e36ff3c in __clone (/lib64/libc.so.6+0x101f3c)
0x61300000d158 is located 216 bytes inside of 384-byte region [0x61300000d080,0x61300000d200)
freed by thread T0 here:
#0 0x4a80bb in free (/home/fcelda/devel/knot/src/.libs/lt-knotd+0x4a80bb)
#1 0x63a315 in zone_free /home/fcelda/devel/knot/src/knot/zone/zone.c:117:2
#2 0x64430c in create_zonedb /home/fcelda/devel/knot/src/knot/zone/zonedb-load.c:301:4
#3 0x64342e in zonedb_reload /home/fcelda/devel/knot/src/knot/zone/zonedb-load.c:363:26
#4 0x59bd42 in server_update_zones /home/fcelda/devel/knot/src/knot/server/server.c:694:12
#5 0x4c7a0f in main /home/fcelda/devel/knot/src/knot/main.c:437:2
#6 0x7fe75e28e78f in __libc_start_main (/lib64/libc.so.6+0x2078f)
previously allocated by thread T0 here:
#0 0x4a833b in __interceptor_malloc (/home/fcelda/devel/knot/src/.libs/lt-knotd+0x4a833b)
#1 0x63999a in zone_new /home/fcelda/devel/knot/src/knot/zone/zone.c:60:17
#2 0x646c41 in create_zone_from /home/fcelda/devel/knot/src/knot/zone/zonedb-load.c:119:17
#3 0x64630f in create_zone_new /home/fcelda/devel/knot/src/knot/zone/zonedb-load.c:197:17
#4 0x645589 in create_zone /home/fcelda/devel/knot/src/knot/zone/zonedb-load.c:261:10
#5 0x6440f0 in create_zonedb /home/fcelda/devel/knot/src/knot/zone/zonedb-load.c:291:18
#6 0x64342e in zonedb_reload /home/fcelda/devel/knot/src/knot/zone/zonedb-load.c:363:26
#7 0x59bd42 in server_update_zones /home/fcelda/devel/knot/src/knot/server/server.c:694:12
#8 0x4c7a0f in main /home/fcelda/devel/knot/src/knot/main.c:437:2
#9 0x7fe75e28e78f in __libc_start_main (/lib64/libc.so.6+0x2078f)
Thread T2 created by T0 here:
#0 0x48ff6f in pthread_create (/home/fcelda/devel/knot/src/.libs/lt-knotd+0x48ff6f)
#1 0x5837fe in dt_start_id /home/fcelda/devel/knot/src/knot/server/dthreads.c:476:12
#2 0x582d9e in dt_start /home/fcelda/devel/knot/src/knot/server/dthreads.c:499:13
#3 0x5ec8ab in worker_pool_start /home/fcelda/devel/knot/src/knot/worker/pool.c:145:2
#4 0x59911b in server_start /home/fcelda/devel/knot/src/knot/server/server.c:446:2
#5 0x4c7ae0 in main /home/fcelda/devel/knot/src/knot/main.c:447:8
#6 0x7fe75e28e78f in __libc_start_main (/lib64/libc.so.6+0x2078f)
SUMMARY: AddressSanitizer: heap-use-after-free /home/fcelda/devel/knot/src/knot/worker/pool.c:74 worker_main
Shadow bytes around the buggy address:
0x0c267fff99d0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
0x0c267fff99e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c267fff99f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c267fff9a00: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
0x0c267fff9a10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c267fff9a20: fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd
0x0c267fff9a30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c267fff9a40: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
0x0c267fff9a50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c267fff9a60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c267fff9a70: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
ASan internal: fe
==24724==ABORTING