Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 355145 - dev-perl/Term-ReadLine-Gnu-1.20 undefined symbol
Summary: dev-perl/Term-ReadLine-Gnu-1.20 undefined symbol
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
: 355243 356273 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-16 04:52 UTC by William Throwe
Modified: 2011-03-10 13:09 UTC (History)
4 users (show)

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


Attachments
build.log (build.log,3.62 KB, text/plain)
2011-02-16 13:43 UTC, William Throwe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Throwe 2011-02-16 04:52:34 UTC
$ perl -MTerm::ReadLine -e 1
perl: symbol lookup error: /usr/lib64/perl5/vendor_perl/5.12.3/x86_64-linux/auto/Term/ReadLine/Gnu/Gnu.so: undefined symbol: xmalloc

Rebuilding dev-perl/Term-ReadLine-Gnu doesn't help.  None of emerge @preserved-rebuild, revdep-rebuild, or perl-cleaner --all try to rebuild anything.

Reproducible: Always




$ emerge --info Term-ReadLine-Gnu
Portage 2.2.0_alpha23 (default/linux/amd64/10.0, gcc-4.5.2, glibc-2.13-r1, 2.6.37-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.37-gentoo-x86_64-Intel-R-_Core-TM-2_CPU_T5500_@_1.66GHz-with-gentoo-2.0.1
Timestamp of tree: Tue, 15 Feb 2011 07:45:01 +0000
app-shells/bash:     4.1_p9
dev-lang/python:     2.7.1, 3.1.3
dev-util/cmake:      2.8.3-r1
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
Repositories: gentoo wthrowe
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--ask"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.netnitco.net http://mirror.mcs.anl.gov/pub/gentoo/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://mirror.datapipe.net/gentoo ftp://mirror.datapipe.net/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j3"
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/wthrowe"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X acl acpi afs alsa amd64 berkdb bindist bzip2 cairo caps cdr cli cracklib crypt cxx dbus dri dvd dvdr emacs fortran gd gdbm gimp gpm gtk iconv jpeg kerberos latex mmx modules mudflap multilib ncurses nptl nptlonly opengl openmp pam pcre perl png pppd python readline session smp sse sse2 ssl ssse3 sysfs system-sqlite tcpd truetype unicode xorg xscreensaver zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="epson2" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-perl/Term-ReadLine-Gnu-1.20 was built with the following:
USE="(multilib)"
Comment 1 Torsten Veller (RETIRED) gentoo-dev 2011-02-16 08:01:35 UTC
Attach the build.log.
Comment 2 Frank Ridderbusch 2011-02-16 12:55:02 UTC
(In reply to comment #0)
> $ perl -MTerm::ReadLine -e 1
> perl: symbol lookup error:
> /usr/lib64/perl5/vendor_perl/5.12.3/x86_64-linux/auto/Term/ReadLine/Gnu/Gnu.so:
> undefined symbol: xmalloc
> 
> Rebuilding dev-perl/Term-ReadLine-Gnu doesn't help.  None of emerge
> @preserved-rebuild, revdep-rebuild, or perl-cleaner --all try to rebuild
> anything.

Same here. 

Downgrading to sys-libs/readline-6.1_p2 fixed it. Apparently the new readline 6.2 internally doesn't use xmalloc any more. I guess, dev-perl/Term-ReadLine-Gnu needs to be updated and the existing version hardwired to readline 6.1.

I compared the symbols with "nm" from the /usr/lib64/libreadline.a static libs from both readline versions.

6.1 nm /usr/lib64/libreadline.a:

xmalloc.o:
                 U __fprintf_chk
                 U exit
                 U free
                 U malloc
0000000000000000 t memory_error_and_abort
                 U realloc
                 U stderr
00000000000000b0 T xfree
0000000000000030 T xmalloc
0000000000000060 T xrealloc

6.2 nm /usr/lib64/libreadline.a:

xmalloc.o:
                 U __fprintf_chk
0000000000000030 T _rl_malloc
0000000000000060 T _rl_realloc
                 U exit
                 U malloc
0000000000000000 t memory_error_and_abort
                 U realloc
                 U stderr
Comment 3 William Throwe 2011-02-16 13:43:24 UTC
Created attachment 262733 [details]
build.log
Comment 4 Torsten Veller (RETIRED) gentoo-dev 2011-02-16 19:43:35 UTC
*** Bug 355243 has been marked as a duplicate of this bug. ***
Comment 5 PetaMem R&D 2011-02-16 22:29:46 UTC
(In reply to comment #4)
> *** Bug 355243 has been marked as a duplicate of this bug. ***

Indeed...

I can confirm, that downgrading to libreadline 6.1_p2 fixes the issue.
Comment 6 Frank Ridderbusch 2011-02-17 07:31:07 UTC
I forgot to include this:

(In reply to comment #2)
> 6.1 nm /usr/lib64/libreadline.a:
> 
> xmalloc.o:
>                  U __fprintf_chk
>                  U exit
>                  U free
>                  U malloc
> 0000000000000000 t memory_error_and_abort
>                  U realloc
>                  U stderr
> 00000000000000b0 T xfree
> 0000000000000030 T xmalloc
> 0000000000000060 T xrealloc

# nm /usr/lib64/libreadline.a|grep xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
xmalloc.o:
0000000000000030 T xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc
                 U xmalloc

As can be seen: xmalloc is used in a couple of places.

> 6.2 nm /usr/lib64/libreadline.a:
> 
> xmalloc.o:
>                  U __fprintf_chk
> 0000000000000030 T _rl_malloc
> 0000000000000060 T _rl_realloc
>                  U exit
>                  U malloc
> 0000000000000000 t memory_error_and_abort
>                  U realloc
>                  U stderr

# nm /usr/lib64/libreadline.a|grep xmalloc
xmalloc.o:

Not used anymore, only a source file xmalloc.c.
Comment 7 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2011-02-21 02:46:53 UTC
Reported Upstream: 

https://rt.cpan.org/Ticket/Display.html?id=65973&results=1f2f2f501c3348f96d6a0aa80fbeceb8
Comment 8 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2011-02-21 07:14:52 UTC
As a temporary fix, assuming nothing you use *directly* uses ReadLine::Gnu, you can force a removal of ReadLine::Gnu and allow the ReadLine::Perl module do to the job instead. Not an ideal fix perhaps, but for some it may be a better solution than downgrading readline. 

( Works For Me with Dist::Zilla )
Comment 9 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2011-02-21 16:09:09 UTC
I think we need to CC the readline people on this, its possibly their fault in the build process. 

I discovered that If I build readline myself ( instead of using Gentoo's build of it ), this is what libreadline.a has in it instead:

Gentoo's xmalloc.o:
                 U __fprintf_chk
0000000000000030 T _rl_malloc
0000000000000060 T _rl_realloc
                 U exit
                 U malloc
0000000000000000 t memory_error_and_abort
                 U realloc
                 U stderr

Stock xmalloc.o
xmalloc.o:
                 U __fprintf_chk
                 U exit
                 U malloc
0000000000000000 t memory_error_and_abort
                 U realloc
                 U stderr
000000000000002c T xmalloc
000000000000004e T xrealloc


Comment 10 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2011-02-21 16:33:35 UTC
http://lists.gnu.org/archive/html/bug-readline/2010-07/msg00013.html

append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free

xmalloc is being renamed to _rl_malloc 

Not sure how to override this in the ebuild for perl yet =).
Comment 11 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2011-02-21 17:25:27 UTC
src_prepare() {
	perl-module_src_prep;

	einfo "Hacking CPPFlags into makefile";
	sed -i 's/^SO = so/PASTHRU_DEFINE = -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free\nSO = so/' "${S}/Makefile" \
		|| die "Cant hack the makefile :("
}


^ this *brutal* hack misuses the MakeFile somewhat, *but it works*. \o/
Comment 12 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2011-02-21 17:46:44 UTC
src_compile() {

	perl_set_version

	has src_configure ${PERL_EXPF} || perl-module_src_prep

	if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then
		local mymake_local=(${mymake})
	else
		local mymake_local=("${mymake[@]}")
	fi
	set -- \
		PASTHRU_DEFINE="-Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free" \
		OTHERLDFLAGS="${LDFLAGS}" \
		"${mymake_local[@]}"
	einfo "emake" "$@"
	emake "$@" \
		|| die "Compilation failed"
}


Slightly better, works also. 

Not 100% happy with it yet though.
Comment 13 Torsten Veller (RETIRED) gentoo-dev 2011-02-21 18:57:06 UTC
The same as adding the following in the build:

mymake=( PASTHRU_DEFINE="-Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free" )

Comment 14 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-03-01 10:43:04 UTC
*** Bug 356273 has been marked as a duplicate of this bug. ***
Comment 15 Torsten Veller (RETIRED) gentoo-dev 2011-03-10 06:43:24 UTC
@base-system:
To make dev-perl/Term-ReadLine-Gnu work with >=sys-libs/readline-6.2 we have to add something like the following to the ebuild

> mymake=( PASTHRU_DEFINE="-Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free" )


I guess we have to R/DEPEND explicitly on >=sys-libs/readline-6.2 ?
Comment 16 SpanKY gentoo-dev 2011-03-10 09:04:27 UTC
hard RDEPEND will probably be the sanest for people to work with
Comment 17 Torsten Veller (RETIRED) gentoo-dev 2011-03-10 13:09:36 UTC
Thanks. 1.200.0-r1 works with >=sys-libs/readline-6.2