Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 15345 - Perl segfaults in perlio
Summary: Perl segfaults in perlio
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-08 19:57 UTC by Shevek
Modified: 2003-10-06 05:33 UTC (History)
2 users (show)

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


Attachments
A log of it all going wrong in gdb (gdb-log,1.74 KB, text/plain)
2003-02-08 19:58 UTC, Shevek
Details
A PERLIO_DEBUG log of it all going wrong (PERLIO_DEBUG-log,56.26 KB, text/plain)
2003-02-08 19:58 UTC, Shevek
Details
output of "emerge info" (emergeinfo,1.29 KB, text/plain)
2003-02-09 08:36 UTC, Shevek
Details
The script used to patch my perl source tree (patchperl,168 bytes, text/plain)
2003-02-09 08:38 UTC, Shevek
Details
The script used to configure perl (perlconfig,613 bytes, text/plain)
2003-02-09 08:39 UTC, Shevek
Details
Log of it all going wrong in valgrind (valgrind-log,9.86 KB, text/plain)
2003-02-09 08:48 UTC, Shevek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shevek 2003-02-08 19:57:39 UTC
Install Term::ReadLine::Gnu
Run CPAN.
Do anything nontrivial.
Quit CPAN.

Perl segfaults.
Comment 1 Shevek 2003-02-08 19:58:24 UTC
Created attachment 8061 [details]
A log of it all going wrong in gdb
Comment 2 Shevek 2003-02-08 19:58:54 UTC
Created attachment 8062 [details]
A PERLIO_DEBUG log of it all going wrong
Comment 3 J Robert Ray 2003-02-09 00:56:53 UTC
Please paste output from 'emerge info'.
Comment 4 Shevek 2003-02-09 08:36:50 UTC
Created attachment 8085 [details]
output of "emerge info"

Perl wasn't actually installed using emerge because that always segfaults.
However, I did apply both gentoo patches and reinstall both libperl and perl
from a gentoo-compatible source tree.
Comment 5 Shevek 2003-02-09 08:38:03 UTC
Created attachment 8086 [details]
The script used to patch my perl source tree

See comments in "emergeinfo" attachment.
Comment 6 Shevek 2003-02-09 08:39:00 UTC
Created attachment 8087 [details]
The script used to configure perl

Someone in the perl development team suggested that -fomit-frame-pointer might
help. It didn't. But since gdb can debug without a frame pointer, I tried it.
Comment 7 Shevek 2003-02-09 08:48:00 UTC
Created attachment 8088 [details]
Log of it all going wrong in valgrind

This almost seems to be the most telling because if you consider the layout of
a stdio structure, this would seem to be attempting to close the same fd twice.
I should therefore see an error from strace on the close() on the fd?
Comment 8 Shevek 2003-02-09 08:59:21 UTC
This bug has Perl rt ticket number 20793.

The last few lines of strace look like:
munmap(0x40324000, 266240)              = 0
munmap(0x40468000, 266240)              = 0
close(3)                                = 0
munmap(0x40313000, 4096)                = 0
close(4)                                = 0
close(4)                                = -1 EBADF (Bad file descriptor)
munmap(0x40314000, 4096)                = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

So it is closing a descriptor twice. It appears that this is because T::RL::Gnu is causing the descriptor to go refcount -1.

Note that the descriptor numbers differ between running perl in gdb and running it under strace or valgrind.
Comment 9 J Robert Ray 2003-06-26 00:13:22 UTC
Reassigning bugs due to lack of time.
Comment 10 Shevek 2003-06-26 05:19:03 UTC
This is now a problem for the Perl maintainers, I think. It's gone away in the latest gentoos, but the code surrounding it isn't pretty.

I have passed the relevant information on to rt.perl.

S.
Comment 11 Michael Cummings (RETIRED) gentoo-dev 2003-08-22 05:28:08 UTC
is this still an open issue?
Comment 12 Shevek 2003-08-23 05:43:17 UTC
Don't think so. rt.perl.<whatever> and Hiro got onto it.
Comment 13 Michael Cummings (RETIRED) gentoo-dev 2003-10-06 05:33:16 UTC
closed for inactivity/upstream action