Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Sep 2017 00:24:18 +0100
From:      tech-lists <tech-lists@zyxst.net>
To:        freebsd-ports@freebsd.org
Subject:   Re: slrn from ports segfaults when running
Message-ID:  <20170915232417.GA80190@v007.zyxst.net>
In-Reply-To: <59BC2C0C.1040701@grosbein.net>
References:  <20170915130055.GD20223@v007.zyxst.net> <59BBD0AA.60804@grosbein.net> <20170915135734.GE20223@v007.zyxst.net> <59BBDFE9.4010902@grosbein.net> <20170915145629.GA18434@v007.zyxst.net> <59BC2C0C.1040701@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Sep 16, 2017 at 02:37:48AM +0700, Eugene Grosbein wrote:

>This does not seem to be debugging version. Perhaps, stage/ directory
>already contains stripped binary. Use 'file slrn' to be sure.
>Run unstripped slrn binary from building directory instead then.
>
>And may be, this port does not respect WITH_DEBUG=yes knob.

I had WITHOUT_DEBUG=YES in make.conf, so commented out. Also
added DEBUG_FLAGS=-g, and from there was able to make a debugging
binary, which was copied to root's directory.

[root@desktop ~]# file slrn
slrn: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD),
dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 11.1
(1101502), FreeBSD-style, not stripped
[root@desktop ~]# 

[root@desktop ~]# ls -la slrn.*
-rw-------  1 root  wheel  8990720 Sep 16 00:05 slrn.core

[root@desktop ~]# gdb
GNU gdb 6.1.1 [FreeBSD]
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 "amd64-marcel-freebsd".
(gdb) core slrn.core
Core was generated by ./slrn'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000801aaf421 in ?? ()
(gdb) bt
#0  0x0000000801aaf421 in ?? ()
#1  0x00007fffffffe360 in ?? ()
#2  0x00000008026014b7 in ?? ()
#3  0x00007fffffffe310 in ?? ()
#4  0x0000000000000000 in ?? ()
(gdb) quit

I moved the slrn.core to slrn.core.1 and this time after starting
slrn, went into a newsgroup with only 50 or so posts and this
segfaulted after trying to open the first post:

(gdb) core slrn.core
Core was generated by ./slrn'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000801aaf421 in ?? ()
(gdb) bt
#0  0x0000000801aaf421 in ?? ()
#1  0x00007fffffffe8b0 in ?? ()
#2  0x00000008026014b7 in ?? ()
#3  0x00007fffffffe860 in ?? ()
#4  0x0000000000000000 in ?? ()
(gdb) 

Then, tried loading up slrn without doing anything, got its process
id and attached it in the debugger:

Reading symbols from /root/slrn...done.
Reading symbols from /usr/local/lib/libslang.so.2...done.
Loaded symbols for /usr/local/lib/libslang.so.2
Reading symbols from /usr/local/lib/libuu.so.3...done.
Loaded symbols for /usr/local/lib/libuu.so.3
Reading symbols from /usr/local/lib/libssl.so.43...done.
Loaded symbols for /usr/local/lib/libssl.so.43
Reading symbols from /usr/local/lib/libcrypto.so.41...done.
Loaded symbols for /usr/local/lib/libcrypto.so.41
Reading symbols from /usr/local/lib/libintl.so.8...done.
Loaded symbols for /usr/local/lib/libintl.so.8
Reading symbols from /lib/libncurses.so.8...Reading symbols from
/usr/lib/debug//lib/libncurses.so.8.debug...done.
done.
Loaded symbols for /lib/libncurses.so.8
Reading symbols from /lib/libc.so.7...Reading symbols from
/usr/lib/debug//lib/libc.so.7.debug...done.
done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /lib/libm.so.5...Reading symbols from
/usr/lib/debug//lib/libm.so.5.debug...done.
done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /libexec/ld-elf.so.1...Reading symbols from
/usr/lib/debug//libexec/ld-elf.so.1.debug...done.
done.
Loaded symbols for /libexec/ld-elf.so.1
0x0000000801ba503a in _select () from /lib/libc.so.7

slrn freezes when the process is attached, so ran bt from gdb:

(gdb) bt
#0  0x0000000801ba503a in _select () from /lib/libc.so.7
#1  0x00000008008f728c in _pSLsys_getkey () from
/usr/local/lib/libslang.so.2
#2  0x00000000004565b1 in slrn_getkey () at
/ports-build/storage/usr/ports/news/slrn/work/slrn-1.0.3/src/slrn.c:1573
#3  0x000000080091a1d7 in SLang_do_key () from
/usr/local/lib/libslang.so.2
#4  0x000000000045674a in slrn_do_keymap_key (map=0x802519c80)
    at
/ports-build/storage/usr/ports/news/slrn/work/slrn-1.0.3/src/slrn.c:1616
#5  0x0000000000456b62 in main (argc=1, argv=0x7fffffffebc0)
    at
/ports-build/storage/usr/ports/news/slrn/work/slrn-1.0.3/src/slrn.c:1750

hopefully this is better info.

thanks,
-- 
J.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170915232417.GA80190>