Bug 244328 - mkinitrd hack drops 58 cores while creating new initrd
Summary: mkinitrd hack drops 58 cores while creating new initrd
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: mkinitrd
Version: 8
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Peter Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-06-15 02:57 UTC by Michal Jaegermann
Modified: 2009-01-09 04:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-09 04:39:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michal Jaegermann 2007-06-15 02:57:09 UTC
Description of problem:

'mkinitrd' from F7 has the following code:

    # this is a hack, but the only better way requires binutils or elfutils
    # be installed.  i.e., we need readelf to find the interpretter.
    for ldso in /lib*/ld*.so* ; do
        [ -x $ldso ] || continue
        $ldso --verify $bin >/dev/null 2>&1 || continue
.......
    done

This is indeed a hack and it has "interesting" consequences.  The
catch is that on the system in question I have really old binaries
with their libraries and also their old loader.  That loop above
catches it and as a result I am getting

/sbin/mkinitrd: line 173:  3241 Segmentation fault \
    (core dumped) $ldso --verify $bin > /dev/null 2>&1

fifty eigth times.  Quite an achievement, I have to say.
Well, new initrd gets created regardless; so at least I am not
dead after such run.

If we are hacking that at least one could check if '--verify' option
is indeed available before trying to use it.  The following trivial
patch prevents all that dog-and-pony show above:

--- mkinitrd~   2007-06-11 16:22:03.000000000 -0600
+++ mkinitrd    2007-06-14 20:23:53.000000000 -0600
@@ -172,6 +172,7 @@ get_dso_deps() {
     # be installed.  i.e., we need readelf to find the interpretter.
     for ldso in /lib*/ld*.so* ; do
         [ -x $ldso ] || continue
+        $ldso 2>&1 | grep -q -- --verify || continue
         $ldso --verify $bin >/dev/null 2>&1 || continue

         # I still hate shell.


BTW - looking closer at /sbin/mkinitrd I could not fail to notice
that indentation in this script is a curious mixture of tabs and
spaces without an apparent rhyme or reason.  It would likely be
a good idea to tabify or untabify that consitently all over.
A quick run with expand or unexpand will do it (say
'unexpand -a /sbin/mkinitrd > /var/tmp/mkinitrd' ); or emacs can be
trivially asked to do the job.  After the quoted operation that
script size goes down from 40831 to 36072 bytes.

Version-Release number of selected component (if applicable):
mkinitrd-6.0.9-7.1

How reproducible:
always in right circumstances

Comment 1 Bug Zapper 2008-05-14 13:05:49 UTC
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Michal Jaegermann 2008-05-14 16:33:01 UTC
AFAICS the issue is present at least in Fedora 8.  Don't know
at this moment about Fedora 9.  The simplest workaround for F7 and F8
is to use 'for ldso in /lib*/ld-2*.so* ; do ...;done' loop instead
of just 'ld*.so*'.

Comment 3 Andy Lindeberg 2008-07-14 19:59:03 UTC
Can you test this in Fedora 9?

Comment 4 Michal Jaegermann 2008-07-16 18:41:00 UTC
> Can you test this in Fedora 9?

I can but this is not conclusive.  The thing is that at the moment
I have only x86_64 installations around.  A new version of mkinitrd
will pick up as LDSO, for use in get_dso_deps(), either files from
/lib64/ (that includes desired /lib64/ld-linux-x86-64.so.2 among
other things) or will try such "interesting" values for LDSO like
/etc/ld.so.conf.d/mysql-x86_64.conf.  None of this will attempt to use
/lib/ld.so.1.9.5 - which I need for some old binaries and what was
really triggering the problem.  I am not sure what would happen on
i386 installation but on x86_64 /lib/ld* is not attempted at all so
the issue is gone.

A workaround for older versions of /sbin/mkinitrd was to exclude
in that script "bad" versions of /lib/ld*, which were not needed
in the context anyway, thus preventing segfaults.

Comment 5 Bug Zapper 2008-11-26 07:20:11 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Bug Zapper 2009-01-09 04:39:02 UTC
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.