public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dspeyer at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55870] New: Compiler crash when template includes sizeof of something that shouldn't be dereferenced Date: Thu, 03 Jan 2013 22:39:00 -0000 [thread overview] Message-ID: <bug-55870-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55870 Bug #: 55870 Summary: Compiler crash when template includes sizeof of something that shouldn't be dereferenced Classification: Unclassified Product: gcc Version: 4.3.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: dspeyer@gmail.com Created attachment 29079 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29079 Preprocessed Source Code The compiler said "internal compiler error: Segmentation fault. Please submit a full bug report" so I am. I realize there are few safe things to do with a dereferenced null pointer, but usually sizeof is one of them. Source code is attached. I think the critical line is: template<typename b> static void* val(silliness<sizeof(static_cast<b*>(NULL)->s1)>*) which was supposed to specialize if and only if b::s1 existed. As you may have guessed, this was an attempt to figure out why saner sfinae mechanisms weren't working. Here's the compiler output: g++ -v --save-temps -o sfinae sfinae.cc Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'sfinae' '-shared-libgcc' '-mtune=generic' /usr/lib/gcc/i486-linux-gnu/4.3.3/cc1plus -E -quiet -v -D_GNU_SOURCE sfinae.cc -D_FORTIFY_SOURCE=2 -mtune=generic -fpch-preprocess -o sfinae.ii ignoring nonexistent directory "/usr/local/include/i486-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../i486-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/include/c++/4.3 /usr/include/c++/4.3/i486-linux-gnu /usr/include/c++/4.3/backward /usr/local/include /usr/lib/gcc/i486-linux-gnu/4.3.3/include /usr/lib/gcc/i486-linux-gnu/4.3.3/include-fixed /usr/include/i486-linux-gnu /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'sfinae' '-shared-libgcc' '-mtune=generic' /usr/lib/gcc/i486-linux-gnu/4.3.3/cc1plus -fpreprocessed sfinae.ii -quiet -dumpbase sfinae.cc -mtune=generic -auxbase sfinae -version -fstack-protector -o sfinae.s GNU C++ (Ubuntu 4.3.3-5ubuntu4) version 4.3.3 (i486-linux-gnu) compiled by GNU C version 4.3.3, GMP version 4.2.4, MPFR version 2.4.0. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: e2b5a0303075a65d33d75f9466062812 sfinae.cc:28: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.3/README.Bugs> for instructions.
next reply other threads:[~2013-01-03 22:39 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-01-03 22:39 dspeyer at gmail dot com [this message] 2013-01-04 13:19 ` [Bug c++/55870] " paolo.carlini at oracle dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-55870-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).