In particular this is about kismet, a program using libnl, which segfaults right after launch, before even main() is called.<br>It looks like libnl is responsible, here's what i did and some information:<br><br># uname -a<br>
Linux fisted 3.6.6-gentoo12019 #1 SMP Tue Nov 20 06:07:13 CET 2012 x86_64 AMD Athlon(tm) II Dual-Core M300 AuthenticAMD GNU/Linux<br><br>libnl3 version is 3.2.14, or 3.2.14:3, the latter might be something gentoo-specific.<br>
libnl1 version is libnl-1.1-r3<br>i have no idea why kismet wants both, anyway.<br><br># ldd ./kismet_server<br> linux-vdso.so.1 (0x00007fff725ff000)<br> libcap.so.2 => /lib64/libcap.so.2 (0x00007fa052a7e000)<br>
libdl.so.2 => /lib64/libdl.so.2 (0x00007fa05287a000)<br> libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fa05261f000)<br>
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/libstdc++.so.6 (0x00007fa052319000)<br> libpcap.so.1 => /usr/lib64/libpcap.so.1 (0x00007fa0520d9000)<br> libnl-genl-3.so.200 => /usr/lib64/libnl-genl-3.so.200 (0x00007fa051ed2000)<br>
libnl-3.so.200 => /usr/lib64/libnl-3.so.200 (0x00007fa051cb6000)<br> libm.so.6 => /lib64/libm.so.6 (0x00007fa0519be000)<br> libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/libgcc_s.so.1 (0x00007fa0517a7000)<br>
libc.so.6 => /lib64/libc.so.6 (0x00007fa0513f9000)<br> libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa0511dc000)<br> libattr.so.1 => /lib64/libattr.so.1 (0x00007fa050fd7000)<br> /lib64/ld-linux-x86-64.so.2 (0x00007fa052c84000)<br>
libnl.so.1 => /usr/lib64/libnl.so.1 (0x00007fa050d82000)<br><br># gdb ./kismet_server<br>GNU gdb (Gentoo 7.3.1 p2) 7.3.1<br>Copyright (C) 2011 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>><br>
This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law. Type "show copying"<br>and "show warranty" for details.<br>This GDB was configured as "x86_64-pc-linux-gnu".<br>
For bug reporting instructions, please see:<br><<a href="http://bugs.gentoo.org/">http://bugs.gentoo.org/</a>>...<br>Reading symbols from /home/fisted/src/kismet/kismet_server...done.<br>(gdb) run<br>Starting program: /home/fisted/src/kismet/kismet_server<br>
warning: Could not load shared library symbols for linux-vdso.so.1.<br>Do you need "set solib-search-path" or "set sysroot"?<br>[Thread debugging using libthread_db enabled]<br><br>Program received signal SIGSEGV, Segmentation fault.<br>
genl_register (ops=0x7ffff5f1c6e0) at genl/mngt.c:260<br>260 ops->co_genl->o_cache_ops = ops;<br>(gdb) bt full<br>#0 genl_register (ops=0x7ffff5f1c6e0) at genl/mngt.c:260<br> err = <optimized out><br>
#1 0x00007ffff7de972f in call_init () from /lib64/ld-linux-x86-64.so.2<br>No symbol table info available.<br>#2 0x00007ffff7de981e in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2<br>No symbol table info available.<br>
#3 0x00007ffff7ddbbda in _dl_start_user () from /lib64/ld-linux-x86-64.so.2<br>No symbol table info available.<br>#4 0x0000000000000001 in ?? ()<br>No symbol table info available.<br>#5 0x00007fffffffdf6d in ?? ()<br>No symbol table info available.<br>
#6 0x0000000000000000 in ?? ()<br>No symbol table info available.<br>(gdb) disass<br>Dump of assembler code for function genl_register:<br> 0x00007ffff702bea0 <+0>: push %rbx<br> 0x00007ffff702bea1 <+1>: cmpl $0x10,0xc(%rdi)<br>
0x00007ffff702bea5 <+5>: mov %rdi,%rbx<br> 0x00007ffff702bea8 <+8>: je 0x7ffff702beb8 <genl_register+24><br> 0x00007ffff702beaa <+10>: mov $0xffffffe6,%eax<br> 0x00007ffff702beaf <+15>: pop %rbx<br>
0x00007ffff702beb0 <+16>: retq <br> 0x00007ffff702beb1 <+17>: nopl 0x0(%rax)<br> 0x00007ffff702beb8 <+24>: mov 0x8(%rdi),%edx<br> 0x00007ffff702bebb <+27>: mov $0xfffffff9,%eax<br>
0x00007ffff702bec0 <+32>: cmp $0x3,%edx<br> 0x00007ffff702bec3 <+35>: jbe 0x7ffff702beaf <genl_register+15><br> 0x00007ffff702bec5 <+37>: mov 0x50(%rdi),%rdi<br> 0x00007ffff702bec9 <+41>: test %rdi,%rdi<br>
0x00007ffff702becc <+44>: je 0x7ffff702beaf <genl_register+15><br> 0x00007ffff702bece <+46>: mov 0x60(%rbx),%rax<br> 0x00007ffff702bed2 <+50>: sub $0x4,%edx<br>=> 0x00007ffff702bed5 <+53>: mov %rbx,0x10(%rdi)<br>
0x00007ffff702bed9 <+57>: mov %edx,(%rdi)<br> 0x00007ffff702bedb <+59>: mov %rax,0x8(%rdi)<br> 0x00007ffff702bedf <+63>: mov 0x58(%rbx),%eax<br> 0x00007ffff702bee2 <+66>: mov %eax,0x4(%rdi)<br>
0x00007ffff702bee5 <+69>: lea -0x36c(%rip),%rax # 0x7ffff702bb80 <genl_msg_parser><br> 0x00007ffff702beec <+76>: mov %rax,0x20(%rbx)<br> 0x00007ffff702bef0 <+80>: callq 0x7ffff702a450 <genl_register_family@plt><br>
0x00007ffff702bef5 <+85>: test %eax,%eax<br> 0x00007ffff702bef7 <+87>: js 0x7ffff702beaf <genl_register+15><br> 0x00007ffff702bef9 <+89>: mov %rbx,%rdi<br> 0x00007ffff702befc <+92>: pop %rbx<br>
0x00007ffff702befd <+93>: jmpq 0x7ffff702a310 <nl_cache_mngt_register@plt><br>End of assembler dump.<br>(gdb) i r<br>rax 0x0 0<br>rbx 0x7ffff5f1c6e0 140737319651040<br>rcx 0x66 102<br>
rdx 0x0 0<br>rsi 0x7fffffffdca8 140737488346280<br>rdi 0x7ffff5d098dc 140737317476572<br>rbp 0x7fffffffdca8 0x7fffffffdca8<br>rsp 0x7fffffffdc00 0x7fffffffdc00<br>
r8 0x7ffff68f7688 140737329985160<br>r9 0x1 1<br>r10 0x7fffffffd9b0 140737488345520<br>r11 0x7ffff702bea0 140737337540256<br>r12 0x7ffff5f180c8 140737319633096<br>
r13 0x7fffffffdcb8 140737488346296<br>r14 0x1d 29<br>r15 0x20 32<br>rip 0x7ffff702bed5 0x7ffff702bed5 <genl_register+53><br>eflags 0x10246 [ PF ZF IF RF ]<br>
cs 0x33 51<br>ss 0x2b 43<br>ds 0x0 0<br>es 0x0 0<br>fs 0x0 0<br>gs 0x0 0<br><br><br>Any additional information required to debug/fix this?<br>
<br>Regards,<br><br>Timo<br>