Author Topic: CB trunk wxCHECK_RET failures with allot of the sdk resources  (Read 8018 times)

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Let me start with I have no experience with wxSmith.

I am trying to add new compiler settings files for MSYS2 and other compilers to make it easier for Windows user to use CB. I have added two sets of new compiler & options files that show up in the initial CB startup "Compilers auto-detection" dialog successfully along with all of the other huge number compilers that I do not have. As the list is huge I was thinking I would see about adding a checkbox to show all the compiler or only the detected so to make the compiler list more useful.

But I get an wxCHECK_RET failure in the wxWidget src\common\wincmn.cpp file on line 2490 when loading the auto_detect_compiler.xrc. Continue works. The wxWidget function that the assert is in is:
Code
void wxWindowBase::SetContainingSizer(wxSizer* sizer)
{
    // Adding a window to another sizer if it's already managed by one would
    // result in crashes later because one of the two sizers won't be notified
    // about the window destruction and so will use a dangling pointer when it
    // is destroyed itself. As such problems are hard to debug, don't allow
    // them to happen in the first place.
    if ( sizer )
    {
        // This would be caught by the check below too, but give a more clear
        // error message in this case.
        wxASSERT_MSG( m_containingSizer != sizer,
                      wxS("Adding a window to the same sizer twice?") );

        wxCHECK_RET( !m_containingSizer,
                     wxS("Adding a window already in a sizer, detach it first!") );
    }

    m_containingSizer = sizer;
}


The wxWidget SetContainingSizer() function code was last changed 6 years ago.
The auto_detect_compiler.xrc file was also last changed 6 years ago.

As I have no experience with wxSmith is this an issue where the xrc needs to be updated to meet the wxwidget requirement or is it a wxwidget issue?

BTW:
1) Allot of the other XRC files also have the same issue.
2) I also get crashes in CB when I load some of the XRC files in CB built with MSYS2, but the last nightly build loads the XRC file, which based on the two other issues with MSYS2 lately I need to investigate to find the bug.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: CB trunk wxCHECK_RET failures with allot of the sdk resources
« Reply #1 on: June 28, 2021, 07:48:06 am »
Quote
But I get an wxCHECK_RET failure in the wxWidget src\common\wincmn.cpp file on line 2490 when loading the auto_detect_compiler.xrc
Loading in wxSmith, or during codeblocks startup?

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: CB trunk wxCHECK_RET failures with allot of the sdk resources
« Reply #2 on: June 28, 2021, 10:03:13 am »
Loading into wxSmith and then on when I change anything in wxsmith..... grrrrr....

I have looked at the XRC and could not see what the issue is, but I am not familiar with so I could have missed something.  I will need to fix it soon as I am starting to get annoyed at it and I do not like to tell the assert pop ups to not show as it hides errors and bugs, but once I finish wiring up the radio controls ( it looks nicer for what I am doing than a checkbox) to a function I will be over it and have to fix it before I then use the control to do any filtering and display updates.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: CB trunk wxCHECK_RET failures with allot of the sdk resources
« Reply #3 on: June 28, 2021, 02:57:37 pm »
The annoying thing with wxWidgets > 3 is, that it is quite penetrant with error messages, when some UI structure is wrong. This is quite annoying if you edit the UI in real time like in wxSmith...

Obfuscated had quite a discussion with the devs of wxWidgets on the mailing list regarding this problem. I do not remember if they settled to a solution....

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB trunk wxCHECK_RET failures with allot of the sdk resources
« Reply #4 on: June 29, 2021, 12:00:29 am »
There is an env var now (in wx-master) or a call to disable some of the warnings/asserts.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB trunk wxCHECK_RET failures with allot of the sdk resources
« Reply #5 on: June 29, 2021, 12:04:24 am »
As the list is huge I was thinking I would see about adding a checkbox to show all the compiler or only the detected so to make the compiler list more useful.
Which list?
If I remember correctly the detected compilers are sorted on top. Adding a checkbox for this would complicate things for little benefit.

But I get an wxCHECK_RET failure in the wxWidget src\common\wincmn.cpp file on line 2490 when loading the auto_detect_compiler.xrc. Continue works. The wxWidget function that the assert is
Which wx version are you using? If it is triggered by wxSmith it is probably a bug (either in C::B or wx).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: CB trunk wxCHECK_RET failures with allot of the sdk resources
« Reply #6 on: June 29, 2021, 01:42:53 am »
I have tracked the symptom down to the use of <object class="wxStdDialogButtonSizer">, which if I replace it it with <object class="wxBoxSizer"> and make other appropriate changes to for the sizer change. The wxStdDialogButtonSizer is used where dialogs have a "Cancel" or "Ok" or both at the bottom of the dialog.

I now need to investigate the wxStdDialogButtonSizer to see why this is causing the problem.

I am using CB on Windows SVN 12468, which uses wxwidget 3.1.5. I have not tried on Linux Mont 20.1, which uses 3.0.5

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB trunk wxCHECK_RET failures with allot of the sdk resources
« Reply #7 on: June 29, 2021, 02:09:51 pm »
It is an issue, please log it. I get a use-after-free report from asan as advertised.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678