Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » C/C++ indexer hangs at 0% with max CPU usage
C/C++ indexer hangs at 0% with max CPU usage [message #227689] Fri, 05 December 2008 14:51 Go to next message
Tarjei Knapstad is currently offline Tarjei KnapstadFriend
Messages: 6
Registered: July 2009
Junior Member
The C/C++ indexer seem to hang quite often at 0%, but utilizing 100%
CPU. I'm unable to cancel the indexing (it still hangs with a "cancel
requested" message), which means I have to restart Eclipse to get back
to a state which doesn't eat my laptop battery and keep the fans running
at full blast :)

Is this a known problem? Anything I can do to debug this further?

My setup:

Java:
java version "1.6.0_0"
IcedTea6 1.4 (6b12-Fedora-10) Runtime Environment (build 1.6.0_0-b12)
OpenJDK Server VM (build 10.0-b19, mixed mode)

CDT:
Version: 5.0.1.200809120802

Eclipse:
Version: 3.4.1
Build id: M20080911-1700

Cheers,
--
Tarjei
Re: C/C++ indexer hangs at 0% with max CPU usage [message #227695 is a reply to message #227689] Fri, 05 December 2008 16:40 Go to previous messageGo to next message
James Blackburn is currently offline James BlackburnFriend
Messages: 36
Registered: July 2009
Member
Tarjei Knapstad wrote:
> The C/C++ indexer seem to hang quite often at 0%, but utilizing 100%
> CPU. I'm unable to cancel the indexing (it still hangs with a "cancel
> requested" message), which means I have to restart Eclipse to get back
> to a state which doesn't eat my laptop battery and keep the fans running
> at full blast :)
>
> Is this a known problem? Anything I can do to debug this further?

If you press ctrl-\ from the shell in which you started eclipse, it will
dump its threads. It would be interesting to know how and where the
indexer has hung.

James

>
> My setup:
>
> Java:
> java version "1.6.0_0"
> IcedTea6 1.4 (6b12-Fedora-10) Runtime Environment (build 1.6.0_0-b12)
> OpenJDK Server VM (build 10.0-b19, mixed mode)
>
> CDT:
> Version: 5.0.1.200809120802
>
> Eclipse:
> Version: 3.4.1
> Build id: M20080911-1700
>
> Cheers,
> --
> Tarjei
Re: C/C++ indexer hangs at 0% with max CPU usage [message #227742 is a reply to message #227695] Mon, 08 December 2008 09:32 Go to previous messageGo to next message
Tarjei Knapstad is currently offline Tarjei KnapstadFriend
Messages: 6
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------090902010801000200050704
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

James Blackburn wrote:
> Tarjei Knapstad wrote:
>> The C/C++ indexer seem to hang quite often at 0%, but utilizing 100%
>> CPU. I'm unable to cancel the indexing (it still hangs with a "cancel
>> requested" message), which means I have to restart Eclipse to get back
>> to a state which doesn't eat my laptop battery and keep the fans
>> running at full blast :)
>>
>> Is this a known problem? Anything I can do to debug this further?
>
> If you press ctrl-\ from the shell in which you started eclipse, it will
> dump its threads. It would be interesting to know how and where the
> indexer has hung.
>

Hi James,

Complete dump is attached, this guy seems to be the culprit:

org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.Seman ticUtil.getUltimateTypeViaTypedefs(SemanticUtil.java:230)

I guess it would be interesting to see exactly what code is being parsed
when it hangs, but again I'm not sure how to go about it. Is there a way
that I can attach gdb to the process and get a more detailed stack trace
from the thread that is doing the C++ parsing?

Thanks,
--
Tarjei

--------------090902010801000200050704
Content-Type: text/plain;
name="eclipse-cdt-indexer-hang.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="eclipse-cdt-indexer-hang.txt"

^\2008-12-08 10:22:55
Full thread dump OpenJDK Client VM (10.0-b19 mixed mode):

"Worker-17" prio=10 tid=0x0a5d4400 nid=0x5ea7 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.j ava:185)
- locked <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPoo l.java:217)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:51)

"Worker-16" prio=10 tid=0x0a60cc00 nid=0x5e87 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.j ava:185)
- locked <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPoo l.java:217)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:51)

"Worker-15" prio=10 tid=0x0a61a400 nid=0x5e86 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.j ava:185)
- locked <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPoo l.java:217)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:51)

"Worker-14" prio=10 tid=0x0a5db000 nid=0x5e85 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.j ava:185)
- locked <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPoo l.java:217)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:51)

"Worker-13" prio=10 tid=0x0a617400 nid=0x5e84 waiting on condition
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at org.eclipse.cdt.internal.core.pdom.PDOMIndexerJob$2.run(PDOM IndexerJob.java:158)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

"Worker-12" prio=10 tid=0x0a628400 nid=0x5e83 runnable
java.lang.Thread.State: RUNNABLE
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.Seman ticUtil.getUltimateTypeViaTypedefs(SemanticUtil.java:230)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVi sitor.createType(CPPVisitor.java:1514)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVi sitor.createType(CPPVisitor.java:1588)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVi sitor.createType(CPPVisitor.java:1670)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction.get Type(CPPFunction.java:297)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSe mantics.isSameFunction(CPPSemantics.java:2623)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVi sitor.createBinding(CPPVisitor.java:627)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVi sitor.createBinding(CPPVisitor.java:243)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName.reso lveBinding(CPPASTName.java:77)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.resolveNames(P DOMWriter.java:236)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.addSymbols(PDO MWriter.java:150)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.write ToIndex(AbstractIndexerTask.java:646)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parse File(AbstractIndexerTask.java:606)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parse Linkage(AbstractIndexerTask.java:492)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.runTa sk(AbstractIndexerTask.java:239)
at org.eclipse.cdt.internal.core.pdom.indexer.PDOMIndexerTask.r un(PDOMIndexerTask.java:111)
at org.eclipse.cdt.internal.core.pdom.PDOMIndexerJob.run(PDOMIn dexerJob.java:94)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

"org.eclipse.cdt.internal.ui.text.CReconciler" daemon prio=10 tid=0x0a655000 nid=0x5e29 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x9a9a9098> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)
at org.eclipse.jface.text.reconciler.AbstractReconciler$Backgro undThread.run(AbstractReconciler.java:179)
- locked <0x9a9a9098> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)

"org.eclipse.cdt.internal.ui.text.CReconciler" daemon prio=10 tid=0x096a2800 nid=0x5b43 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x9a765db8> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)
at org.eclipse.jface.text.reconciler.AbstractReconciler$Backgro undThread.run(AbstractReconciler.java:179)
- locked <0x9a765db8> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)

"org.eclipse.cdt.internal.ui.text.CReconciler" daemon prio=10 tid=0x09620400 nid=0x5b41 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x9a6ec348> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)
at org.eclipse.jface.text.reconciler.AbstractReconciler$Backgro undThread.run(AbstractReconciler.java:179)
- locked <0x9a6ec348> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)

"Timer-1" prio=10 tid=0x0a4a8800 nid=0x5af9 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x9a332650> (a java.util.TaskQueue)
at java.util.TimerThread.mainLoop(Timer.java:531)
- locked <0x9a332650> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:484)

"Timer-0" prio=10 tid=0x96b41000 nid=0x5af8 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x9a332700> (a java.util.TaskQueue)
at java.util.TimerThread.mainLoop(Timer.java:531)
- locked <0x9a332700> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:484)

"Worker-7" prio=10 tid=0x0960e800 nid=0x5af3 in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.j ava:185)
- locked <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPoo l.java:217)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:51)

"Worker-3" prio=10 tid=0x09b4d400 nid=0x5aef in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.j ava:185)
- locked <0x991fb9f0> (a org.eclipse.core.internal.jobs.WorkerPool)
at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPoo l.java:217)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:51)

"JavaScript indexing" daemon prio=10 tid=0x0a20b800 nid=0x5ade in Object.wait()
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x99ce82f0> (a org.eclipse.wst.jsdt.internal.core.search.indexing.IndexMana ger)
at java.lang.Object.wait(Object.java:502)
at org.eclipse.wst.jsdt.internal.core.search.processing.JobMana ger.run(JobManager.java:370)
- locked <0x99ce82f0> (a org.eclipse.wst.jsdt.internal.core.search.indexing.IndexMana ger)
at java.lang.Thread.run(Thread.java:636)

"Java indexing" daemon prio=10 tid=0x973b4c00 nid=0x5add in Object.wait()
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x99cb82b8> (a org.eclipse.jdt.internal.core.search.indexing.IndexManager)
at java.lang.Object.wait(Object.java:502)
at org.eclipse.jdt.internal.core.search.processing.JobManager.r un(JobManager.java:371)
- locked <0x99cb82b8> (a org.eclipse.jdt.internal.core.search.indexing.IndexManager)
at java.lang.Thread.run(Thread.java:636)

"org.eclipse.cdt.internal.ui.text.CReconciler" daemon prio=10 tid=0x0a18ec00 nid=0x5adc in Object.wait()
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x99b1f6c0> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)
at org.eclipse.jface.text.reconciler.AbstractReconciler$Backgro undThread.run(AbstractReconciler.java:179)
- locked <0x99b1f6c0> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)

"Worker-0" prio=10 tid=0x09943400 nid=0x5ad0 in Object.wait()
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x9a332740> (a org.eclipse.mylyn.internal.tasks.ui.OfflineCachingStorage$Ca cheFlushJob)
at java.lang.Object.wait(Object.java:502)
at org.eclipse.mylyn.internal.tasks.ui.OfflineCachingStorage$Ca cheFlushJob.run(OfflineCachingStorage.java:242)
- locked <0x9a332740> (a org.eclipse.mylyn.internal.tasks.ui.OfflineCachingStorage$Ca cheFlushJob)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

"Start Level Event Dispatcher" daemon prio=10 tid=0x0982b400 nid=0x5acf in Object.wait()
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x991f2c48> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread )
at java.lang.Object.wait(Object.java:502)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread .getNextEvent(EventManager.java:377)
- locked <0x991f2c48> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread )
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread .run(EventManager.java:317)

"Framework Event Dispatcher" daemon prio=10 tid=0x09832000 nid=0x5ace in Object.wait()
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x991f2cc0> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread )
at java.lang.Object.wait(Object.java:502)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread .getNextEvent(EventManager.java:377)
- locked <0x991f2cc0> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread )
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread .run(EventManager.java:317)

"State Data Manager" daemon prio=10 tid=0x09820800 nid=0x5acd waiting on condition
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at org.eclipse.osgi.internal.baseadaptor.StateManager.run(State Manager.java:297)
at java.lang.Thread.run(Thread.java:636)

"Low Memory Detector" daemon prio=10 tid=0x09591c00 nid=0x5acb runnable
java.lang.Thread.State: RUNNABLE

"CompilerThread0" daemon prio=10 tid=0x0958f000 nid=0x5aca waiting on condition
java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x0958dc00 nid=0x5ac9 waiting on condition
java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=10 tid=0x0957d000 nid=0x5ac8 in Object.wait()
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x98f7b438> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:133)
- locked <0x98f7b438> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:149)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:1 77)

"Reference Handler" daemon prio=10 tid=0x09578c00 nid=0x5ac7 in Object.wait()
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x98f7b4c0> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:502)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java: 133)
- locked <0x98f7b4c0> (a java.lang.ref.Reference$Lock)

"main" prio=10 tid=0x0951f800 nid=0x5ab9 runnable [0xbf942000..0xbf943870]
java.lang.Thread.State: RUNNABLE
at org.eclipse.swt.internal.gtk.OS.Call(Native Method)
at org.eclipse.swt.widgets.Display.sleep(Display.java:3801)
at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(Wo rkbenchAdvisor.java:364)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2383)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

"VM Thread" prio=10 tid=0x09575800 nid=0x5ac6 runnable

"VM Periodic Task Thread" prio=10 tid=0x095a5400 nid=0x5acc waiting on condition

JNI global references: 1383

Heap
def new generation total 12544K, used 2712K [0x97ba0000, 0x98930000, 0x98f50000)
eden space 11200K, 22% used [0x97ba0000, 0x97e0c368, 0x98690000)
from space 1344K, 17% used [0x98690000, 0x986c9e88, 0x987e0000)
to space 1344K, 0% used [0x987e0000, 0x987e0000, 0x98930000)
tenured generation total 165944K, used 108499K [0x98f50000, 0xa315e000, 0xa7ba0000)
the space 165944K, 65% used [0x98f50000, 0x9f944c30, 0x9f944e00, 0xa315e000)
compacting perm gen total 61440K, used 61366K [0xa7ba0000, 0xab7a0000, 0xb7ba0000)
the space 61440K, 99% used [0xa7ba0000, 0xab78d8d8, 0xab78da00, 0xab7a0000)
No shared spaces configured.

--------------090902010801000200050704--
Re: C/C++ indexer hangs at 0% with max CPU usage [message #227875 is a reply to message #227742] Thu, 11 December 2008 09:08 Go to previous messageGo to next message
James Blackburn is currently offline James BlackburnFriend
Messages: 36
Registered: July 2009
Member
Tarjei Knapstad wrote:
> I guess it would be interesting to see exactly what code is being parsed
> when it hangs, but again I'm not sure how to go about it. Is there a way
> that I can attach gdb to the process and get a more detailed stack trace
> from the thread that is doing the C++ parsing?

Yes it would be interesting to see what it was parsing. You can do this
by enabling debug tracing on the indexer. If you take a look at "Debug
Mode" on
http://www.eclipse.org/eclipse/platform-core/documents/3.1/d ebug.html

It tells you how to run your Eclipse with a debug '.options' file. In
there you can put:
# Reports sequence of files indexed
org.eclipse.cdt.core/debug/indexer/activity=true

which will cause the indexer to report the files being indexed.

When you find the culprit, it would be good if you could file a bug with
an example file that exhibits the problem.

Cheers,

James


For future reference, there are a bunch of other debug options which can
be enabled on the indexer:
#TRACE_ACTIVITY
org.eclipse.cdt.core/debug/indexer/activity
#TRACE_STATISTICS
org.eclipse.cdt.core/debug/indexer/statistics
#TRACE_INCLUSION_PROBLEMS
org.eclipse.cdt.core/debug/indexer/problems/inclusion
#TRACE_SCANNER_PROBLEMS
org.eclipse.cdt.core/debug/indexer/problems/scanner
#TRACE_SYNTAX_PROBLEMS
org.eclipse.cdt.core/debug/indexer/problems/syntax
#TRACE_PROBLEMS
org.eclipse.cdt.core/debug/indexer/problems



>
> Thanks,
> --
> Tarjei
>
Re: C/C++ indexer hangs at 0% with max CPU usage [message #228135 is a reply to message #227875] Wed, 17 December 2008 11:47 Go to previous message
Tarjei Knapstad is currently offline Tarjei KnapstadFriend
Messages: 6
Registered: July 2009
Junior Member
James Blackburn wrote:
> Tarjei Knapstad wrote:
>> I guess it would be interesting to see exactly what code is being
>> parsed when it hangs, but again I'm not sure how to go about it. Is
>> there a way that I can attach gdb to the process and get a more
>> detailed stack trace from the thread that is doing the C++ parsing?
>
> Yes it would be interesting to see what it was parsing. You can do this
> by enabling debug tracing on the indexer. If you take a look at "Debug
> Mode" on
> http://www.eclipse.org/eclipse/platform-core/documents/3.1/d ebug.html
>
> It tells you how to run your Eclipse with a debug '.options' file. In
> there you can put:
> # Reports sequence of files indexed
> org.eclipse.cdt.core/debug/indexer/activity=true
>
> which will cause the indexer to report the files being indexed.
>

Thanks again for the tips James. Unfortunately I'm really struggling to
produce a minimal testcase for this. After some more experimentation it
seems that it only hangs when I include files from a large in-house
library which I cannot distribute in any way. It seems to hang when
either parsing parts of the boost libraries or the standard library:

Example 1:

Indexer: unresolved name at
/usr/include/c++/4.3.2/bits/fstream.tcc(763); Attempt to use symbol
failed : seekoff

Example 2:

Indexer: unresolved name at
/usr/include/boost/tuple/detail/tuple_basic.hpp(934)
; Attempt to use symbol failed : tuple

At these files/lines the indexer just hangs.

> When you find the culprit, it would be good if you could file a bug with
> an example file that exhibits the problem.
>

I think I'll need to build CDT from CVS and add some debug statements to
the typedef resolution list in the
SemanticUtil.getUltimateTypeViaTypedefs method and see what's going on
to get to the bottom of this. (I guess there's no point in filing a bug
report until I have a way to reproduce, or maybe figure out where things
go wrong and submit a patch?).

I'll post an update once I have some more information on this.

Regards,
--
Tarjei
Previous Topic:Inline methods formatting
Next Topic:Who produce markers Scanner/Indexer
Goto Forum:
  


Current Time: Fri Apr 19 13:00:37 GMT 2024

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

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

Back to the top