Author Topic: Switch to this thread crashes  (Read 4256 times)

Multinode Nick

  • Guest
Switch to this thread crashes
« on: November 02, 2006, 09:54:24 pm »
Hi,

It's my first Code Blocks day, it seems to be a really promising IDE so I'm testing it every way I can to be sure to choose a best IDE for my development team and I for the next years.

I think I just felt on an application bug by trying basic multithread functions.

I coded a simple thread function in a Win32 project:

DWORD WINAPI CommunicationFct(LPVOID param)
{
    int i =0;
    while(1)
    {
        i++;
        Sleep(100);
    }
    return 0;
}


I create 4 threads with these calls:

CreateThread(NULL,0,CommunicationFct,NULL,0,&dThreadID);
CreateThread(NULL,0,CommunicationFct,NULL,0,&dThreadID);
CreateThread(NULL,0,CommunicationFct,NULL,0,&dThreadID);
CreateThread(NULL,0,CommunicationFct,NULL,0,&dThreadID);


The software works fine and in debugging mode, the 4 threads appear in the "Running Threads" debug window.

But if I stop debugging, the threads are still available in the GUI and if I click on "Switch to this Thread", the whole IDE crashes. Not a really bad bug, but a bug and possibly easy to fix.

Should I report it to the official Bug reporting services?

Thanks

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Switch to this thread crashes
« Reply #1 on: November 02, 2006, 11:14:44 pm »
Confirmed. This is the back trace (rev. 3155).
Will have a look into... the expert should be mandrav.
With regards, Morten.

Edit: Reason is access to a NULL object (m_pDbg->GetState().GetDriver() returns NULL because the driver isn't active anymore). Will fix the crash, but the listbox shouldn't have content at that time... mandrav?

Edit2: Fixed in revision 3173.

[attachment deleted by admin]
« Last Edit: November 02, 2006, 11:37:02 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Switch to this thread crashes
« Reply #2 on: November 03, 2006, 09:06:08 am »
Quote
but the listbox shouldn't have content at that time... mandrav?

Yes, all debugging windows should be cleared when the debugging session ends.
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Switch to this thread crashes
« Reply #3 on: November 04, 2006, 08:35:36 am »
Yes, all debugging windows should be cleared when the debugging session ends.
Ok - I had a look into it. I implemented cleaning all debugging windows in the destructor of DebuggerDriver::~DebuggerDriver(). But then I realised that this would also clear the backtrace (BacktraceDlg) which makes no sense. So I took that off. Then I realised that it may make sense to keep the DisassemblyDlg, too. After that came the ExamineMemoryDlg, CPURegistersDlg... in the end I think it is OK just as it is because this might still be valuable information even if the debugger has stopped. It just shouldn't crash when "clicking on it".
Yiannis: Do you agree?
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Switch to this thread crashes
« Reply #4 on: November 04, 2006, 09:18:45 am »
Quote
Yiannis: Do you agree?

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