Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Indexer "crashes" at simple example(A seemingly simple code to break the indexer miserably)
icon4.gif  Indexer "crashes" at simple example [message #987735] Tue, 27 November 2012 19:56 Go to next message
Enis Bayramoglu is currently offline Enis Bayramoglu
Messages: 5
Registered: July 2009
Junior Member
Hi,

First of all, thank you VERY MUCH for the really nice tool that is Eclipse CDT! After hours of fishing, I've arrived at a seemingly simple piece of code that makes the indexer fail miserably. What's really concerning about this piece of code is that the indexer not only fails to index this code, but it crashes completely. So, even if such a code appears in some corner in a huge code-base, the entire indexing fails just because of that. That's also why it took me a few hours to arrive at the source of the problem. Here's the code:

#include <boost/intrusive/slist.hpp>
#include <boost/checked_delete.hpp>

using boost::intrusive::slist;

template<int dim>
class GaussianHypothesis: public boost::intrusive::slist_base_hook<> {
public:
};

template<int dim>
class MultiHypDist {
public:
	void clear() {
		// If you don't comment out the next line, the indexer fails miserably
		//slist<GaussianHypothesis<dim> >().clear_and_dispose(boost::checked_delete<GaussianHypothesis<dim> >);
	}
};

int main() {
	slist<GaussianHypothesis<1> > l;
	l.clear_and_dispose(boost::checked_delete<GaussianHypothesis<1> >);
}


Note that this code builds and runs without errors, with or without the commented out line.

Is there a way to work around this problem, or should I just modify my code until the indexer doesn't crash anymore?

Note that I've tried to increase the maximum allowed index size a lot and I've given Eclipse 4GB of heap size. I have 64-bit Ubuntu 12.04 installed, but I'm not using eclipse from the default repositories. I've downloaded eclipse juno from the website. So; Eclipse version: 4.2.1, CDT version: 8.1.1.201209170703, GCC version: 4.6.3 (in case it matters anyhow).

[Updated on: Tue, 27 November 2012 22:46]

Report message to a moderator

Re: Indexer "crashes" at simple example [message #987796 is a reply to message #987735] Wed, 28 November 2012 08:34 Go to previous messageGo to next message
Enis Bayramoglu is currently offline Enis Bayramoglu
Messages: 5
Registered: July 2009
Junior Member
I just wanted to let you know that I've worked around this problem with the following code that does exactly the same thing without boost::checked_delete

#include <boost/intrusive/slist.hpp>
#include <boost/checked_delete.hpp>

using boost::intrusive::slist;

template<int dim>
class GaussianHypothesis: public boost::intrusive::slist_base_hook<> {
public:
};

template<int dim>
void deleteHypothesis(GaussianHypothesis<dim> * hyp) {
	delete hyp;
}

template<int dim>
class MultiHypDist {
public:
	void clear() {
		// If you don't comment out the next line, the indexer fails miserably
		//slist<GaussianHypothesis<dim> >().clear_and_dispose(boost::checked_delete<GaussianHypothesis<dim> >);
		slist<GaussianHypothesis<dim> >().clear_and_dispose(deleteHypothesis<dim>);
	}
};

int main() {
	slist<GaussianHypothesis<1> > l;
	l.clear_and_dispose(boost::checked_delete<GaussianHypothesis<1> >);
}


This doesn't break the indexer, and the entire code-base is being indexed successfully now.
Re: Indexer "crashes" at simple example [message #988710 is a reply to message #987735] Sat, 01 December 2012 18:57 Go to previous messageGo to next message
Yevgeny Shifrin is currently offline Yevgeny Shifrin
Messages: 202
Registered: July 2009
Senior Member
Hi,

Could you please open a bug report for this issue, so it could be solved for next releases?

https://bugs.eclipse.org/bugs/query.cgi?product=CDT

Thanks,
Yevgeny
Re: Indexer "crashes" at simple example [message #988746 is a reply to message #988710] Sun, 02 December 2012 15:08 Go to previous message
Enis Bayramoglu is currently offline Enis Bayramoglu
Messages: 5
Registered: July 2009
Junior Member
Hi,

I just did. https://bugs.eclipse.org/bugs/show_bug.cgi?id=395552

Thanks,
Enis
Previous Topic:[Windows 8] Projects aren't visible.
Next Topic:Breakpoint command not sent to gdb when debugging attached program
Goto Forum:
  


Current Time: Tue Sep 16 09:48:53 GMT 2014

Powered by FUDForum. Page generated in 0.02192 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software