From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 Description of problem: Stock RHAS2.1, binutils-2.11.90.0.8-12 cpp-2.96-116.7.2 gcc-2.96-116.7.2 gcc-c++-2.96-116.7.2 glibc-2.2.4-31.7 glibc-devel-2.2.4-31.7 libstdc++-2.96-116.7.2 libstdc++-devel-2.96-116.7.2 When this code: // Uncomment any ONE of the ofstream declarations. // Then compile and run. With -O it SEGVs, but // with no -O it runs fine. #include <fstream> int main(int argc, char **argv) { std::ofstream xo("bug.out"); //std::ofstream xo("/dev/stdout"); //std::ofstream xo("/dev/fd/1"); //std::ofstream xo(1); //std::ofstream xo; xo.attach(1); xo << "Hello world." << std::endl; return 0; } is compiled with -O, the created executable produces Segmentation fault. Without -O, the excutable functions normally. BTW, it works on a 7.3 system with gcc-2.96-112 Version-Release number of selected component (if applicable): gcc-2.96-116 How reproducible: Always Steps to Reproduce: 1.compile with/without -O 2.run Actual Results: without -O it works, with it dumps Expected Results: should always work Additional info: This is critical. We have RHAS support contract, and i am persuing that avenue as well, but i am not sure where it will lead me.
What is going on with this?
Hello, my name is Tom Honermann. I too am experiencing this problem.
An errata has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2003-149.html