Summary: | perl which uses Term::ReadLine segfaults on process exit; glibc double-free | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Phil Pennock <gentoo> |
Component: | [OLD] Development | Assignee: | Gentoo Perl team <perl> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Phil Pennock
2005-06-02 04:04:45 UTC
Doesn't dup over here Enter your foo text here: ahlo Input was 4 chars long: {ahlo} mcummings@randombox $ Like you said - this looks like a problem between you and glibc, not the perl module. (glibc-2.3.4.20040808-r1, tried it on 3 boxes, fwiw) use the nomalloccheck USE flag when emerging glibc to avoid these errors. (In reply to comment #1) > Like you said - this looks like a problem between you and glibc, not the perl > module. (glibc-2.3.4.20040808-r1, tried it on 3 boxes, fwiw) The glibc check is a diagnostic to highlight a bug. Unfortunately, I can't see a way to turn it off without a re-emerge, as suggested by R.Hill; that's underway now. (FreeBSD's /etc/malloc.conf | $MALLOC_OPTIONS wins here.) Unless there's a glibc bug in the free() checks, this means that there's a bug either in the readline library or the Term::ReadLine perl module (and its XS wrapping). I have sys-devel/bc installed with the 'readline' USE-flag and ldd(1) confirms that it links against libreadline; bc does not core-dump on exit. This suggests that the problem lies with Term::ReadLine itself. Hence the bug-report. As a real-world example of an affected program: cpan(1) glibc no longer provides the nomalloccheck USE-flag on either x86 or ~x86. As such, the complaints about double-free can no longer be avoided and any perl script using Term::ReadLine is dying with SIGABRT on exit: *** glibc detected *** double free or corruption (!prev): 0x083ac0d8 *** sys-libs/glibc-2.3.5 -build -debug -erandom -hardened (-multilib) -nls +nptl -nptlonly +pic (-selinux) +userlocales dev-lang/perl-5.8.6-r5 +berkdb -build -debug +doc +gdbm -ithreads -minimal -perlsuid dev-perl/Term-ReadLine-Perl-1.0203 If using the current Gentoo glibc on x86, can anyone else duplicate this? Thanks, sys-libs/glibc-2.3.5 no sign of this bug. Enter your foo text here: hi me Input was 5 chars long: {hi me} mcummings@nomad% Sorry, bug report is in error. I hadn't remembered that when I'd installed Gentoo, I'd used Term::ReadLine::Gnu which isn't in Portage, because I wanted the advanced features available from the libreadline implementation. I'd forgotten that although "use Term::ReadLine" will use the ...::Gnu version if it's available, it's not included by default. The port is fine. I had failed to rebuild Term::ReadLine::Gnu after an update of Perl, because I'd forgotten that I'd installed some stuff before I learnt about g-cpan.pl; I've now used g-cpan.pl so that this mistake should not be repeated. I'm sorry to have wasted peoples' time. Thank you for being so patient with me whilst I was a complete twit. |