old-www/LDP/LG/issue42/tag/20.html

337 lines
14 KiB
HTML

<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.2J.h">
<TITLE>The Answer Guy 42: Upgrade Breaks Several Programs, <TT>/proc</TT> Problems, BogoMIPS Discrepancies</TITLE>
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#3366FF" VLINK="#A000A0">
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<center>
<H1><A NAME="answer">
<img src="../../gx/dennis/qbubble.gif" alt="(?)"
border="0" align="middle">
<font color="#B03060">The Answer Guy</font>
<img src="../../gx/dennis/bbubble.gif" alt="(!)"
border="0" align="middle">
</A></H1>
<BR>
<H4>By James T. Dennis,
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
LinuxCare,
<A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A>
</H4>
</center>
<p><hr><p>
<!-- endcut ======================================================= -->
<!-- begin 20 -->
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Upgrade Breaks Several Programs, <TT>/proc</TT> Problems, BogoMIPS Discrepancies</H3>
<H4 ALIGN="center">
A visit to "Library Hell"</H4>
<p><strong>From Pete Caffall on Thu, 27 May 1999
</strong></p>
<!-- ::
Upgrade Breaks Several Programs, <TT>/proc</TT> Problems, BogoMIPS Discrepancies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A visit to "Library Hell"
:: -->
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Jim:
</STRONG></P>
<P><STRONG>
I'm kind of going nuts here trying to figure this one out. I
have just recently upgraded my system at home with RedHat 5.2. It
previously had RedHat 5.0 on it. Since then I have been unable to
get Netscape (4.5.1 or 4.06) to work, as well as Word Perfect 7.0
, and not to be outdone - arena. All break on start up with a
segmentation fault (SYSSEGV) and a core dump. Prior to the
upgrade, all worked (well - don't know about arena - just tried
that to see if it might also break). I did not change my hardware
configuration and is the same as prior to the update. ASUS 5ab MB,
AMD K 6 II 3D 333mhz processor, 64 mb 100mhz sdimm, 5 gb WD IDE hd
drive where Linux is installed. XFree86, Afterstep that came with
the distribution, and ATI Xpert 98 video with 8mb.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
It sounds like the upgrade replaced your shared libraries
with versions that aren't quite compatible with these
applications. Netscape Navigator and Communicator have
both historically been pretty picky about their shared
libraries.
</BLOCKQUOTE>
<BLOCKQUOTE>
There are occasions in the past where a GNU bug fix to their
libc has broken versions of Navigator and Communicator that
relied upon these bugs. You can find out which libraries
these files are linked against with the '<tt>ldd</tt>' command.
</BLOCKQUOTE>
<BLOCKQUOTE>
You can also rebuild your <TT>/etc/ld.so.cache</TT> file by running
the '<tt>ldconfig</tt>' command (a good idea to try that any time
you suspect shared library problems).
</BLOCKQUOTE>
<BLOCKQUOTE>
You say (later) that you tried using <tt>libc.so.5.4.33</tt>.
However you don't say <EM>how</EM> you tried to use it. There
are a couple of magic environment variables <tt>LD_PRELOAD</tt> and
<tt>LD_LIBRARY_PATH</tt> which can be used to override the
order in which shared libraries are loaded (and thus
can control which library gets loaded to supply a given
set of functions).
</BLOCKQUOTE>
<BLOCKQUOTE>
You can read the <tt>ld.so</tt>(8) man page for some details about
how the linker/dynamic for shared objects works under Linux
and other GNU systems.
</BLOCKQUOTE>
<BLOCKQUOTE>
Typically you'd copy your old libraries (with which these
programs were working) into some directory
(<TT>/usr/local/lib-special</TT> for example) and then replace your
links to Navigator, Communicator, WordPerfect, and any other
affected programs with a short wrapper script that sets and
exports the appropriate environment variables and then
launches the original program. There are examples of such
scripts on the web (from people who've had to hack them up
to run earlier versions of Navigator after earlier upgrades
of glibc).
</BLOCKQUOTE>
<BLOCKQUOTE>
Most of this nonsense should be unnecessary under Linux.
First, programs should be written to rely on the
exposed/documented characteristics of the libraries against
which they are linked. Also it's supposed to be possible to
linked to more specific library versions in cases where
the more general version won't work with your application.
That's why we have so many symlinks like these:
</BLOCKQUOTE>
<blockquote><pre>-rwxr-xr-x libc-2.0.7.so
lrwxrwxrwx libc.so.4 -&gt; libc.so.4.7.6
-rwxr-xr-x libc.so.4.7.6
lrwxrwxrwx libc.so.5 -&gt; libc.so.5.4.46
-rwxr-xr-x libc.so.5.4.46
-rwxr-xr-x libc.so.5.4.7
lrwxrwxrwx libc.so.6 -&gt; libc-2.0.7.so
</pre></blockquote>
<BLOCKQUOTE>
(from <TT>/lib</TT> on one of my <A HREF="http://www.suse.com/">S.u.S.E.</A> systems, actually).
</BLOCKQUOTE>
<BLOCKQUOTE>
The idea is that we should be able to have a <tt>libc.so.4.6.XX</tt>
with a symlink to <tt>libc.so.4.6</tt>. <tt>libc.so.4.7.6</tt> (from my
example) would still be the "default" for libc.so.4, but
programs that were linked to <tt>libc.so.4.6</tt> would use our
<tt>libc.so.4.6.XX</tt>. Thus they would be more specifically
bound to the 4.6 versions of the libraries than to the
4.7 or 4.5.
</BLOCKQUOTE>
<BLOCKQUOTE>
This is far more flexible than the implementation of DLLs
we see in MS Windows and NT. It can automatically tolerate
multiple concurrent versions of each library. The
<tt>LD_PRELOAD</tt> and <tt>LD_LIBRARY_PATH</tt> environment variables give us
even more flexibility since we can override the linkage at
run time for a specific process (or family or processes).
</BLOCKQUOTE>
<BLOCKQUOTE>
However, it can be a pain to manage for mere mortals
such as myself. Oddly enough it also seems to be more of
a problem for the commercial packages than for other Linux
software. I have to cope with far less "library hell"
resulting from typical binary packages than I do with
the big commercial ones.
</BLOCKQUOTE>
<BLOCKQUOTE>
I supposed one thing that WordPerfect, Netscape, Applix,
and Star Division could all do is to include all of the
libraries that they require (with which they are linked and
tested) on their CDs. They could then have an installation
and/or configuration option to install those in a
special directory (<TT>/opt/${PACKAGE}/lib</TT>) and to automatically
invoke their programs in a "compatability mode" where they
set their own <tt>LD_PRELOAD</tt> variables properly and launch thier
binaries.
</BLOCKQUOTE>
<BLOCKQUOTE>
Such a scheme could allow these companies to be more robust
in the face of distribution updates (such as your
transition from <A HREF="http://www.redhat.com/">Red Hat</A> 5.0 to 5.2 and the more disastrous
change from 5.x to 6.0 that has broken StarOffice and other
packages for so many Red Hat users in recent weeks).
</BLOCKQUOTE>
<BLOCKQUOTE>
(At the same time these packages would not need to take
up the additional disk space and memory footprint when
running on a system whose default libraries are suited
to the situation).
</BLOCKQUOTE>
<BLOCKQUOTE>
In any event you might consider upgrading to RH 6.0 and
WP 8.0. I personally suggest letting the distribution
maintainers do as much of the work of getting you
out of "library hell" as possible.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
One thing I have noticed -it had problems trying to mount the
<TT>/proc</TT> file system - boot message indicated that it couldn't find
<TT>/proc</TT> in the fstab or mtab. I didn't notice it the last time I
booted, and looking in <TT>/proc</TT>, it shows as a file system, although
df -a doesn't show it. I tried using the libc.so.5.4.33 but this
did not resolve the problem.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I presume that your reference to <tt>libc.so.5.4.33</tt> relates back
to your problems with certain applications since the <TT>/proc</TT>
issues are very unlikely to relate to your shared libraries.
</BLOCKQUOTE>
<BLOCKQUOTE>
Classically the '<tt>mount</tt>' command should be statically linked.
I notice that S.u.S.E. 5.2 and <A HREF="http://www.debian.org/">Debian</A> 2.1 and Red Hat 5.2
all have it dynamically linked against libc. This is BAD
(since a corrupt <tt>ls.so.cache</tt> or a damaged <tt>libc.so</tt> will then
prevent you from even mounting up an alternative filesystem).
There is an alarming trend to configure whole systems to
practically require dynamic linking for everything. This
makes the whole system less robust with greater and more
critical interdependencies. (In this regard we are
following in Sun's footsteps; it's practically impossible to
create a statically linked program under Solaris).
</BLOCKQUOTE>
<BLOCKQUOTE>
However, I doubt that your problem with <TT>/proc</TT> has anything
to do with shared libraries.
</BLOCKQUOTE>
<BLOCKQUOTE>
Your mtab file should initially be empty when your reboot.
Your <TT>/etc/fstab</TT> file should have an entry from <TT>/proc</TT> that
looks something like:
</BLOCKQUOTE>
<blockquote><pre>none /proc proc defaults 0 0
</pre></blockquote>
<BLOCKQUOTE>
... If it doesn't, add one.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Any suggestions (nice ones) would be appreciated.
</STRONG></P>
<P><STRONG>
One curiosity question: The system at home with the AMD K6 II
3D reports 663 bogomips. The system I have at work is a Pentium
II (not Celeron) 400 Mhz, and it reports 397 bogomips. What gives.
Thanks in advance for any help you can give.
<br>Pete Caffall
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I wouldn't worry about it. BogoMIPS are a measure of how
fast your processor executes a fast idle loop. That is to
say, how fast can your processor do NOTHING. In most cases
a stock Pentium CPU will have a BogoMIPS value that's
reasonably close to its clock speed. However Pentium MMX
and various clone CPUs with MMX like extensions (like
your AMD K6) will have higher BogoMIPS values.
</BLOCKQUOTE>
<BLOCKQUOTE>
My Pentium 150 shows:
</BLOCKQUOTE>
<blockquote><pre>cpu MHz : 167.050963
bogomips : 66.56
</pre></blockquote>
<BLOCKQUOTE>
(excerpts from <TT>/proc/cpuinfo</TT>) while my Omnibook 800
(Pentium 166) shows a BogoMIPS of 328.50. My old
386DX/33 shows a BogoMIPS of about 6.6
</BLOCKQUOTE>
<BLOCKQUOTE>
There's a reason why Linus named these "BOGO"-MIPS
</BLOCKQUOTE>
<BLOCKQUOTE>
(I guess they're actually used in the kernel for
certain types of short idle loops).
</BLOCKQUOTE>
<!-- sig -->
<!-- end 20 -->
<!--startcut ======================================================= -->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
>Copyright &copy;</a> 1999, James T. Dennis
<BR>Published in <I>The Linux Gazette</I> Issue 42 June 1999</H5>
<H6 ALIGN="center">HTML transformation by
<A HREF="mailto:star@starshine.org">Heather Stern</a> of
Starshine Techinical Services,
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H6>
<P> <hr> <P>
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
<TABLE WIDTH="97%"><TR VALIGN="center" ALIGN="center">
<TD ROWSPAN="4" COLSPAN="1" WIDTH="37%"><A
HREF="../lg_answer42.html"
><IMG SRC="../../gx/dennis/answernew.gif"
ALT="[ Answer Guy Index ]"></A></td>
<TD WIDTH="10%"><A HREF="1.html">1</A></TD>
<TD WIDTH="10%"><A HREF="2.html">2</A></TD>
<TD WIDTH="10%"><A HREF="3.html">3</A></TD>
<TD WIDTH="10%"><A HREF="4.html">4</A></TD>
<TD WIDTH="10%"><A HREF="5.html">5</A></TD>
<TD WIDTH="10%"><A HREF="6.html">6</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD><A HREF="7.html">7</A></TD>
<TD><A HREF="8.html">8</A></TD>
<TD><A HREF="9.html">9</A></TD>
<TD><A HREF="10.html">10</A></TD>
<TD><A HREF="11.html">11</A></TD>
<TD><A HREF="12.html">12</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD><A HREF="13.html">13</A></TD>
<TD><A HREF="14.html">14</A></TD>
<TD><A HREF="15.html">15</A></TD>
<TD><A HREF="16.html">16</A></TD>
<TD><A HREF="17.html">17</A></TD>
<TD><A HREF="18.html">18</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
<TD><A HREF="19.html">19</A></TD>
<TD><A HREF="20.html">20</A></TD>
<TD><A HREF="21.html">21</A></TD>
<TD><A HREF="22.html">22</A></TD>
<TD><A HREF="23.html">23</A></TD>
<TD><A HREF="24.html">24</A></TD>
</TR></TABLE>
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
<P> <hr> <P>
<!-- begin lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<A HREF="../../index.html"
><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
<A HREF="/index.html"
><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
<A HREF="../lg_bytes42.html"
><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
<A HREF="../lg_tips42.html"
><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
<!-- end lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
</BODY></HTML>
<!--endcut ========================================================= -->