From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513 Description of problem: When compiling and linking an example application on a gcc-2.96 (or earlier) platform (e.g RH 7.3), and then running it on a RH-8.0 platform, freopen() fails with SIGSEGV in freopen.c:71. The reason is that the stdout and stderr objects doesn't have the _wide_data field initialized (i.e it is NULL). Version-Release number of selected component (if applicable): compat-libstdc++-7.3-2.96.110 How reproducible: Always Steps to Reproduce: 1. Compile and link test program with g++ on a gcc-2.96 platform 2. Run test program on a RH 8.0 platform Actual Results: Application is terminated with SIGSEGV at freopen.c line 71 Expected Results: Normal termination Additional info: The SIGSEGV can be avoided if the application is not linked with libstdc++, or if libc is linked explicitly before libstdc++ like this : # g++ -O2 -c freopentst.cpp # gcc freopentst.o -lc -lstdc++
Created attachment 77884 [details] Test application
Created attachment 90727 [details] workaround with g++(2.96) and with no guarantees..(freopen SEGV) I am not sure if this is a reliable workaround, since std{in,out,err} are #defined macros on majority of OSes. Compiled on RH7.3 and executed on RH8.0: Worked fine. We really need a solution to tell the customer to fetch/upgrade a package before running our product.
Should be fixed in glibc-2.3-1 and later.