Bug 117301 - A bug in static library
A bug in static library
Status: CLOSED WORKSFORME
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: glibc (Show other bugs)
3.0
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-02 13:04 EST by Jani Tolonen
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-28 07:12:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
A test case (513 bytes, text/plain)
2004-03-02 13:06 EST, Jani Tolonen
no flags Details

  None (edit)
Description Jani Tolonen 2004-03-02 13:04:27 EST
Description of problem:

initgroup() function does not work when linked in statically.
The following bug.c file demonstrates the problem.

Version-Release number of selected component (if applicable):
glibc-2.3.2-95.6

How reproducible:

a.out username

Steps to Reproduce:
1. gcc -g bug.c -static
2. ./a.out username
3. (use a username that exists above)
  
Actual results:
segmantation fault

Expected results:
Starting test
Test finished successfully!

Additional info:
Comment 1 Jani Tolonen 2004-03-02 13:06:50 EST
Created attachment 98200 [details]
A test case

Just by removing -static at the compilation line will make it work.
The same source compiled with -static switch works on regular x86 Linux
platforms it seems.
A bug in static library where initgroup() is defined..?
Comment 2 Jakub Jelinek 2004-03-02 18:43:34 EST
Cannot reproduce here with glibc-2.3.2-95.14.  What kind of NSS modules
you're using?  Has the binary been linked against the same glibc version
as it has been run?
Comment 3 Jani Tolonen 2004-03-09 12:53:44 EST
I don't have access to this machine anymore, but it should be
the standard installation from that RH distribution, which
comes with glibc-2.3.2-95.6. The machine was setup with standard
installation so that support for it is valid.

Yes, the test case was compiled on the machine on which it was run
on. I tested on regular x86 Linuxes and with the RH EL3,

It works on all platforms, including RH EL3, but adding the -static
to the compilation line will make it fail on RH EL3, and only there
and only in that case. It could be related to that 2.3.2-95.6 glibc
version.

In short, I made the exact 3 steps as in the example above in all
machines where I tested it. The test case was always compiled on the
same platform which it was run on, in both cases with and without
-static.
Comment 4 David Lawrence 2004-03-15 13:56:58 EST
Changing product and version.
Comment 5 Ulrich Drepper 2004-09-28 07:12:12 EDT
You failed to answer the question.  The issue here is the initgroups
call which uses NSS.  NSS requires dynamic linking and dynamic linking
support in statically linked bianries is very limited.

If you do not run nscd, then the only NSS module you can use is
libnss_files.  If this is not enough, use nscd.  Nothing else is
supported.

Since we cannot reproduce any problem I'll close it.  Reopen in case
you can provide a test case which fails.

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