This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77340] New: Invalid (Stack Smashing) Code Generated In Simple Cases With Debug-Mode Vectors
- From: "ian at geometrian dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 23 Aug 2016 07:46:38 +0000
- Subject: [Bug c++/77340] New: Invalid (Stack Smashing) Code Generated In Simple Cases With Debug-Mode Vectors
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77340
Bug ID: 77340
Summary: Invalid (Stack Smashing) Code Generated In Simple
Cases With Debug-Mode Vectors
Product: gcc
Version: 6.1.1
Status: UNCONFIRMED
Keywords: wrong-code
Severity: major
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ian at geometrian dot com
Target Milestone: ---
Simple test case:
//func.hpp
#define _GLIBCXX_DEBUG
#include <vector>
std::vector<int> func();
//func.cpp
#include "func.hpp"
std::vector<int> func() { return std::vector<int>(); }
//main.cpp
#include <cstdio> //Necessary to cause error
#include "func.hpp"
int main(int /*argc*/, char* /*argv*/[]) {
func(); return 0;
}
Compile with "g++ *.cpp" and run ("./a.out"). Produces:
*** stack smashing detected ***: ./a.out terminated
Aborted (core dumped)