This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70515] New: Nested lambdas causing invalid captured pointers on some platforms


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

            Bug ID: 70515
           Summary: Nested lambdas causing invalid captured pointers on
                    some platforms
           Product: gcc
           Version: 5.4.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at norgg dot org
  Target Milestone: ---

Created attachment 38163
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38163&action=edit
Minimal testcase

The attached code causes a segfault at runtime due to an invalid read when
trying to dereference j on some platforms but not others across multiple
versions of GCC.

We can replicate this on various machines with:

Ubuntu g++ 5.3.1 / 5.1.1 / 4.8.4
Gentoo g++ 5.3.0

But not on:

OSX g++ 5.3.0 / 6.0.0
Debian g++ 5.3.1

The command line used to compile and run was: 

g++ -std=c++11 lambdabug.cpp -o lambdabug && ./lambdabug

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]