From: SourceForge.net <no...@so...> - 2005-01-31 09:06:20
|
Bugs item #1101998, was opened at 2005-01-14 12:34 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1101998&group_id=2435 Category: gcc Group: Known bugs Status: Closed Resolution: Works For Me Priority: 5 Submitted By: Nach M. S. (n-a-c-h) Assigned to: Danny Smith (dannysmith) Summary: MinGW 3.4.2 segfaults in throw() Initial Comment: A simple C++ file such as this: int main() { try { throw(5); } catch (...) {} return(0); } Causes a segmentation fault. GDB backtrace shows this: __cxa_throw () As being the problem. ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2005-01-31 22:06 Message: Logged In: YES user_id=11494 ronl wrote: "Is this something I need to keep an eye on in the short to mid term or is this config likely to remain the default for the forseeable future?" I was hoping to get Dwarf2 unwind support into gcc-4.0.0 but was too little, too late. With some help, Inshallah, the main holdup (catching exceptions in w32api callbacks) may be solved for 4.1. So keep bugging me and I'll keep you informed when that happens. But the next release (3.4.4) will still be --enable-sjlj-exceptions. ronl also wrote: "The mingw list seems to have first started bouncing my posts, then unsubbed me as well" Gosh, sometimes I wish the latter would happen to me. Any clues why it happened? Danny ---------------------------------------------------------------------- Comment By: Ron (ronl) Date: 2005-01-31 21:46 Message: Logged In: YES user_id=78887 Thanks Danny, I do have a report that adding this switch seems to fix the incompatibility, so I'll add it to the packages. Is this something I need to keep an eye on in the short to mid term or is this config likely to remain the default for the forseeable future? The mingw list seems to have first started bouncing my posts, then unsubbed me as well so I haven't been following things as closely as I might, but I certainly would like to maintain ABI compatibility with other distributors nonetheless. cheers, Ron ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2005-01-31 20:39 Message: Logged In: YES user_id=11494 I'm closing as it doesn't appear to be a problem with mingw.org distro. Re-open if you think that it can be fixed by mingw.org. Danny ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2005-01-15 10:09 Message: Logged In: YES user_id=11494 I'm not sure thatl lack of --enable-sjlj-exceptions is indeed the cause of the problem. The only way to tell would be to compare testsuite results. Regardless, it would be nice C++ objects compiled with debian distro were ABI compatible with objects produced by mingw.org compiler. I don't know of any other config switches that need to be added. Danny ---------------------------------------------------------------------- Comment By: Ron (ronl) Date: 2005-01-14 16:33 Message: Logged In: YES user_id=78887 Thanks Danny, I generally try to keep the Debian specific options as light as possible, relying on you guys to patch in the right defaults most of the time. (which is working better and better, the last couple I have been able to 'package' just by dropping in the new tarball and pressing 'go'... so things are finally settling into a nice consistency.) I'm currently using: --enable-threads --disable-multilib --enable-version-specific-runtime-libs I can add the sjlj switch too if that is the right thing to do though. Are there any others I should know about/use with 3.4? cheers, Ron ---------------------------------------------------------------------- Comment By: Nach M. S. (n-a-c-h) Date: 2005-01-14 15:57 Message: Logged In: YES user_id=695796 I could not find that symbol in libgcc.a, I already reported the problem to Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=290425 Now I'll follow up with the fix. Thanks for your help. I just hope the Debian team will be as prompt with fixing the problem. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2005-01-14 15:47 Message: Logged In: YES user_id=11494 Thanks for feedback. The problem may be with Dwarf2 unwind info. Look at libgcc.a for symbol _Unwind_SjLj_Register. If not there, then the Debian distro needs to be reconfigured with --enabled-sjlj- exceptions to match the mingw.org distro. Dwarf2 can be made to work with gcc-3.4.4 but I haven't tried with 3.4.2 Danny ---------------------------------------------------------------------- Comment By: Nach M. S. (n-a-c-h) Date: 2005-01-14 13:58 Message: Logged In: YES user_id=695796 Oh and I don't think I was clear before. MinGW itself doesn't segmentation fault. The binary it produces does. Code which doesn't use exception handling works fine though. ---------------------------------------------------------------------- Comment By: Nach M. S. (n-a-c-h) Date: 2005-01-14 13:56 Message: Logged In: YES user_id=695796 As you requested: Reading specs from /usr/lib/gcc/i586-mingw32msvc/3.4.2/specs Configured with: /home/ron/devel/debian/mingw32/mingw32-3.4.2.20040916.1/build_dir/src/gcc-3.4.2-20040916-1/configure -v --prefix=/usr --target=i586-mingw32msvc --enable-languages=c,c++ --enable-threads --disable-multilib --enable-version-specific-runtime-libs Thread model: win32 gcc version 3.4.2 (mingw-special) /usr/libexec/gcc/i586-mingw32msvc/3.4.2/cc1plus -quiet -v filetest.cpp -quiet -dumpbase filetest.cpp -mtune=pentium -auxbase filetest -version -o /tmp/ccGzAtKT.s ignoring nonexistent directory "/usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/sys-include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/i586-mingw32msvc/3.4.2/include/c++ /usr/lib/gcc/i586-mingw32msvc/3.4.2/include/c++/i586-mingw32msvc /usr/lib/gcc/i586-mingw32msvc/3.4.2/include/c++/backward /usr/lib/gcc/i586-mingw32msvc/3.4.2/include /usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/include End of search list. GNU C++ version 3.4.2 (mingw-special) (i586-mingw32msvc) compiled by GNU C version 3.3.5 (Debian 1:3.3.5-2). GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32148 /usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/bin/as -o /tmp/ccJ63Aas.o /tmp/ccGzAtKT.s /usr/libexec/gcc/i586-mingw32msvc/3.4.2/collect2 -Bdynamic /usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/lib/crt2.o /usr/lib/gcc/i586-mingw32msvc/3.4.2/crtbegin.o -L/usr/lib/gcc/i586-mingw32msvc/3.4.2 -L/usr/lib/gcc/i586-mingw32msvc/3.4.2 -L/usr/lib/gcc/i586-mingw32msvc/3.4.2/../../../../i586-mingw32msvc/lib/tmp/ccJ63Aas.o -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt /usr/lib/gcc/i586-mingw32msvc/3.4.2/crtend.o Yes I use the binaries you distribute at mingw.org on Windows, but I don't have that option when I want to cross compile from Linux ;) ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2005-01-14 13:46 Message: Logged In: YES user_id=11494 Please provide output of g++ -v _with your testcase_, eg g++ -v foo.cpp. I'm wondering if you are picking up wrong version of libstc++.a You should probably report this to the org that distributed the binaries. The binaries distributed at mingw.org handle your testcase ok. Danny ---------------------------------------------------------------------- Comment By: Nach M. S. (n-a-c-h) Date: 2005-01-14 13:29 Message: Logged In: YES user_id=695796 Reading specs from /usr/lib/gcc/i586-mingw32msvc/3.4.2/specs Configured with: /home/ron/devel/debian/mingw32/mingw32-3.4.2.20040916.1/build_dir/src/gcc-3.4.2-20040916-1/configure -v --prefix=/usr --target=i586-mingw32msvc --enable-languages=c,c++ --enable-threads --disable-multilib --enable-version-specific-runtime-libs Thread model: win32 gcc version 3.4.2 (mingw-special) The compiled binary crashes on WinXP and on WINE. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2005-01-14 13:25 Message: Logged In: YES user_id=11494 I can't reproduce on NT4(SP5) or XP. Please provide more details including output of g++ -v with your testcase. Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1101998&group_id=2435 |