Error Reporting Routines Re Entered
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up g++ Internal compiler error in small program up vote 1 down vote favorite I am writing a small program to solve Project Euler Problem 21, and I was testing out the early parts of my code when I ran into an unexplained internal compiler error. I'd appreciate any tips on how to re-write my program to avoid this kind of error. Here's my build command and compiler options: g++ -std=c++11 -O2 -Wall -o "pe_021" "pe_021.cc" Here's the error that I get: Internal compiler error: Error reporting routines re-entered. Compilation failed. Here's my code: #include #include #include #include using namespace std; const unsigned int N = 10000; //look for amicable numbers smaller than N vector list_of_primes; vector prime_factorize(unsigned int); int main(int argc, char **argv) { //import a list of primes ifstream ifs ("primes_10000.txt"); for (unsigned int index = 0; index < N; index++) { string prime_number; getline(ifs, prime_number); list_of_primes.push_back(stoi(prime_number)); } ifs.close(); //test prime factorization function by prime factorizing 12 vector prime_factorization = prime_factorize(12); for(unsigned int (&prime_and_exponent)[2] : prime_factorization) { cout << prime_and_exponent[0] << ", " << prime_and_exponent[1] << endl; } return 0; } vector
Bug #1165732: GCC 4.7.3 internal compiler error when using std::make_shared. Edit Remove 20 This bug affects 4 people Affects Status Importance Assigned to Milestone gcc-4.7 (Ubuntu) Edit Confirmed Undecided Unassigned Edit Also affects project (?) Also affects distribution/package Nominate for series Bug Description I tried to compile the following code on Ubuntu 12.04, 64-bit version with command line "g++ -std=c++11 shared.cpp" COMPILER OUTPUT: Internal compiler error: Error reporting routines re-entered. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Preprocessed source http://stackoverflow.com/questions/18562511/g-internal-compiler-error-in-small-program stored into /tmp/cclhuYkr.out file, please attach this to your bugreport. ************************************************** shared.cpp #include #include class myclass { public: void add(std::shared_ptr sp) { vec.push_back(sp); if(! sp->has(this) ) sp->add(this); } void add(myclass* p) { vec.push_back(std::make_shared(p)); } bool has(std::shared_ptr sp) { for(auto& x : vec) { if(x.lock()==sp) return true; } return false; } bool has(myclass* p ) { for(auto& x https://bugs.launchpad.net/bugs/1177790 : vec) { if(x.lock().get() == p) return true; } return false; } std::vector> vec; }; int main() { return 0; } Tags: internal pointer shared weak Edit Tag help Berthold Stoeger (bstoeger-a) wrote on 2013-05-14: #1 I get the same error message with std::unique_ptr: #include class A {}; class B { public: std::unique_ptr e; B &operator=(const B &d2); }; void fun(std::unique_ptr &arg) { std::vector v; v.push_back(std::move(*arg)); } Compiled with "g++-4.7 -c -O3 -g -std=c++0x -Wall -o crash.o crash.C" results in: ‘ Internal compiler error: Error reporting routines re-entered. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Preprocessed source stored into /tmp/cclP69wn.out file, please attach this to your bugreport. (Note the ‘ sign in the first line) Berthold Stoeger (bstoeger-a) wrote on 2013-05-14: #2 NB: The file compiles correctly if the necessary copy constructor is added: #include #include class A {}; class B { public: std::unique_ptr e; B &operator=(const B &d2); B(const B&); }; void fun(B &arg) { std::vector v; v.push_back(arg); } Launchpad Janitor (janitor) wrote on 2
instructions: Windows Mac Red Hat Linux Ubuntu Click URL instructions: Right-click on ad, choose "Copy Link", then paste here → (This may not be possible with some types of ads) More information about our ad policies X You seem to have CSS https://sourceforge.net/p/mingw-w64/mailman/message/32000343/ turned off. Please don't fill out this field. You seem to have CSS turned off. Please don't fill out this field. Briefly describe the problem (required): Upload screenshot of ad (required): Select a file, or drag & drop file here. ✔ ✘ Please provide the ad click URL, if possible: Home Browse MinGW-w64 - for 32 and 64 bit Windows Mailing Lists MinGW-w64 - for 32 and 64 bit Windows A complete runtime environment error reporting for gcc Brought to you by: jon_y, ktietz70, nightstrike Summary Files Reviews Support Wiki ▾ Wiki Wiki2 Mailing Lists Tickets ▾ External Testsuite Failures Bugs Support Requests Patches (Obsolete, use public Mailing List) Feature Requests News Discussion Donate Code Git ▾ web ironcrate mingw-w64 portablexdr mingw-w64-documentation mingw-w64-ironcrate mingw-w64-public mingw-w64-svn Re: [Mingw-w64-public] Internal compiler error: Error reporting routines re-entered. Re: [Mingw-w64-public] Internal compiler error: Error reporting routines re-entered. From: JonY - 2014-02-19 22:16:36 Attachments: signature.asc error reporting routines On 2/17/2014 18:17, Wim Bekker wrote: > Suddenly this morning I receive the error message below. What can I do > about it? > > Internal compiler error: Error reporting routines re-entered. > > Please submit a full bug report, > > with preprocessed source if appropriate. > ^^^^^^^^^^^ It's a gcc bug, we can't help unless you give us details on what you were doing. What version of gcc are you using? How did you obtain it? Where did you get it from? What OS are you running it on? Post the command line you were using to compile the failing file, along with the preprocessed code. Since it is C++, you may want to use 7z or tar.xz to compress it. You may also want to talk to the gcc-help mailing list. Thread view [Mingw-w64-public] Internal compiler error: Error reporting routines re-entered. From: Wim Bekker - 2014-02-18 08:13:48 Attachments: Message as HTML Suddenly this morning I receive this error message: Internal compiler error: Error reporting routines re-entered. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. I figured it out that it happens when I call vector::emplace_back for an object with not enough parameters. If I supply enough parameters no compilation error and thus no internal compiler error. I use g++ (rubenvb-4.7.4-release) 4.7.3. [Mingw-w