Author Topic: Strange crash  (Read 2335 times)

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Strange crash
« on: January 28, 2024, 07:56:45 am »
Hi,
       I finished building a small wxwidgets program this morning, and then I closed CB. After several hours(now) I reopened it to do some changes. But it crashed. And that was strange! I was just looking  through an article while CB starting, to my surprise, CB suddenly told me it crashed. Then I retried to start it, (I can ensure that I did nothing this time during CB's start) but it crashed again as soon as CB's start page appeared.
      I use CB r13426, on a Windows 7 32-bit system.
      The RPT file is attached. Any solution?

      Edit:Now I put my early backup of CB's conf file into the AppData directory, CB can work well.
« Last Edit: January 28, 2024, 08:57:39 am by Grit Clef »
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Strange crash
« Reply #1 on: January 28, 2024, 07:24:43 pm »
Glad you got it working again.

This has, on rare occasions, also happened to me. Especially when I kill CB during a debugging session.
It appears to set the .conf file in a bad condition, thereby crashing CB on any restart.
I also just restore the .conf and keep on trunkin'.

The .RPT file, in this case, is useless because I can see no way to map the crash address to the causing function.

If you are compiling CB yourself, you can:
1) Backup output32_64.
2 Copy the devel32_64 dir to output32_64 dir so that the .RPT shows the actual source line that caused the error.

Thanks for the report.
« Last Edit: January 28, 2024, 07:27:14 pm by Pecan »

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Strange crash
« Reply #2 on: January 29, 2024, 03:29:02 am »
OK, sometime I'll try to give you the debug rpt.
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Strange crash
« Reply #3 on: February 09, 2024, 08:33:34 am »
Hey Pecan!
       I've made CB crash again, with debug info! This time is, I clicked "Compile Current File" by mistake, and CB crashed after a short halt. I think this RPT file might contain the same info as CB generated that time it crashed at startup. Also, I'm always annoyed when it crashes right after I make CB compile/build some files/projects. Hope this rpt will give you much useful info.
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline Wkerry

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: Strange crash
« Reply #4 on: February 09, 2024, 09:10:20 am »
Can you reproduce the crash? If you used a debug build then the RPT is way more useful.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1563
Re: Strange crash
« Reply #5 on: February 09, 2024, 09:11:04 am »
CompilerGCC::PrepareCompileFile(wxFileName& file) checks if the editor pointer is not null, but inmediately after it uses the pointer anyway.

Code
    cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
    if (ed)
    {
        // make sure it is saved
        ed->Save();
        file.Assign(ed->GetFilename());
    }

    // Now activate the project this file belongs to
    ProjectFile* pf = ed->GetProjectFile();

I will fix this in a while. The remaining question is, why the pointer is null?

EDIT: Fixed in r13445
« Last Edit: February 09, 2024, 09:20:02 am by Miguel Gimenez »

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Strange crash
« Reply #6 on: March 10, 2024, 06:35:41 am »
Oh, no! Today I built CB r13490 myself entirely, but when I ttied to run it, it crashed at startup! Luckily, I use the one in devel32. So the RPT file may include something useful.
P.S. I tried to delete all the conf files and restart CB, but it still crashed. This new RPT file is also attached.
P.S. 2 There must be some problems with KeyBinder, because when I delete it and start CB, nothing is wrong.
« Last Edit: March 10, 2024, 06:44:23 am by Grit Clef »
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Strange crash
« Reply #7 on: March 10, 2024, 04:19:43 pm »
I just built and tested rev 13490 (cb 32_64, Win 11) but could not reproduce the problem.

I have no way of testing win 7 (cb 32).

« Last Edit: March 10, 2024, 04:21:43 pm by Pecan »

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Strange crash
« Reply #8 on: March 11, 2024, 05:31:45 am »
Oh, I seemed to do something stupid when building CB. I had set a wrong compiler setting and linked a library that isn't needed, and that error was in that module. After I removed it, CB can start correctly.
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Strange crash
« Reply #9 on: March 11, 2024, 06:05:07 am »
Oh, I seemed to do something stupid when building CB. I had set a wrong compiler setting and linked a library that isn't needed, and that error was in that module. After I removed it, CB can start correctly.

Thanks for reporting that. I'm relieved it's not a hidden error somewhere.
We all make these little mistakes. God knows I've made my share.