Author Topic: Segmentation fault when calling code completion plugin in RC1-1  (Read 4406 times)

Offline CleverFool

  • Single posting newcomer
  • *
  • Posts: 7
I get segmentation fault every time I'm calling code completion plugin in RC1-1. It is when I go to Settings->Plugins' settings->Code completion or just press Ctrl-Space somewhere in editor Code::Blocks just crashes with "Segmentation fault when calling code completion plugin in RC1-1".

Here is what gdb says when code completion setting are called:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1230808144 (LWP 9840)]
0xb7e11cfb in wxThreadInternal::PthreadStart () from /usr/lib/libwx_gtk2-2.4.so

And backtrace:

#0  0xb7e11cfb in wxThreadInternal::PthreadStart () from /usr/lib/libwx_gtk2-2.4.so
#1  0xb7e11ecc in wxPthreadStart () from /usr/lib/libwx_gtk2-2.4.so
#2  0xb778bccd in start_thread () from /lib/tls/libpthread.so.0
#3  0xb771eb0e in clone () from /lib/tls/libc.so.6

When I disable code completion - codeblocks works without glitches, however I want code completion too:)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Segmentation fault when calling code completion plugin in RC1-1
« Reply #1 on: August 07, 2005, 04:47:50 pm »
Um, isn't there a #4 in the backtrace? I see nothing related to Code::blocks in there :?

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Segmentation fault when calling code completion plugin in RC1-1
« Reply #2 on: August 08, 2005, 03:31:39 am »
I get the same backtrace I believe.  My guess is the error has nothing to do with libc.  Like a lot of seg faults the place where it comes up is not necessarily the place where the error is caused.  For example, some random function some where could set a pointer to NULL, and then in another place you try access it, getting a segfault.  Sorry to sound like a broken record, but you should give valgrind a try.  I believe when I tried it a couple of days ago, codeblocks actually crashed valgrind before I was able to get to test that exact error.  That was with 2.3 or 2.4, the new version might do better.
« Last Edit: August 08, 2005, 03:33:30 am by Game_Ender »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Segmentation fault when calling code completion plugin in RC1-1
« Reply #3 on: August 08, 2005, 06:50:34 am »
We have to investigate more about this.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Segmentation fault when calling code completion plugin in RC1-1
« Reply #4 on: August 12, 2005, 08:50:28 am »
I realized the cause... apparently, A lot of threads get created before they can even be destroyed. This means, that in Linux, thread creation does _NOT_ obey the maximum number of threads limited.

So, in plain terms, this whole thread business has to be reengineered. What I'm going to do, is NOT deleteing the threads when they finish their job. Instead, they're moved back into the "available threads" store, so they can perform their job, without having to create new threads. I really hope this can get rid of all the codecompletion crashing.

Oh, I realized why it crashes on config. It creates sample classes by doing a "mini-parsing" stage. This triggers the problem again, and the crashes happen.
« Last Edit: August 12, 2005, 08:52:19 am by rickg22 »

Offline BEEjay

  • Single posting newcomer
  • *
  • Posts: 4
Re: Segmentation fault when calling code completion plugin in RC1-1
« Reply #5 on: August 25, 2005, 02:23:26 pm »
Hi i've the same problem too  :(. Did anyone solved this problem?


Many thx for any help.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Segmentation fault when calling code completion plugin in RC1-1
« Reply #6 on: August 25, 2005, 02:46:23 pm »
Hi i've the same problem too  :(. Did anyone solved this problem?


Many thx for any help.

Yes, it's fixed in CVS (branch VERSION_1_0).

Yiannis.
Be patient!
This bug will be fixed soon...