Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 111242 - statically compiled gethostbyname compiled on RH 7 or earlier crashes on RH9
statically compiled gethostbyname compiled on RH 7 or earlier crashes on RH9
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-12-01 04:42 EST by David Jameson
Modified: 2016-11-24 09:58 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-12-02 09:37:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Simple test program which demonstrates the bug (384 bytes, text/plain)
2003-12-01 04:42 EST, David Jameson
no flags Details
stack trace for crash (1.62 KB, text/plain)
2003-12-01 04:43 EST, David Jameson
no flags Details

  None (edit)
Description David Jameson 2003-12-01 04:42:01 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET 
CLR 1.1.4322)

Description of problem:
A statically linked executable compiled on RH7 or earlier crashes
in gethostbyname() on RH9. Happens both with a clean RH9 install
as well as with the latest glibc. It works okay if the program
is compiled statically on RH9. It appears to be an incompatibility
with the nss_files.so static hack (which works with all previous
versions of Linux right back to pre-glibc2 versions).

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

How reproducible:

Steps to Reproduce:
1. (on RH7): g++ -static tester.cpp
2. (on RH9): ./a.out test.com

Actual Results:  Segmentation fault

Expected Results:

Additional info:
Comment 1 David Jameson 2003-12-01 04:42:44 EST
Created attachment 96255 [details]
Simple test program which demonstrates the bug
Comment 2 David Jameson 2003-12-01 04:43:09 EST
Created attachment 96256 [details]
stack trace for crash
Comment 3 Jakub Jelinek 2003-12-02 09:37:50 EST
This is expected and when you link against recent glibcs it even
warns you about it.
If a program uses NSS/iconv/dlopen or locales, it is not self-contained
and as such can be only used against the same glibc as it has been
compiled/linked against.
Better avoid statically linked programs, dynamically linked ones
are way more portable.

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