Segfault on armhf
Hi!
As discussed on the mailinglist I compiled the latest version 2.1.0-dev on my Raspberry Pi 2. Now when I start knotd I do get a seg fault. Here is the stacktrace from gdb.
root@powerpi:~# gdb knotd GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "arm-linux-gnueabihf". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from knotd...done. (gdb) run Starting program: /sbin/knotd [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". Cannot access memory at address 0x0
Program received signal SIGILL, Illegal instruction. 0x767e6d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 (gdb) continue Continuing. [New Thread 0x50baa200 (LWP 2902)] [New Thread 0x508ff200 (LWP 2903)] [New Thread 0x507ff200 (LWP 2904)]
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x50baa200 (LWP 2902)] scanner_process (scanner=0x50a78008) at knot/zone/zonefile.c:152 152 if (zc->ret != KNOT_EOK) { (gdb) thread apply all bt full [New Thread 0x504ff200 (LWP 2905)]
Thread 5 (Thread 0x504ff200 (LWP 2905)): #0 clone () at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:62 No locals. #1 (closed) 0x76d05f0c in do_clone (pd=0x504ff268, attr=0x83ec4, stackaddr=, stopped=, fct=0x76d06dcc <start_thread>, clone_flags=4001536) at ../nptl/sysdeps/pthread/createthread.c:75 rc = #2 (closed) 0x00000000 in ?? () No symbol table info available.
Thread 4 (Thread 0x507ff200 (LWP 2904)): #0 0x76d0f3a4 in sendmsg () at ../sysdeps/unix/syscall-template.S:81 No locals. #1 (closed) 0x76f94ba4 in sd_journal_sendv () from /lib/arm-linux-gnueabihf/libsystemd.so.0 No symbol table info available. #2 (closed) 0x76f952d0 in sd_journal_send () from /lib/arm-linux-gnueabihf/libsystemd.so.0 No symbol table info available. #3 (closed) 0x00026f40 in emit_log_msg (msg=0x0, zone_len=0, zone=0x0, level=7) at knot/common/log.c:265 zone_fmt = ret = 0 lt = {tm_sec = 1991871160, tm_min = 808464432, tm_hour = 808464432, tm_mday = 0, tm_mon = 8, tm_year = 115, tm_wday = 4, tm_yday = 259, tm_isdst = 1, tm_gmtoff = 7200, tm_zone = 0x7d898 "CEST"} tv = {tv_sec = 1350560232, tv_usec = 0} sec = 0 log = 0x82958 f = src = LOG_SERVER tstr = "2015-09-17T20:47:50 ", '\000' <repeats 72 times>, "\062\071\060\064\240\351\177P\000\000\000\000\000\000\000\000\240\351\177P\000\000\000\000\314\352\177PH\352\177P\001\000\000\000@\005PP\000\004\000\000@\005PP\000\000\000\000\314\352\177P\374j\272v\377\377\377\377\000\000\000\000\004\000\000\000\000\000\000\000\350\351\177P\314\352\177P\000\000\000\000\000\000\000\000\350\351\177P\270\352\177P|\335\323v\314\352\177P"... #4 (closed) log_msg_text (level=level@entry=7, zone=zone@entry=0x0, fmt=0x0, fmt@entry=0x83d50 "", args=..., args@entry=...) at knot/common/log.c:393 ret = sbuf = "debug: dthreads: [0x83e48] entering runnable\n", '\000' <repeats 163 times>... write = 0x507fe70f "dthreads: [0x83e48] entering runnable\n" capacity = 504 zone_len = 0 #5 (closed) 0x000272c0 in log_msg (priority=priority@entry=7, fmt=0x4f614 "dthreads: [%p] entering runnable\n") at knot/common/log.c:407 args = {__ap = 0x507feb40} #6 (closed) 0x000278c8 in thread_ep (data=0x83e48) at knot/server/dthreads.c:165 _run = 0x2fac4 <worker_main> thread = 0x83e48 unit = mask = {__val = {8192, 0 <repeats 31 times>}} #7 (closed) 0x76d06e90 in start_thread (arg=0x507ff200) at pthread_create.c:311 pd = 0x507ff200 unwind_buf = {cancel_jmp_buf = {{jmp_buf = {1350562408, 1, 540260, 338, 540256, 1996428480, 0, 1350561084, 1880508138, 1455015050, 0 <repeats 54 times>}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}} not_first_call = 0 pagesize_m1 = sp = ---Type to continue, or q to quit--- freesize = PRETTY_FUNCTION = "start_thread" #8 (closed) 0x76c16128 in ?? () at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:92 from /lib/arm-linux-gnueabihf/libc.so.6 No locals. Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 3 (Thread 0x508ff200 (LWP 2903)): #0 0x76d0b7a4 in __pthread_cond_wait (cond=cond@entry=0x83c78, mutex=mutex@entry=0x83c5c) at pthread_cond_wait.c:187 _a1 = 539772 _nr = 240 _a3tmp = 1 _a3 = 1 _a4tmp = 0 _a2 = 128 _a4 = 0 __ret = futex_val = 1 buffer = {__routine = 0x76d0b46c <__condvar_cleanup>, __arg = 0x508feaf8, __canceltype = 0, __prev = 0x0} cbuffer = {oldtype = 0, cond = 0x83c78, mutex = 0x83c5c, bc_seq = 0} err = pshared = 128 pi_flag = 0 val = seq = 0 #1 (closed) 0x0002fb0c in worker_main (thread=thread@entry=0x83de8) at knot/worker/pool.c:70 task = PRETTY_FUNCTION = "worker_main" pool = 0x83c58 #2 (closed) 0x000278d0 in thread_ep (data=0x83de8) at knot/server/dthreads.c:166 _run = 0x2fac4 <worker_main> thread = 0x83de8 unit = mask = {__val = {8192, 0 <repeats 31 times>}} #3 (closed) 0x76d06e90 in start_thread (arg=0x508ff200) at pthread_create.c:311 pd = 0x508ff200 unwind_buf = {cancel_jmp_buf = {{jmp_buf = {1351610984, 1, 540164, 338, 540160, 1996428480, 0, 1351609660, 1894139626, 1455015050, 0 <repeats 54 times>}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}} not_first_call = 0 pagesize_m1 = sp = freesize = PRETTY_FUNCTION = "start_thread" #4 (closed) 0x76c16128 in ?? () at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:92 from /lib/arm-linux-gnueabihf/libc.so.6 No locals. Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 2 (Thread 0x50baa200 (LWP 2902)): #0 scanner_process (scanner=0x50a78008) at knot/zone/zonefile.c:152 zc = 0x0 owner = 0x50ba93e8 "" ---Type to continue, or q to quit--- rr = {owner = 0x0, type = 61228, rclass = 30457, rrs = {rr_count = 18608, data = 0x51924 "zload: load: Loading zone, loader: %p.\n"}, additional = 0xa175265} ret = #1 (closed) 0x76d80a14 in ?? () from /usr/lib/arm-linux-gnueabihf/libzscanner.so.0 No symbol table info available. Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 1 (Thread 0x76ff1000 (LWP 2899)): #0 clone () at ../ports/sysdeps/unix/sysv/linux/arm/nptl/../clone.S:62 No locals. #1 (closed) 0x76d05f0c in do_clone (pd=0x504ff268, attr=0x83ec4, stackaddr=, stopped=, fct=0x76d06dcc <start_thread>, clone_flags=4001536) at ../nptl/sysdeps/pthread/createthread.c:75 rc = #2 (closed) 0x00083ec4 in ?? () No symbol table info available. Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb)