Author Topic: IncrementalSearch crash  (Read 4434 times)

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
IncrementalSearch crash
« on: October 19, 2008, 01:30:09 am »
If I type something in the textbox of the IncrementalSearch toolbar and press enter it crashes C::B.  I'm running svn 5275 compiled with TDM GCC running on XP Pro SP2.

edit: It's due to the fact that the textbox is initially enabled when it perhaps it shouldn't be (i.e. when there is no open file).
« Last Edit: October 19, 2008, 01:32:55 am by ironhead »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: IncrementalSearch crash
« Reply #1 on: October 19, 2008, 10:37:39 am »
If I type something in the textbox of the IncrementalSearch toolbar and press enter it crashes C::B.  I'm running svn 5275 compiled with TDM GCC running on XP Pro SP2.

edit: It's due to the fact that the textbox is initially enabled when it perhaps it shouldn't be (i.e. when there is no open file).
It should not be enabled, when no file is open.

And on my systems (linux, w2k and xp) it is not.

Do you have a crash-report ("codeblocks.rpt") in the directory, where the C::B executable is ?
If yes it would be nice if you attach it, or send it to me via PM or mail.

If it's very large, there are most likely other (older) crashes included. I need only the actual crash (with IncSearch).

What I can do is put guards inside the functions that use the textcontrol, but there should be no need for it, because they normally can't be reached if there is no file open, because the textcontrol (and and the left and right arrows) should be disabled.

It would be nice, if you could put the followin line into "IncrementalSearch::OnEditorEvent(CodeBlocksEvent& event)" [line 187]:
Code
    Manager::Get()->GetLogManager()->Log(F(_("IncrementalSearch::OnEditorEvent(), m_pControl = 0x%x"),m_pControl));
directly below
Code
    m_pControl = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor() ? Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor()->GetControl() : 0;

and post the appropriate output of the "Code::Blocks" logger-panel, directly after starting C::B and after opening a file and closing all files.

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: IncrementalSearch crash
« Reply #2 on: October 19, 2008, 03:03:16 pm »
I added the line you requested:

Code
    m_pControl = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor() ? Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor()->GetControl() : 0;
    Manager::Get()->GetLogManager()->Log(F(_("IncrementalSearch::OnEditorEvent(), m_pControl = 0x%x"),m_pControl));    m_pTextCtrl->Enable(m_pControl != 0);
    wxMenuBar* mbar = Manager::Get()->GetAppFrame()->GetMenuBar();

But nothing was displayed in the Code::Blocks logger-panel until I opened an editor.  The behaviour I'm seeing is that the textbox is enabled by default when I start Code::Blocks without any open project / workspace (which is how I have C::B configured).

I've attached a clean codeblocks.RPT file for your reference, let me know if there is anything else I can do to assist with the debugging.


[attachment deleted by admin]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: IncrementalSearch crash
« Reply #3 on: October 19, 2008, 03:35:31 pm »
But nothing was displayed in the Code::Blocks logger-panel until I opened an editor.  The behaviour I'm seeing is that the textbox is enabled by default when I start Code::Blocks without any open project / workspace (which is how I have C::B configured).

You don't have the "start here"-page visible at start-up, right?

Then it crashes indeed, I always have it closed, but that is easy to fix, thanks for reporting it.

I will commit a fix (and some more changes) later this afternoon.

Sorry, for the inconvenience.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: IncrementalSearch crash
« Reply #4 on: October 19, 2008, 09:25:59 pm »
Should be fixed in trunk (r5277) some other changes are included. See here: http://forums.codeblocks.org/index.php/topic,9289.msg66770.html#msg66770

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: IncrementalSearch crash
« Reply #5 on: October 19, 2008, 11:17:15 pm »
You are correct, I have the "Start Here" page disabled.  Thanx for the quick fix!