On 12/13/16, Stuart Henderson wrote:
> On 2016/12/13 12:23, Lars Noodén wrote:
>> On a BeagleBone Black (one that has not been used for GPIO), I have
>> been getting segfaults with tcpdump since the last four or so
>> snapshots.  Running tcpdump in any way triggers the fault.
>
> A backtrace would be nice, or even better build with symbols and get
> a backtrace from that.
>
> if you don't have a full source checkout handy, you can just fetch tcpdump:
>   cd /usr; cvs get -P src/usr.sbin/tcpdump
>
> then:
>   cd /usr/src/usr.sbin/tcpdump
>   make obj; make clean; make DEBUG=-g
>   gdb obj/tcpdump
>   run
>   bt
>
> You can also do a date-based checkout ("cvs up -D 2016/11/23" etc) to
> narrow
> down the commit that broke it.

Ok.  'make obj' failed without having the full source tree.  So now I have
everything and did:

$ cd /usr/src/usr.sbin/tcpdump
$ make obj; make clean; make DEBUG=-g

Then I ran gdb with the following results:

# cd /usr/src/usr.sbin/tcpdump/
# gdb obj/tcpdump
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "arm-unknown-openbsd6.0"...
(gdb) run
Starting program: /usr/obj/usr.sbin/tcpdump/tcpdump

Program received signal SIGSEGV, Segmentation fault.
*_libc_strlen (str=0x200 "\020@-\001")
    at /usr/src/lib/libc/string/strlen.c:39
39              for (s = str; *s; ++s)
(gdb) bt
#0  *_libc_strlen (str=0x200 "\020@-\001")
    at /usr/src/lib/libc/string/strlen.c:39
#1  0x2fb1ffb8 in savestr (str=0x200 "\020@-\001")
    at /usr/src/usr.sbin/tcpdump/savestr.c:45
#2  0x2fae57e8 in init_addrtoname (localnet=Variable "localnet" is not
available.
)
    at /usr/src/usr.sbin/tcpdump/addrtoname.c:738
#3  0x2fae34c8 in main (argc=-1073903148, argv=Variable "argv" is not available.
)
    at /usr/src/usr.sbin/tcpdump/tcpdump.c:460

/Lars

Reply via email to