Author Topic: Strange crash  (Read 4885 times)

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 69
  • 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 r13531, gcc 14.1.0, debug version

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2791
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: 69
  • 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 r13531, gcc 14.1.0, debug version

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 69
  • 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 r13531, gcc 14.1.0, debug version

Offline Wkerry

  • Multiple posting newcomer
  • *
  • Posts: 50
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: 1601
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: 69
  • 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 r13531, gcc 14.1.0, debug version

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2791
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: 69
  • 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 r13531, gcc 14.1.0, debug version

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2791
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.

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 69
  • Where there is a will, there is a way.
Re: Strange crash
« Reply #10 on: June 08, 2024, 02:13:57 pm »
Hi,
    This time I want to update my CB build from 13518 to 13525. When I was building CB's core, I suddenly found that CB crashed again when it started to build the target 'AStyle'. The RPT file with debug info is attached, hope it works for you devs!
-Windows 7, 32-bit
-CodeBlocks r13531, gcc 14.1.0, debug version

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7626
    • My Best Post
Re: Strange crash
« Reply #11 on: June 08, 2024, 03:38:43 pm »
Grit Clef: What exactly is the compiler you are using? If my old Windows 7 64 bit laptop works still I will try to duplicate the problem.
I am guessing the Compiler might be the cause; so, I wish to test with the exact compiler build you are using.

Tim S.
« Last Edit: June 08, 2024, 11:07:44 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 69
  • Where there is a will, there is a way.
Re: Strange crash
« Reply #12 on: June 09, 2024, 03:02:56 am »
stahta01: GCC 13.2.0 from MSYS2, I'm using the mingw32 port. (I've found that MSYS2 has 32-bit versions once, but it's stopped supporting 32-bit systems since 2021.)
It's very kind of you to try building it! But it's not very easy to reproduce the problem, since it doesn't appear very often.
« Last Edit: June 09, 2024, 05:03:39 am by Grit Clef »
-Windows 7, 32-bit
-CodeBlocks r13531, gcc 14.1.0, debug version

Offline nenin

  • Almost regular
  • **
  • Posts: 227
Re: Strange crash
« Reply #13 on: June 09, 2024, 10:33:21 am »
stahta01: GCC 13.2.0 from MSYS2,
I suggest to try i686 builds from WinLibs or niXman. Also you probably need to care about Mingw-w64 version. I have some fresh experience with WinXP, key issues was to find relatively fresh compiler with XP-compatible  Mingw-w64. The same story may be with Win7 32b. 

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 69
  • Where there is a will, there is a way.
Re: Strange crash
« Reply #14 on: June 09, 2024, 11:07:19 am »
I will try other mingw-w64 versions; I've used winlibs' and nixman's build of version 13 before, they also  have the similar problems and, even other problems like -pipe errors. Maybe I should change the compiler's version.
-Windows 7, 32-bit
-CodeBlocks r13531, gcc 14.1.0, debug version