Author Topic: C::B enters in a "infinite loop" eating memory  (Read 8453 times)

Offline ninio_arg

  • Multiple posting newcomer
  • *
  • Posts: 12
C::B enters in a "infinite loop" eating memory
« on: December 08, 2013, 01:33:12 pm »
I am on Slackware 14.1, and have compiled C::B from its source.
I can open and use C::B normally, but the problem is when I open a .cpp file, even a simple one like a "Hello world!", C::B gets in a infinite loop "eating" all my memory. I have to kill the process because it doesn't close normally.

So, i have launched C::B from a terminal emulator to see what happens when I open a cpp file, and the output is the following:

Quote
Text seems to be pure ASCII!
We use user specified encoding: Western European (ISO-8859-1) (ID: 1)
Final encoding detected: Western European (ISO-8859-1) (ID: 1)
Conversion succeeded using wxEncodingConverter (buffer size = 482, converted size = 486.

(codeblocks:26627): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
Caching GCC default include dir: /usr/lib64/qt/include
Caching GCC default include dir: /usr/include/c++/4.8.2
Caching GCC default include dir: /usr/include/c++/4.8.2/x86_64-slackware-linux
Caching GCC default include dir: /usr/include/c++/4.8.2/backward
Caching GCC default include dir: /usr/lib64/gcc/x86_64-slackware-linux/4.8.2/include
Caching GCC default include dir: /usr/local/include
Caching GCC default include dir: /usr/lib64/gcc/x86_64-slackware-linux/4.8.2/include-fixed
Caching GCC default include dir: /usr/include
Passing list of files to batch-parser.
Header to parse with priority: '/usr/include/c++/4.8.2/cstddef'
Header to parse with priority: '/usr/include/boost/config.hpp'
Header to parse with priority: '/usr/include/boost/filesystem/config.hpp'
Add 3 priority parsing file(s) for project '*NONE*'...
No active project available.
Traversing '/mnt/data/desarrollo/Practicas/C++/C++' for: ampersand.*
Found 1 files:
- /mnt/data/desarrollo/Practicas/C++/C++/ampersand.cpp
Create new parser for project '*NONE*'
Updating class browser...
Class browser updated.
Starting batch parsing for project '*NONE*'...
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
Pool task operated?!
ReadClsNames() : Unexpected token '((__aligned__))'.
Already current parser present?!
Project '*NONE*' parsing stage done!
Project '*NONE*' parsing stage done (104 total parsed files, 3843 tokens in 0 minute(s), 0.224 seconds).
No active project available.
Traversing '/mnt/data/desarrollo/Practicas/C++/C++' for: ampersand.*
Found 1 files:
- /mnt/data/desarrollo/Practicas/C++/C++/ampersand.cpp
Updating class browser...
Class browser updated.

Any idea?  :-\

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B enters in a "infinite loop" eating memory
« Reply #1 on: December 08, 2013, 02:08:09 pm »
I think it's a bug in CodeCompletion plugin, but I don't know how to reproduce this bug(I only have WinXP), also its hard to fix.
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 ninio_arg

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B enters in a "infinite loop" eating memory
« Reply #2 on: December 09, 2013, 12:17:40 am »
Yes, you are right. I just disable the Code Completion plugin and the bug does not reproduce.

Wel... I think I have to wait for the fix. Thank you for the hint.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B enters in a "infinite loop" eating memory
« Reply #3 on: December 09, 2013, 01:52:20 am »
What version of source do you use? I search the current SVN Head source, and I can't find the text "Pool task operated?!", so I guess you are building from an old C::B source? Can you try the latest version.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C::B enters in a "infinite loop" eating memory
« Reply #4 on: December 09, 2013, 02:38:27 am »
For some record, I try to find which revision the log message (the line of code) has changed, I found that Git has the ability to Git history - find lost line by keyword, so I just type:


Code
$ git log -S"Pool task" -- src/plugins/codecompletion -- since=2011.12

And I see that it was removed in
Code
Revision: e2209f6f584b7dd0b938f954eb8e053ff6329ab3
Author: Martin Halle <*hidden*>
Date: 2012-11-27 22:48:15
Message:
* CC: optimise code by introducing a common function "AddIncludeDirsToParser" in native parser

- CC: avoid accessing negative positions in STC control in loop
- CC: some clarifications in functions
- CC: make all batch parser timer intervals defined in one place

git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@8628 2a5c6006-c6dd-42ca-98ab-0921f2732cef
----
Modified: src/plugins/codecompletion/cctest.cbp
Modified: src/plugins/codecompletion/codecompletion.cpp
Modified: src/plugins/codecompletion/nativeparser.cpp
Modified: src/plugins/codecompletion/nativeparser.h
Modified: src/plugins/codecompletion/parser/parser.cpp
Modified: src/plugins/codecompletion/parser/parserthread.cpp
Modified: src/plugins/codecompletion/testing/structs_typedefs.cpp




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 ninio_arg

  • Multiple posting newcomer
  • *
  • Posts: 12
[Solved]Re: C::B enters in a "infinite loop" eating memory
« Reply #5 on: December 23, 2013, 05:19:25 am »
Okay. I just compile the last version and there is not problem anymore.

Thank you!.