public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66769] New: internal compiler error: Segmentation fault
@ 2015-07-05 20:03 fiesh at zefix dot tv
  2015-07-05 20:06 ` [Bug c++/66769] " fiesh at zefix dot tv
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fiesh at zefix dot tv @ 2015-07-05 20:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66769

            Bug ID: 66769
           Summary: internal compiler error: Segmentation fault
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fiesh at zefix dot tv
  Target Milestone: ---

Created attachment 35914
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35914&action=edit
Preprocessed test case

The following simple C++14 program leads to a segmentation fault:

#include <vector>

class A
{
        int f(int a) const;
        int g() const;
};

int A::f(int a) const
{
        return 0;
}

int A::g() const
{
        const auto r = [&] (const auto begin, const auto end) {
                for(auto iter = begin; iter != end; ++iter) {
                        const auto newV = f(*iter);
                }
        };
        std::vector<int> p;
        r(p.begin(), p.end());
}

Output of g++ -v --save-temps -c -std=c++14 test.cpp:

Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.2/g++
Target: x86_64-pc-linux-gnu
Configured with: /tmp/portage/sys-devel/gcc-4.9.2/work/gcc-4.9.2/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.2
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.2
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.2/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.2/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.2/python
--enable-languages=c,c++,java,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --disable-nls --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.9.2 p1.0,
pie-0.6.2' --enable-libstdcxx-time --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-multilib
--with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point
--enable-targets=all --enable-libgomp --disable-libmudflap --disable-libssp
--enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.9.2 (Gentoo 4.9.2 p1.0, pie-0.6.2) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-std=c++1y' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.2/cc1plus -E -quiet -v -D_GNU_SOURCE
test.cpp -mtune=generic -march=x86-64 -std=c++1y -fpch-preprocess
-fstack-protector-strong -o test.ii
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/x86_64-pc-linux-gnu
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/g++-v4/backward
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include
 /usr/local/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-std=c++1y' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.2/cc1plus -fpreprocessed test.ii
-quiet -dumpbase test.cpp -mtune=generic -march=x86-64 -auxbase test -std=c++1y
-version -fstack-protector-strong -o test.s
GNU C++ (Gentoo 4.9.2 p1.0, pie-0.6.2) version 4.9.2 (x86_64-pc-linux-gnu)
        compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version
3.1.2-p10, MPC version 1.0.2
warning: GMP header version 6.0.0 differs from library version 5.1.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (Gentoo 4.9.2 p1.0, pie-0.6.2) version 4.9.2 (x86_64-pc-linux-gnu)
        compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version
3.1.2-p10, MPC version 1.0.2
warning: GMP header version 6.0.0 differs from library version 5.1.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 6006c08ba8610f854ee9dcebaa676938
test.cpp: In lambda function:
test.cpp:18:29: internal compiler error: Segmentation fault
    const auto newV = f(*iter);
                             ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/66769] internal compiler error: Segmentation fault
  2015-07-05 20:03 [Bug c++/66769] New: internal compiler error: Segmentation fault fiesh at zefix dot tv
@ 2015-07-05 20:06 ` fiesh at zefix dot tv
  2015-07-06  6:59 ` fiesh at zefix dot tv
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: fiesh at zefix dot tv @ 2015-07-05 20:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66769

--- Comment #1 from fiesh at zefix dot tv ---
Sorry, the above output was for 4.9.2 on a different host, mixed up when I ran
several tests.  For 4.9.3:

Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/g++
Target: x86_64-pc-linux-gnu
Configured with: /tmp/portage/sys-devel/gcc-4.9.3/work/gcc-4.9.3/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.9.3/python
--enable-languages=c,c++,java,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 4.9.3 p1.0, pie-0.6.2' --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-altivec --disable-fixed-point --enable-targets=all --enable-libgomp
--disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto
--without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.9.3 (Gentoo 4.9.3 p1.0, pie-0.6.2) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-std=c++1y' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/cc1plus -E -quiet -v -D_GNU_SOURCE
test.cpp -mtune=generic -march=x86-64 -std=c++1y -fpch-preprocess
-fstack-protector-strong -o test.ii
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/x86_64-pc-linux-gnu
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/backward
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include
 /usr/local/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include-fixed  
 /usr/include  
End of search list.  
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-std=c++1y' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'  
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.3/cc1plus -fpreprocessed test.ii
-quiet -dumpbase test.cpp -mtune=generic -march=x86-64 -auxbase test -std=c++1y
-version -fstack-protector-strong -o test.s  
GNU C++ (Gentoo 4.9.3 p1.0, pie-0.6.2) version 4.9.3 (x86_64-pc-linux-gnu)  
        compiled by GNU C version 4.9.3, GMP version 5.1.3, MPFR version
3.1.2-p10, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (Gentoo 4.9.3 p1.0, pie-0.6.2) version 4.9.3 (x86_64-pc-linux-gnu)
        compiled by GNU C version 4.9.3, GMP version 5.1.3, MPFR version
3.1.2-p10, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072  
Compiler executable checksum: d8c2e3bc4c4ee0abaec9153cbccdd46c
test.cpp: In lambda function:
test.cpp:18:29: internal compiler error: Segmentation fault
    const auto newV = f(*iter);
                             ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/66769] internal compiler error: Segmentation fault
  2015-07-05 20:03 [Bug c++/66769] New: internal compiler error: Segmentation fault fiesh at zefix dot tv
  2015-07-05 20:06 ` [Bug c++/66769] " fiesh at zefix dot tv
@ 2015-07-06  6:59 ` fiesh at zefix dot tv
  2015-07-06 12:04 ` fiesh at zefix dot tv
  2015-07-06 12:15 ` trippels at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: fiesh at zefix dot tv @ 2015-07-06  6:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66769

--- Comment #2 from fiesh at zefix dot tv ---
A friend checked for me, 5.1.0 also appears affected.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/66769] internal compiler error: Segmentation fault
  2015-07-05 20:03 [Bug c++/66769] New: internal compiler error: Segmentation fault fiesh at zefix dot tv
  2015-07-05 20:06 ` [Bug c++/66769] " fiesh at zefix dot tv
  2015-07-06  6:59 ` fiesh at zefix dot tv
@ 2015-07-06 12:04 ` fiesh at zefix dot tv
  2015-07-06 12:15 ` trippels at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: fiesh at zefix dot tv @ 2015-07-06 12:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66769

--- Comment #3 from fiesh at zefix dot tv ---
Better, self contained problem case:

class A
{
        void f(int a);
        int g();
};

void A::f(int a) {}

int A::g()
{
        auto r = [&] (auto x) { f(*x); };
        int * p;
        r(p);
}


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/66769] internal compiler error: Segmentation fault
  2015-07-05 20:03 [Bug c++/66769] New: internal compiler error: Segmentation fault fiesh at zefix dot tv
                   ` (2 preceding siblings ...)
  2015-07-06 12:04 ` fiesh at zefix dot tv
@ 2015-07-06 12:15 ` trippels at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-07-06 12:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66769

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |trippels at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
dup. (see PR61636 comment5)

*** This bug has been marked as a duplicate of bug 61636 ***


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-06 12:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-05 20:03 [Bug c++/66769] New: internal compiler error: Segmentation fault fiesh at zefix dot tv
2015-07-05 20:06 ` [Bug c++/66769] " fiesh at zefix dot tv
2015-07-06  6:59 ` fiesh at zefix dot tv
2015-07-06 12:04 ` fiesh at zefix dot tv
2015-07-06 12:15 ` trippels at gcc dot gnu.org

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).