Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 385091 - sys-libs/readline: rlfe terminfo run test segfaults when tgoto() has implicit decl
Summary: sys-libs/readline: rlfe terminfo run test segfaults when tgoto() has implicit...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor
Assignee: Gentoo's Team for Core System packages
URL: https://lists.gnu.org/archive/html/bu...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-30 14:27 UTC by Agostino Sarubbo
Modified: 2013-12-25 23:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/tmp/portage/sys-libs/readline-6.2_p1/work/readline-6.2/config.log (1,98.17 KB, text/plain)
2011-09-30 15:15 UTC, Agostino Sarubbo
Details
/var/tmp/portage/sys-libs/readline-6.2_p1/work/readline-6.2/examples/rlfe/config.log (2,22.54 KB, text/plain)
2011-09-30 15:15 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2011-09-30 14:27:54 UTC
This from grsec.log:


Sep 29 18:51:24 $HOST kernel: grsec: From $IP: Segmentation fault occurred at 00000000edd41a50 in /var/tmp/portage/sys-libs/readline-6.2_p1/work/readline-6.2/examples/rlfe/conftest[conftest:914] uid/euid:250/250 gid/egid:250/250, parent /var/tmp/portage/sys-libs/readline-6.2_p1/work/readline-6.2/examples/rlfe/configure[configure:913] uid/euid:250/250 gid/egid:250/250


Portage 2.1.10.11 (hardened/linux/amd64, gcc-4.4.5, glibc-2.12.2-r0, 2.6.39-hardened-r8-xxxx-std-ipv6-64 x86_64)
=================================================================
System uname: Linux-2.6.39-hardened-r8-xxxx-std-ipv6-64-x86_64-Intel-R-_Core-TM-_i7_CPU_950_@_3.07GHz-with-gentoo-2.0.3
Timestamp of tree: Thu, 29 Sep 2011 16:30:01 +0000
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.1-r1
dev-util/cmake:           2.8.4-r1
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.4.5
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)
sys-libs/glibc:           2.12.2
Repositories: gentoo hardened-dev x-portage x-layman
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -pipe -O2 -g0 -w"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/bind /var/lib/redmine/config /var/qmail/alias /var/qmail/control /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /var/lib/redmine/config/locales /var/lib/redmine/config/settings.yml"
CXXFLAGS="-march=native -pipe -O2 -g0 -w"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --with-bdeps y --deep 45 --backtrack=45 --complete-graph y"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK=" /usr/lib*/*.a /usr/lib/lib[0-9]*.la /usr/lib/lib[a-k]*.la /usr/lib/lib[m-z]*.la /usr/lib/libl[0-9]*.la /usr/lib/libl[a-s]*.la /usr/lib/libl[u-z]*.la /usr/lib/liblt[0-9]*.la /usr/lib/liblt[a-c]*.la /usr/lib/liblt[e-z]*.la /usr/lib/libltd[0-9]*.la /usr/lib/libltd[a-k]*.la /usr/lib/libltd[m-z]*.la /usr/lib/libltdl[0-9]*.la /usr/lib/libltdl[a-z]*.la"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,now -Wl,--hash-style=gnu"
LINGUAS="en en_GB ru uk it de fr fi"
MAKEOPTS="-j4 -s"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/ineluctable-overlay /var/lib/layman/hardened-development /usr/local/portage /var/lib/layman"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl acpi amd64 apache2 bzip2 caps chroot cli cracklib crypt dri fam fftw gpm hardened iconv idn imap ipv6 justify maildir mmap mmx modules multilib mysql network-cron nocxx nptl nptlonly openmp pam pax_kernel pcre pppd python2 qmail qmail-spp session spamassassin sse sse2 ssl symlink sysfs threads truetype unicode urandom utf8 uuid vpopmail xattr xml xorg zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest reqtimeout status" CAMERAS="ptp2" ELIBC="glibc" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB ru uk it de fr fi" NGINX_MODULES_HTTP="auth_basic charset empty_gif fastcgi gzip memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi access" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Feel free to ask other needed info.
Comment 1 Magnus Granberg gentoo-dev 2011-09-30 15:10:42 UTC
past the config.log
do the same test fail on default kernel to?
Comment 2 Agostino Sarubbo gentoo-dev 2011-09-30 15:15:15 UTC
Created attachment 288373 [details]
/var/tmp/portage/sys-libs/readline-6.2_p1/work/readline-6.2/config.log
Comment 3 Agostino Sarubbo gentoo-dev 2011-09-30 15:15:38 UTC
Created attachment 288375 [details]
/var/tmp/portage/sys-libs/readline-6.2_p1/work/readline-6.2/examples/rlfe/config.log
Comment 4 SpanKY gentoo-dev 2011-09-30 15:38:25 UTC
so try building & running the code in question:
$ cat test.c
main(){exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);}
$ gcc test.c -O2 && ./a.out
Comment 5 Agostino Sarubbo gentoo-dev 2011-09-30 15:45:16 UTC
fails to compile:

test.c: In function 'main':
test.c:1: warning: incompatible implicit declaration of built-in function 'exit'
/tmp/ccwXMGvk.o: In function `main':
test.c:(.text+0x23): undefined reference to `tgoto'
collect2: ld returned 1 exit status
Comment 6 SpanKY gentoo-dev 2011-09-30 15:59:43 UTC
link in -lncurses
Comment 7 Agostino Sarubbo gentoo-dev 2011-09-30 16:14:39 UTC
returns only segmentation fault
Comment 8 SpanKY gentoo-dev 2011-09-30 16:44:08 UTC
does tgoto return NULL ?

what if you do:
gcc -include term.h test.c -lcurses && ./a.out
Comment 9 Agostino Sarubbo gentoo-dev 2011-09-30 17:03:24 UTC
Now runs without errors, but not shows any output
Comment 10 SpanKY gentoo-dev 2011-09-30 17:33:39 UTC
simple "implicit decl truncates pointer return type" bug
Comment 11 Agostino Sarubbo gentoo-dev 2011-09-30 17:40:33 UTC
(In reply to comment #10)
> simple "implicit decl truncates pointer return type" bug

Well, thanks for the interest and rapid response.
Comment 12 SpanKY gentoo-dev 2013-12-25 23:44:37 UTC
should be all set now in the tree; thanks for the report!

Commit message: Fix tgoto test in rlfe example
http://sources.gentoo.org/sys-libs/readline/files/readline-6.2-rlfe-tgoto.patch?rev=1.1
http://sources.gentoo.org/sys-libs/readline/readline-6.2_p5.ebuild?rev=1.1