[arch-general] [gcc-4.3] segfault when runnung -O3 compiled c++ code
Hi, Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test ?? I mailed to the gcc-help list regarding this issue: http://thread.gmane.org/gmane.comp.gcc.help/24804 Thanks, -- Maik PS: I'm on arch64, no testing no unstable.
On 26/06/2008, at 6:13 PM, Maik Beckmann wrote:
Hi,
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test
Using gcc 4.3.1 on arch32, I don't get a segfault.
Maik Beckmann <beckmann.maik@googlemail.com> writes:
Hi,
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test ??
I mailed to the gcc-help list regarding this issue: http://thread.gmane.org/gmane.comp.gcc.help/24804
Thanks, -- Maik
PS: I'm on arch64, no testing no unstable.
Same here with: moose@hrist~ %gcc -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix --mandir=/usr/share/man --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic Thread model: posix gcc version 4.3.1 (GCC) Arch64 up to date: [testing] [core] [extra] [community]
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test same here:
11:14:33 [~/idownload] cat test.cpp struct Vector { Vector() : x(0), y(0), z(0) { } float x,y,z; }; struct Foo { int dummy; // commenting this out makes it run perfectly Vector array_of_vectors[4]; }; Foo foo; int main() { } 11:14:35 [~/idownload] g++ -O3 test.cpp -o test 11:14:54 [~/idownload] ./test Speicherzugriffsfehler 11:14:57 [~/idownload] g++ --version g++ (GCC) 4.3.1 Copyright (C) 2008 Free Software Foundation, Inc. Dies ist freie Software; die Kopierbedingungen stehen in den Quellen. Es gibt KEINE Garantie; auch nicht für MARKTGÄNGIGKEIT oder FÜR SPEZIELLE ZWECKE. 11:15:07 [~/idownload] uname -a Linux Sarah 2.6.25-ARCH #1 SMP PREEMPT Sat Jun 14 17:44:19 CEST 2008 x86_64 Intel(R) Core(TM)2 Quad CPU @ 2.40GHz GenuineIntel GNU/Linux 11:15:11 [~/idownload] -- Gruß, Johannes Täglich http://blog.hehejo.de und du fühlst dich gut. http://cryptocd.eduforge.org/online_version
Worked seamlessly on Arch32. # gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix --mandir=/usr/share/man --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic Thread model: posix gcc version 4.3.1 (GCC) Dincer Celik ~ info@dincercelik.com ~ dincer@bornovali.com ~ http://dincercelik.com/pub.asc Please encrypt every mail you can. Privacy is your right. Don't let anyone take it from you. Look at GnuPG or PGP and ask for my key D352EEBA. Maik Beckmann wrote:
Hi,
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test ??
I mailed to the gcc-help list regarding this issue: http://thread.gmane.org/gmane.comp.gcc.help/24804
Thanks, -- Maik
PS: I'm on arch64, no testing no unstable.
I have the same segfault here (amd64, gcc 4.3.1) If you swap their positions, it will work with -O3, too. struct Foo { Vector array_of_vectors[4]; int dummy; }; André Am Thu, 26 Jun 2008 10:13:13 +0200 schrieb Maik Beckmann <beckmann.maik@googlemail.com>:
Hi,
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test ??
I mailed to the gcc-help list regarding this issue: http://thread.gmane.org/gmane.comp.gcc.help/24804
Thanks, -- Maik
PS: I'm on arch64, no testing no unstable.
Am Donnerstag 26 Juni 2008 11:59:12 schrieb A. Klitzing:
I have the same segfault here (amd64, gcc 4.3.1)
If you swap their positions, it will work with -O3, too.
struct Foo { Vector array_of_vectors[4]; int dummy; };
André
Yepp, but both have to work.
Maik Beckmann wrote:
Hi,
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test ??
I mailed to the gcc-help list regarding this issue: http://thread.gmane.org/gmane.comp.gcc.help/24804
Thanks, -- Maik
PS: I'm on arch64, no testing no unstable.
Any optimizations beyond -O2 is known to give problems. Post a bugreport at gcc.gnu.org. Glenn
Am Donnerstag 26 Juni 2008 10:13:13 schrieb Maik Beckmann:
Hi,
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test ??
I mailed to the gcc-help list regarding this issue: http://thread.gmane.org/gmane.comp.gcc.help/24804
Thanks, -- Maik
PS: I'm on arch64, no testing no unstable.
I just managed to debootstrap ubuntu hardy amd64 to a partition. Same segfault! Thank you people for helping me hunting down this bug. I'll file a bug report to gcc. -- Maik
It compiles and runs fine with my g++ 4.3.0 I don't get any segfaults anyway. ~> g++ -O3 test.c -o test ~> ./test ~> g++ -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix --mandir=/usr/share/man --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic Thread model: posix gcc version 4.3.0 (GCC) Best Regards Fredrik Eriksson Maik Beckmann wrote:
Am Donnerstag 26 Juni 2008 10:13:13 schrieb Maik Beckmann:
Hi,
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test ??
I mailed to the gcc-help list regarding this issue: http://thread.gmane.org/gmane.comp.gcc.help/24804
Thanks, -- Maik
PS: I'm on arch64, no testing no unstable.
I just managed to debootstrap ubuntu hardy amd64 to a partition. Same segfault! Thank you people for helping me hunting down this bug. I'll file a bug report to gcc.
-- Maik
Am Freitag 27 Juni 2008 08:48:17 schrieb Maik Beckmann:
Am Donnerstag 26 Juni 2008 10:13:13 schrieb Maik Beckmann:
Hi,
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test ??
I mailed to the gcc-help list regarding this issue: http://thread.gmane.org/gmane.comp.gcc.help/24804
Thanks, -- Maik
PS: I'm on arch64, no testing no unstable.
I just managed to debootstrap ubuntu hardy amd64 to a partition. Same segfault! Thank you people for helping me hunting down this bug. I'll file a bug report to gcc.
-- Maik
Ahh, nevermind :P I missed that you wrote you're on arch64, i'm still on 32bits :P Best Regards Fredrik Eriksson Maik Beckmann wrote:
Am Donnerstag 26 Juni 2008 10:13:13 schrieb Maik Beckmann:
Hi,
Can someone confirm that this http://codepad.org/I313t7BN compiled with g++ -O3 test.cpp -o test gives a segfault when trying to run it via ./test ??
I mailed to the gcc-help list regarding this issue: http://thread.gmane.org/gmane.comp.gcc.help/24804
Thanks, -- Maik
PS: I'm on arch64, no testing no unstable.
I just managed to debootstrap ubuntu hardy amd64 to a partition. Same segfault! Thank you people for helping me hunting down this bug. I'll file a bug report to gcc.
-- Maik
Am Freitag 27 Juni 2008 09:18:17 schrieb Maik Beckmann:
Bug has been fixed. Best, -- Maik
participants (8)
-
A. Klitzing
-
Angus Gibson
-
Dincer Celik
-
Fredrik Eriksson
-
Hannes Rist
-
Johannes Held
-
Maik Beckmann
-
RedShift