Author Topic: cb hangs and I get "Pool task operated?!" message  (Read 16357 times)

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
cb hangs and I get "Pool task operated?!" message
« on: October 24, 2013, 10:42:51 am »
When I compile my code, try to go to the implementation of a function etc. It happens a lot. I'm using version 12.11 on Ubuntu 12.04. Is this a known issue? Am I doing something wrong?

Thanks,
Erez

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #1 on: October 24, 2013, 10:47:09 am »
When I compile my code, try to go to the implementation of a function etc. It happens a lot. I'm using version 12.11 on Ubuntu 12.04. Is this a known issue? Am I doing something wrong?

Thanks,
Erez

The actual log:

Code
Scanned 0 files for #includes, cache used 0, cache updated 0
Scanned 0 files for #includes, cache used 0, cache updated 0
Scanned 0 files for #includes, cache used 0, cache updated 0
Scanned 0 files for #includes, cache used 0, cache updated 0
Scanned 0 files for #includes, cache used 0, cache updated 0
Process terminated with status 0 (0 minutes, 9 seconds)
0 errors, 1 warnings (0 minutes, 9 seconds)
Re-parsed 1 files.
Starting re-parsing for project 'erez_proj'...
Pool task operated?!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: cb hangs and I get "Pool task operated?!" message
« Reply #2 on: October 24, 2013, 10:50:15 am »
Try a night build or/and provide a simple project plus steps to reproduce the problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: cb hangs and I get "Pool task operated?!" message
« Reply #3 on: October 24, 2013, 12:07:05 pm »
When I compile my code, try to go to the implementation of a function etc. It happens a lot. I'm using version 12.11 on Ubuntu 12.04. Is this a known issue? Am I doing something wrong?

Thanks,
Erez

The actual log:

Code
Scanned 0 files for #includes, cache used 0, cache updated 0
Scanned 0 files for #includes, cache used 0, cache updated 0
Scanned 0 files for #includes, cache used 0, cache updated 0
Scanned 0 files for #includes, cache used 0, cache updated 0
Scanned 0 files for #includes, cache used 0, cache updated 0
Process terminated with status 0 (0 minutes, 9 seconds)
0 errors, 1 warnings (0 minutes, 9 seconds)
Re-parsed 1 files.
Starting re-parsing for project 'erez_proj'...
Pool task operated?!

i have my doubts that this is the build log. Please make a rebuild and post the log from the build log tab

greetings

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #4 on: October 28, 2013, 02:51:59 pm »
I'm now running with version 9423 from svn. I clicked ctrl+G (goto line). The IDE wasn't responsive for ~20 seconds and I saw the following logs in the shell where I ran cb from:

Code
[erezz@erez-lx:~/work/tmp]$ NativeParser::GetAllPathsByFilename(): Traversing 'my_src_code_dir' for: class_name.*
NativeParser::GetAllPathsByFilename(): Traversing ' - my_src_code_dir' for: class_name.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- my_src_code_dir/src/class_name.c
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
Re-parsed 1 files.
NativeParser::OnParserStart(): Starting re-parsing for project 'my_proj'...
Project 'my_proj' parsing stage done (1040 total parsed files, 31247 tokens in 0 minute(s), 0.023 seconds).
NativeParser::GetAllPathsByFilename(): Traversing 'my_src_code_dir/src' for: class_name.*
NativeParser::GetAllPathsByFilename(): Traversing ' - my_src_code_dir' for: class_name.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- my_src_code_dir/src/class_name.c
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #5 on: October 28, 2013, 02:53:56 pm »
I'm now running with version 9423 from svn. I clicked ctrl+G (goto line). The IDE wasn't responsive for ~20 seconds and I saw the following logs in the shell where I ran cb from:

Code
[erezz@erez-lx:~/work/tmp]$ NativeParser::GetAllPathsByFilename(): Traversing 'my_src_code_dir' for: class_name.*
NativeParser::GetAllPathsByFilename(): Traversing ' - my_src_code_dir' for: class_name.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- my_src_code_dir/src/class_name.c
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
Re-parsed 1 files.
NativeParser::OnParserStart(): Starting re-parsing for project 'my_proj'...
Project 'my_proj' parsing stage done (1040 total parsed files, 31247 tokens in 0 minute(s), 0.023 seconds).
NativeParser::GetAllPathsByFilename(): Traversing 'my_src_code_dir/src' for: class_name.*
NativeParser::GetAllPathsByFilename(): Traversing ' - my_src_code_dir' for: class_name.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- my_src_code_dir/src/class_name.c
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.

Of course, I can't upload my project to the forum. I hope that the logs above can help.

Erez

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #6 on: October 28, 2013, 03:00:30 pm »
I'm now running with version 9423 from svn. I clicked ctrl+G (goto line). The IDE wasn't responsive for ~20 seconds and I saw the following logs in the shell where I ran cb from:

Code
[erezz@erez-lx:~/work/tmp]$ NativeParser::GetAllPathsByFilename(): Traversing 'my_src_code_dir' for: class_name.*
NativeParser::GetAllPathsByFilename(): Traversing ' - my_src_code_dir' for: class_name.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- my_src_code_dir/src/class_name.c
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
Re-parsed 1 files.
NativeParser::OnParserStart(): Starting re-parsing for project 'my_proj'...
Project 'my_proj' parsing stage done (1040 total parsed files, 31247 tokens in 0 minute(s), 0.023 seconds).
NativeParser::GetAllPathsByFilename(): Traversing 'my_src_code_dir/src' for: class_name.*
NativeParser::GetAllPathsByFilename(): Traversing ' - my_src_code_dir' for: class_name.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- my_src_code_dir/src/class_name.c
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.

And one more note - cb spends its time (those ~20 seconds) between the  "Starting re-parsing" log message and the "parsing stage done" message. I hope it helps.

Erez

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: cb hangs and I get "Pool task operated?!" message
« Reply #7 on: October 28, 2013, 03:36:00 pm »
@erezz, thanks for the report.
Can you tell me how to reproduce this? I need a project to test this bug. :)
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 erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #8 on: October 28, 2013, 03:47:23 pm »
@erezz, thanks for the report.
Can you tell me how to reproduce this? I need a project to test this bug. :)

In my env, it happens every time I click ctrl+G. I guess that other users did not encounter this bug, so it's probably related to my specific project (which I can't share) + my home directory (which is mounted and is actually located on another server).

If you want to debug what happens between the  "Starting re-parsing" log message and the "parsing stage done" message, you can add more specific logs (between those 2 messages) and upload a debug version that I can run.

Erez

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: cb hangs and I get "Pool task operated?!" message
« Reply #9 on: October 28, 2013, 03:52:59 pm »
In my env, it happens every time I click ctrl+G. I guess that other users did not encounter this bug, so it's probably related to my specific project (which I can't share) + my home directory (which is mounted and is actually located on another server).

If you want to debug what happens between the  "Starting re-parsing" log message and the "parsing stage done" message, you can add more specific logs (between those 2 messages) and upload a debug version that I can run.
If you want to see more logs, you can simply enable the debug macro in plugins\codecompletion\nativeparser.cpp
By change:
#define CC_NATIVEPARSER_DEBUG_OUTPUT 0
to
#define CC_NATIVEPARSER_DEBUG_OUTPUT 1

Then you will see a lot of log message in Code::Blocks Debug log.
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 erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #10 on: October 28, 2013, 04:35:51 pm »
In my env, it happens every time I click ctrl+G. I guess that other users did not encounter this bug, so it's probably related to my specific project (which I can't share) + my home directory (which is mounted and is actually located on another server).

If you want to debug what happens between the  "Starting re-parsing" log message and the "parsing stage done" message, you can add more specific logs (between those 2 messages) and upload a debug version that I can run.
If you want to see more logs, you can simply enable the debug macro in plugins\codecompletion\nativeparser.cpp
By change:
#define CC_NATIVEPARSER_DEBUG_OUTPUT 0
to
#define CC_NATIVEPARSER_DEBUG_OUTPUT 1

Then you will see a lot of log message in Code::Blocks Debug log.


Recompiled cb with this flag set, and now everything works well... If it happens again, I will send a report.

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #11 on: October 28, 2013, 05:21:59 pm »
Found a scenario in which cb hangs for ~30 seconds: I go to management->symbols and select view = "current file's symbols". cb freezes and when it's back I got this error:

Code
** (codeblocks:10221): CRITICAL **: murrine_style_draw_flat_box: assertion `width >= -1' failed

Then, I moved to other c files in the project. cb freezes again, I don't see any logs and when it's back, I see logs that looks OK:

Code
[erezz@erez-lx:~/work/tmp]$ NativeParser::GetAllPathsByFilename(): Enter
NativeParser::GetAllPathsByFilename(): Traversing 'my_proj/include' for: myfile.*
NativeParser::GetAllPathsByFilename(): Traversing ' - my_proj' for: myfile.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- my_proj/include/myfile.h
NativeParser::GetAllPathsByFilename(): Leave
NativeParser::Done(): true
NativeParser::GetProjectByFilename(): /tmp/somefile.c
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::Done(): true
NativeParser::GetProjectByFilename(): /tmp/somefile.c
NativeParser::Done(): true
NativeParser::GetProjectByFilename(): /tmp/somefile.c

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: cb hangs and I get "Pool task operated?!" message
« Reply #12 on: October 29, 2013, 03:24:08 am »
In my env, it happens every time I click ctrl+G. I guess that other users did not encounter this bug, so it's probably related to my specific project (which I can't share) + my home directory (which is mounted and is actually located on another server).
I guess this is the cause of the your lag issue.
There are some traverser in CC's code, which search the folder for some specified file names.
Code
dir.Traverse(traverser, filespec, wxDIR_FILES);
But in your case, all the file are in-fact in another computer, which can take several seconds to do the traversing.
Can you try to test the project if you put them in your own computer (not remote server).
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 erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #13 on: October 29, 2013, 07:48:51 am »
In my env, it happens every time I click ctrl+G. I guess that other users did not encounter this bug, so it's probably related to my specific project (which I can't share) + my home directory (which is mounted and is actually located on another server).
I guess this is the cause of the your lag issue.
There are some traverser in CC's code, which search the folder for some specified file names.
Code
dir.Traverse(traverser, filespec, wxDIR_FILES);
But in your case, all the file are in-fact in another computer, which can take several seconds to do the traversing.
Can you try to test the project if you put them in your own computer (not remote server).

I tested the same project on my local machine and it works very well. Still, I need to work on my mounted home directory... Our internal network is fast enough, so it's not a bottleneck. Any chance for a fix for this problem?

Thanks,
Erez

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #14 on: October 30, 2013, 09:10:48 am »
In my env, it happens every time I click ctrl+G. I guess that other users did not encounter this bug, so it's probably related to my specific project (which I can't share) + my home directory (which is mounted and is actually located on another server).
I guess this is the cause of the your lag issue.
There are some traverser in CC's code, which search the folder for some specified file names.
Code
dir.Traverse(traverser, filespec, wxDIR_FILES);
But in your case, all the file are in-fact in another computer, which can take several seconds to do the traversing.
Can you try to test the project if you put them in your own computer (not remote server).

I tested the same project on my local machine and it works very well. Still, I need to work on my mounted home directory... Our internal network is fast enough, so it's not a bottleneck. Any chance for a fix for this problem?

BTW - I went over my project to see how many files it contains:

Code
[erezz@erez-lx:~/myproj]$ find . -name *.c | wc -l
521
[erezz@erez-lx:~/myproj]$ find . -name *.h | wc -l
395
[erezz@erez-lx:~/myproj]$ find . -name *.py | wc -l
681
[erezz@erez-lx:~/myproj]$ find . -name *.sh | wc -l
81
[erezz@erez-lx:~/myproj]$ find . -name Makefile | wc -l
27

which is a total of 1705 files. It sounds strange to me that going over 1705 files takes ~30 seconds, even if it's on a network fs.

Erez

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: cb hangs and I get "Pool task operated?!" message
« Reply #15 on: October 30, 2013, 11:48:25 am »
which is a total of 1705 files. It sounds strange to me that going over 1705 files takes ~30 seconds, even if it's on a network fs.
Probably you can strace codeblocks to see what going on and where it is slow.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: cb hangs and I get "Pool task operated?!" message
« Reply #16 on: October 30, 2013, 11:50:46 am »
The network I/O is very slow even on fast networks, especially on windows shares (my experience from windows to windows and even worse from linux to windows).

For the statistics, we have fantastic plugin in contrib-plugins. Just open "Plugins -> Code statistics".

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: cb hangs and I get "Pool task operated?!" message
« Reply #17 on: October 30, 2013, 11:52:57 am »
By the way: one real evil thing is that C::B always looks for changed files, if it regains focus.
That can be really slow on network shares if you have multiple files open.

If I find the time, I will add a (per project) option, that can switch this off.
« Last Edit: October 30, 2013, 11:58:31 am by jens »

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #18 on: October 30, 2013, 02:48:12 pm »
I ran c::b with strace and I saw that stat64() gets called for files that are not included in my project. My project is located in ~/dir1/dir2/myproj. I see that stat64() gets called for files in ~/dir1/dir2/otherproj. Unfortunately, otherproj is huge, so it may take time to go over all its files.

Am I doing something wrong? Is it something in my project configuration?

Thanks,
Erez

Offline erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #19 on: October 30, 2013, 03:13:02 pm »
I ran c::b with strace and I saw that stat64() gets called for files that are not included in my project. My project is located in ~/dir1/dir2/myproj. I see that stat64() gets called for files in ~/dir1/dir2/otherproj. Unfortunately, otherproj is huge, so it may take time to go over all its files.

Am I doing something wrong? Is it something in my project configuration?

Thanks,
Erez

One more thing - the c::b project (i.e. bmarks, cbp & layout files) is located at ~/dir1/dir2/codeblocks_proj/proj_name.

Erez

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: cb hangs and I get "Pool task operated?!" message
« Reply #20 on: October 31, 2013, 04:16:03 pm »
1, I see there is not text "Pool task operated?!" in current CodeCompletion plugin's source code, so I think this log message has changed after C::B 12.11.


2,
Quote
My project is located in ~/dir1/dir2/myproj. I see that stat64() gets called for files in ~/dir1/dir2/otherproj. Unfortunately, otherproj is huge, so it may take time to go over all its files.
Maybe The cbp file in ~/dir1/dir2/myproj folder contains some files/reference to ~/dir1/dir2/otherproj. (This is only a guess)
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 erezz

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: cb hangs and I get "Pool task operated?!" message
« Reply #21 on: November 03, 2013, 11:04:38 am »
I moved the c::b project into the dir that contains the project src code, and now it seems to work. Still, I think that c::b should scan only files that belong to the project.

Erez

Offline yaoyansi

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: cb hangs and I get "Pool task operated?!" message
« Reply #22 on: January 27, 2015, 08:35:31 am »
It seems that we have the same problem. My C::B freezes either, and my home directory has 396 sub-directories. Here is my post
http://forums.codeblocks.org/index.php/topic,19936.msg136142.html#msg136142

Finally, I find a temp solution to walk around this problem. The solution is to modify all of the absolute source file paths to relative file paths in the *.cbp file manually. But I'm not satisfied with this temp solution at all, because I have to change the *.cbp file which is generated by CMake.
http://forums.codeblocks.org/index.php/topic,19936.msg136145.html#msg136145

Did you solve this problem with a better solution?

Cheers

Offline yaoyansi

  • Multiple posting newcomer
  • *
  • Posts: 31