Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: erezz on October 24, 2013, 10:42:51 am

Title: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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?!
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: oBFusCATed on October 24, 2013, 10:50:15 am
Try a night build or/and provide a simple project plus steps to reproduce the problem.
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: BlueHazzard 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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.
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: ollydbg 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. :)
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: ollydbg 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.
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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.
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: ollydbg 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).
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: oBFusCATed 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.
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: Jenna 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".
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: Jenna 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.
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: ollydbg 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)
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: erezz 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
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: yaoyansi 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 (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 (http://forums.codeblocks.org/index.php/topic,19936.msg136145.html#msg136145)

Did you solve this problem with a better solution?

Cheers
Title: Re: cb hangs and I get "Pool task operated?!" message
Post by: yaoyansi on January 27, 2015, 10:29:57 am
Solved. here is it
http://forums.codeblocks.org/index.php/topic,19936.msg136151.html#msg136151 (http://forums.codeblocks.org/index.php/topic,19936.msg136151.html#msg136151)