From: SourceForge.net <no...@so...> - 2004-07-29 00:09:59
|
Bugs item #630952, was opened at 2002-10-30 22:32 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=630952&group_id=2435 Category: gcc Group: component package Status: Open Resolution: Remind Priority: 5 Submitted By: Florin Ghido (ghido) Assigned to: Danny Smith (dannysmith) Summary: Crash using Kernel32 and C++ exceptions Initial Comment: Hi! There is a big problem with using Kernel32.dll functions and C++ exceptions. After calling a Kernel32.dll function with at least one parameter, the program fails to catch any C++ exception. This appears only when compiling with the option: -fomit-frame-pointer The command line used is: gcc -fomit-frame-pointer Test.cpp -lstdc++ -o Test.exe -s I am using the latest packages: MinGW-2.0.0-3.exe binutils-2.13.90-20021006-2.tar.gz The source.cpp file is: -------------------------------------- #include <windows.h> void test() { SYSTEMTIME p; GetSystemTime(&p); throw 1; } int main(int argc,char* argv[]) { try { test(); return 0; } catch(...) { return 1; } } ----------------------------------------- Running it under W98 SE and W2000 P produces the following result: abnormal program termination Best regards, Florin Ghido ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2004-07-29 12:09 Message: Logged In: YES user_id=11494 A follow up to report status with current (20040728( GCC sources and Dwarf2 enabled: FAIL g++ -O0 -fomit-frame-pointer test.cpp PASS g++ -O1 -mno-accumulate-outgoing-args -fomit-frame- pointer test.cpp [and all higher optimization] g++ -O[anything] -maccumulate-outgoing-args -fomit- frame-pointer test.cpp g++ -O[anything] -mno-accumulate-outgoing-args -fno- omit-frame-pointer test.cpp So its still a problem with Dwarf2, but only when the _only_ optimizarion is -fomit-frame-pointer Danny ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2003-01-04 11:43 Message: Logged In: YES user_id=15438 Florin, did you try Danny's suggestion? What was the result? Also, please try the gcc-3.2.1 release candidate and report your results. Thanks, Earnie. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2002-10-31 12:53 Message: Logged In: YES user_id=11494 Thanks for your report and testcase. I confirm the bug on GCC 3.3 (CVS) built with with Dwarf2 EH handling. The workaround is to add - maccumulate-outgoing-args switch when using -fomit- frame-pointer with Dwarf 2. Could you try that with gcc 3.2 please? With same gcc 3.3 source built with sjlj exception model, the -fomit-frame-pointer switch works on your testcase, _without_ need for -maccumulate-outgoing- args switch. Have a look at PR 6764 at gnatsweb for another testcase that shows the same bug and the same workaround. Gnatsweb is here: http://gcc.gnu.org/cgi-bin/gnatsweb.pl?database=gcc Also, PR6764 tescase works fine with sjlj exception handling. Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=630952&group_id=2435 |