Bug 118674
Summary: | Static link to gethostbyname_r and using C++ exceptions causes segfault | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Seth Cooper <cooper_seth> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 3.0 | CC: | cooper_seth | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i686 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2004-08-26 05:59:22 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Seth Cooper
2004-03-18 19:53:19 UTC
Created attachment 98664 [details]
Example code that causes a segfault when statically linking
Statically linking and running on AS 3.0 causes this example to segfault when
throw(10) is executed. "g++ main.cc -o main -static" was used.
Works for me: $ rpm -q glibc gcc binutils libstdc++ libstdc++-devel; g++ -g -o main{,.cpp} -static; ./main; echo $? glibc-2.3.2-95.17 gcc-3.2.3-31 binutils-2.14.90.0.4-34 libstdc++-3.2.3-31 libstdc++-devel-3.2.3-31 /tmp/cc2ZYlLR.o(.text+0x87): In function `main': /tmp/main.cpp:12: Using 'gethostbyname_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking Official name = tweety.devel.redhat.com caught exception 0 This is up2date U2 beta. Can you retry with U2 beta packages mentioned above? Thanks for the quick reply! Working on obtaining this U2 beta package through our sysadmins -- might take a little time. I will also try to obtain Update 1 to see if that resolves it. The equivalent package query for our system (should be an unmodified install of AS 3): $ rpm -q glibc gcc binutils libstdc++ libstdc++-devel glibc-2.3.2-95.3 gcc-3.2.3-20 binutils-2.14.90.0.4-26 libstdc++-3.2.3-20 libstdc++-devel-3.2.3-20 Also, for what its worth, the systems are using the SMP enabled (with HT) kernel: 2.4.21-4.ELsmp It seems we are currently unable to obtain these patches, and so are unable to confirm they resolve this issue. Our build process has been modified to now dynamically link to glibc, which appears to provide a satisfactory work-around at this time. I will leave this issue as NEEDINFO in case any further insight may be available. Well, IMHO dynamically linking against glibc (and libpthread if needed) is not a workaround, but the most portable solution. Anyway, glibc-2.3.2-95.20 is available from ftp://people.redhat.com/jakub/glibc/errata/2.3.2-95.20/ No reply in 4 months. The errata is long out of the door. Reopen if you still see problems. |