Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 3897 - insmod needs /usr/lib/libz.so.1
Summary: insmod needs /usr/lib/libz.so.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-19 11:53 UTC by Ben Lutgens (RETIRED)
Modified: 2003-02-04 19:42 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Lutgens (RETIRED) gentoo-dev 2002-06-19 11:53:50 UTC
Using the 1.3b stage1 tarball, I built up a system that uses lvm.  The kernel I
compiled uses modules for LVM.  Imagine my surprise when I tried to insmod the
module to get to /usr and i get the error:
insmod: error while loading shared libraries: libz.so.1: cannot open shared
object file: No such file or directory.

Turns out that libz.so.1 is in /usr/lib.

I cannot stress enough that tools in /bin and /sbin *cannot* rely on libraries
in /usr!  If libz.so.1 is required for insmod, please move it to /lib, otherwise
get rid of that requirement for insmod.
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-06-20 13:44:44 UTC
My booboo, as I added the "zlib" USE flag, and did not make modutils compile
static.
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-06-20 14:31:30 UTC
Fixed in modutils-2.4.16-r1, thanks.
Comment 3 Stefan Jones (RETIRED) gentoo-dev 2002-06-24 02:10:43 UTC
If you want to know why insmod segfaults with zlib as static read this:
Compile insmod using gcc-2.95.3 with zlib and make it static. (gcc 3.1 doesn't
have this bug)
Then run "insmod -s anything", it segfaults.
This is because the function "atexit" from glibc doesn't work with static
binaries compiled with gcc 2.95.3. "atexit" is used by insmod if you pass it the
-s switch. (see source)
It works fine with static gcc 3.1 binaries and dynamic binaries with gcc-2.95.3.
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-06-24 13:07:02 UTC
It does not segfault here, but just dont want to load the module on demand.
called from command line, it works fine though.  Weird, I know.