Author Topic: top on linux shows codeblocks not terminating after program shutdown  (Read 6680 times)

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Hello everybody,

I'm using the svn build 6911 on a SuSE 11.1 x86_64 linux sistem with double processor.

I experience the strange behavior that after closing the program without any errors or misbehavior the process does not get terminated. After each execution and shutdown of  codeblocks one process is added. Using the top command I ended up having four running processes labeled codeblocks, each using around 50% CPU time and around 10% of memory. They can be killed without problem.

My configuration of c::b is set to allow for various instances of c::b running at a time and not allowing an already existing instance to be used. Compiler is set to use 3 threads.

The above mentioned behavior does not effect the functioning of the program itself, it only uses up resources.

Regards and greetings from Asturias

frithjofh
« Last Edit: January 09, 2011, 01:58:24 pm by nausea »
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: top on linux shows codeblocks not terminating after program shutdown
« Reply #1 on: January 09, 2011, 02:18:22 pm »
Attach with gdb and print the backtrace...

If it isn't meaningful recompile C::B with debug info and repeat.
(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 frithjofh

  • Regular
  • ***
  • Posts: 376
Re: top on linux shows codeblocks not terminating after program shutdown
« Reply #2 on: January 09, 2011, 02:57:42 pm »
OK, here is what I could do ...

First I started c::b, then I started gdb in a terminal and attached the running c::b through it's PID.

Then I loaded the symbol-file and continued execution.

I then terminated c::b from within c::b and killed the remaining phantom process from another terminal.

Copied the output into the attached file.

I never did this before, so please be forgiving ... I just did a very brief brute force brain input on a gdb online manual ...

The used wxWidgets installation is "out of the box", that is I did not compile it myself. What information do I get from that output? Do the last lines point to some error in wxPropGrid?
« Last Edit: January 09, 2011, 03:01:50 pm by nausea »
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: top on linux shows codeblocks not terminating after program shutdown
« Reply #3 on: January 09, 2011, 03:36:17 pm »
I then terminated c::b from within c::b and killed the remaining phantom process from another terminal.
This is wrong, when you close C::B, goto the terminal with gdb and hit CTRL+C.
This breaks the process at its current position, then execute the bt command (look in the manual for the full version, which prints all threads).
(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: top on linux shows codeblocks not terminating after program shutdown
« Reply #4 on: January 09, 2011, 03:50:54 pm »
I can see it also sometimes, but I use experimental packages of debian and I guess it's related.

It never happened to me with KDE, only on gnome.
It seems to be a deadlock in thread-handling, because the processes remain in status "futex_wait_queue_me" (seen with gnomes process-monitor).

At the moment it does not happen (as far as I see).
wxWidgets 2.8.10
libgtk2.0 2.23.3
libglib2.0 2.27.5

As far as I remember it does only happen if codecompletion- and compiler-plugin are enabled. If one of them is disabled it does not happen.

If build with wxWidgets debug-version, it tells me, that 4 threads are not terminated by C::B itself, and that wxWidgets has to kill them.
The four threads are the FileManager background threads (fileLoaderThread, uncLoaderThread, urlLoaderThread, delayedDeleteThread) and this is most likely not related to the deadlock.

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: top on linux shows codeblocks not terminating after program shutdown
« Reply #5 on: January 09, 2011, 04:02:32 pm »
I have this all the time. I use wxWidgets 2.8.10 and KDE 3.5.10 release 21.13.1. Codecompletion and compiler plug are enabled.
« Last Edit: January 09, 2011, 04:09:24 pm by nausea »
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: top on linux shows codeblocks not terminating after program shutdown
« Reply #6 on: January 09, 2011, 04:07:38 pm »
OK here is the backtrace:

1) atached gdb to running c::b
2) loaded symbol-file
3) cont

4) closed c::b
5) CTRL+C on gdb session
6) bt on gdb session
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: top on linux shows codeblocks not terminating after program shutdown
« Reply #7 on: January 09, 2011, 04:08:31 pm »
I have this all the time. I use wxWidgets 2.8.10 and KDE 3.5.10 release 21.13.1
I only tested it with kde4.x .
ANd it seems to be gone after an update of libglib or libgtk (if I remember correctly it was the first).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: top on linux shows codeblocks not terminating after program shutdown
« Reply #8 on: January 09, 2011, 04:14:22 pm »
Did you type CTRL+C after you tried to close C::B and it hangs ?
Can you try a bt full instead of just bt ?

If you use self-compiled C::B: did you remove all remaining libs, object files and pch's after we have moved wxPropgrid from wxSmith into core ?

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: top on linux shows codeblocks not terminating after program shutdown
« Reply #9 on: January 09, 2011, 05:26:41 pm »
First I closed c::b. The program window closes alright. Remains a process shown by top. Then I typed CTRL+C in gdb console.

I attach backtrace generated with bt full typed in gdb console after CTRL+C.

I do a cleanup ever once in a while. When was wxPropGrid included into wxSmith core? At which svn stage?
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: top on linux shows codeblocks not terminating after program shutdown
« Reply #10 on: January 09, 2011, 07:48:24 pm »
Erased c::b directory, made a new checkout of svn, recompiled everything and the problem is gone.

Thanks for the help. I think it was the the moving of wxPropGrid into wxSmith core which wasn't cleanly reflected in my installation.

Thanks and regards

frithjofh
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100