Author Topic: CC parser hangs/fails  (Read 10200 times)

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
CC parser hangs/fails
« on: December 15, 2012, 12:21:34 am »
Rev 8663 on Windows appears to fail to start the CC parser.  It logs that a new parser has been created, then CPU usage drops to zero.  Requesting tooltip/completion results in the still-parsing message.  If I try to close the project (or Code::Blocks), the program stops responding.
I tried inspecting the threads/stack by debugging Code::Blocks with Code::Blocks, but my unskilled eyes were unable to find anything related.  Also, inspection of recent commits did not reveal anything that should be related to the parser.

Ideas?
« Last Edit: December 15, 2012, 12:44:02 am by Alpha »

Online ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5216
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CC parser hangs/fails
« Reply #1 on: December 15, 2012, 07:17:04 am »
What steps did you try to let CC hang. For my experience, sometimes, CC will hang, but it's hard to find a reproduce way. :P
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9488
Re: CC parser hangs/fails
« Reply #2 on: December 15, 2012, 08:52:34 am »
...what do you see in the debug log if you try to cc anything? Usually there is written in what stage the parser is and why it does not continue.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: CC parser hangs/fails
« Reply #3 on: December 15, 2012, 04:27:43 pm »
Steps:
  • Launch Code::Blocks
  • Open CodeBlocks.cbp (the problem starts here every time, but it also has the same problem if I open my own simpler projects)

The last part of the debug log says:
Code: [Select]
Caching GCC default include dir: C:\libraries\MinGW\lib\gcc\mingw32\4.7.1\include\c++
Caching GCC default include dir: C:\libraries\MinGW\lib\gcc\mingw32\4.7.1\include\c++\mingw32
Caching GCC default include dir: C:\libraries\MinGW\lib\gcc\mingw32\4.7.1\include\c++\backward
Caching GCC default include dir: C:\libraries\MinGW\lib\gcc\mingw32\4.7.1\include
Caching GCC default include dir: C:\libraries\MinGW\include
Caching GCC default include dir: C:\libraries\MinGW\lib\gcc\mingw32\4.7.1\include-fixed
Passing list of files to batch-parser.
Header to parse with priority: 'C:\libraries\MinGW\lib\gcc\mingw32\4.7.1\include\c++\cstddef'
Header to parse with priority: 'C:\libraries\MinGW\include\w32api.h'
Header to parse with priority: 'C:\Libraries\wxMSW-2.8.12\include\wx\defs.h'
Header to parse with priority: 'C:\Libraries\wxMSW-2.8.12\include\wx\dlimpexp.h'
Header to parse with priority: 'C:\Libraries\wxMSW-2.8.12\include\wx\toplevel.h'
Header to parse with priority: 'C:\Libraries\cb_patch\src\include\sdk.h'
Add 6 priority parsing file(s) for project 'Code::Blocks wx2.8.x'...
Added 808 file(s) for project 'Code::Blocks wx2.8.x' to batch-parser...
No active project available.
Create new parser for project 'Code::Blocks wx2.8.x'
Updating class browser...
Class browser updated.
Starting batch parsing for project 'Code::Blocks wx2.8.x'...

If I request a tooltip, it says:
Code: [Select]
The Parser is still parsing files. > Reasons:
- still priority headers to parse
- still system priority headers to parse
- still batch parse files to parse
- still pre-defined macros to operate
- still need to mark files as local
- thread pool is not done yet

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9488
Re: CC parser hangs/fails
« Reply #4 on: December 16, 2012, 07:47:15 am »
Steps:
  • Launch Code::Blocks
  • Open CodeBlocks.cbp (the problem starts here every time, but it also has the same problem if I open my own simpler projects)
Well this is what I do nearly every day and it just works...?! ???
Do you have done something special? Why, if you remove the targets step-by-step? This may lead to the target and therefore file which may fail. Do you have CC patches applied from 3rd party sources that could cause this? Try a C::B build with a clean CC from SVN trunk.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: CC parser hangs/fails
« Reply #5 on: December 16, 2012, 04:52:59 pm »
Well this is what I do nearly every day and it just works...?! ???
I know ???... my thoughts exactly.  I was very surprised when it started.

Do you have done something special? Why, if you remove the targets step-by-step? This may lead to the target and therefore file which may fail. Do you have CC patches applied from 3rd party sources that could cause this? Try a C::B build with a clean CC from SVN trunk.
This is from completely vanilla source, so no changes there.  It just occurred to me that I have not tried a full rebuild recently.  Will report back if that works, or I discover anything else.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: CC parser hangs/fails
« Reply #6 on: December 16, 2012, 06:45:46 pm »
It just occurred to me that I have not tried a full rebuild recently.
Still not sure what caused the problem, but after a full rebuild, everything functions normally again.

Apologies for the noise.