copperspice / cs_designer

Program used by developers to create a graphical interface .ui file
https://www.copperspice.com/
14 stars 1 forks source link

"ASSERT failure in QWeakPointer" #2

Open gvanem opened 1 year ago

gvanem commented 1 year ago

First off I'm deeply impressed with this Designer program. But building (with Cs1.8) and running it with these steps: 1) Open a recent test.ui file. 2) Enter Settings | Preferences. Select the Forms tab and enable Preview Zoom 200%. 3) Press Ctrl-R to preview my dialog. It shows scaled to 200% very nicely. 4) But pressing ESC to quit the preview, triggers this Q_ASSERT_X() from src/core/qsharedpointer.cpp: ASSERT failure in QWeakPointer: "Detected QWeakPointer creation in a QObject being deleted", file src/core/pointer/qsharedpointer.cpp, line 50. And the program exits.

I've no idea what's this is all about.

bgeller commented 1 year ago

1) Did you try this using our pre-built CsDesigner 1.8 release application? Using this version we were unable to reproduce your reported issue.

2) Did you build CsDesigner with a newer version of CopperSpice that you built? If so, please let us know the exact combination.

3) It should not matter for CsDesigner, but can you tell us what OS you are using and which compiler and version.

Barbara

gvanem commented 1 year ago

Did you try this using our pre-built CsDesigner 1.8 release application?

There are no pre-built CsDesigner 1.8 for Windows. But using 1.0 from the Release page I get a similar (same?) assert() for the above steps:

ntdll!NtTerminateProcess+0x14
ntdll!RtlExitUserProcess+0xb8
KERNEL32!ExitProcessImplementation+0xb
msvcrt!_crtExitProcess+0x15
msvcrt!doexit+0x171
msvcrt!abort+0x8d
libCsCore1_7!Z17qt_message_output9QtMsgTypeN2Cs11QStringViewI8QString8EE+0x83
libCsCore1_7!Z17qt_message_output9QtMsgTypeN2Cs11QStringViewI8QString8EE+0x2cc
libCsCore1_7!Z6qFatalPKcz+0x2a
libCsCore1_7!Z11qt_assert_xPKcS0_S0_i+0x1e
libCsCore1_7!ZN15QtSharedPointer20ExternalRefCountData9getAndRefEPK7QObject+0xb5
libCsGui1_7!ZN14QWidgetPrivate12close_helperENS_9CloseModeE+0x43
....

Did you build CsDesigner with a newer version of CopperSpice that you built?

Huh? Everything was built from git master.

but can you tell us what OS you are using and which compiler and version.

MSVC cl ver. 19.36.32502 for x64.

bgeller commented 1 year ago

There are no pre-built CsDesigner 1.8 for Windows. But using 1.0 from the Release page I get a similar (same?)

The version number for CsDesigner corresponds to its release and will not be in sync with the CS release version numbers. The current release for CsDesigner 1.0.2 and it was built with MinGW. This will work for MSVC users.

Just to confirm, if you use our released version of CsDesigner you have this problem. Since we can not repeat it as of yet, can you send us your UI file to test.

Everything was built from git master.

The reason we asked about which combination of CS and CsDesigner you used is sometimes developers build in odd combinations. Since you are on MSVC if you had just built CsDesigner using the non-MSVC CS build, that would be an issue.

The other question now is did you build CS and CsDesigner on MSVC in release or debug.

Thanks for working with us to help discover how to repeat this in our testing environment.

Barbara

gvanem commented 1 year ago

Just to confirm, if you use our released version of CsDesigner you have this problem.

Yes.

Since we can not repeat it as of yet, can you send us your UI file to test.

Here it is: gv-test.ui.txt

The other question now is did you build CS and CsDesigner on MSVC in release or debug.

I built everything using MSVC in release mode. But I'm not sure that your release mode would include disabling some /all asserts. I've disable no asserts AFAICS. They are there for a good reason. But I'm not sure what this: ASSERT failure in QWeakPointer: "Detected QWeakPointer creation in a QObject being deleted" really tries to say.

So please try to help me nest back from this ASSERT. It seems some static constructor or something is causing this. Here is an edited call-stack from running cdb -c g Designer.exe gv-test.ui:

....
CsCore1_8!qt_assert_x(char * where = 0x00000000`00000000 "", char * what = 0x00000000`00000005 
"--- memory read error at address 0x00000000`00000005 ---", char * file = 0x000000f4`aa8fa800 "???"
CsCore1_8!QtSharedPointer::ExternalRefCountData::getAndRef(class QObject * obj = 0x00000000`00000000)+0x6c
CsGui1_8!QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode mode = 0n1150844176 (No matching enumerant))+0x72
designer!CsSignal::Internal::Bento<bool (class CsSignal::SlotBase * receiver = 0x00000000`00000000, 
  class CsSignal::Internal::TeaCupAbstract * dataPack = 0x00007ffe`43463ba0)+0x97
CsCore1_8!CsSignal::activate<QObject,QObject,QObject *,QObject * &>(class QObject * sender = 
  0x000002cb`0f6c0000, <function> * signal = 0x00000000`00000000, class QObject ** <Vs_0> = 
  0x000000f4`aa8fab68)+0x5d7
CsCore1_8!QObject::~QObject(void)+0xbd
CsGui1_8!QWidget::~QWidget(void)+0x675
CsGui1_8!QDialog::`vbase destructor'(void)+0x17
designer!QDialog::`scalar deleting destructor'(void)+0x15
CsGui1_8!QGraphicsProxyWidget::~QGraphicsProxyWidget(void)+0x226
designer!qdesigner_internal::DesignerZoomProxyWidget::`scalar deleting destructor'(void)+0x15
CsGui1_8!QGraphicsScene::~QGraphicsScene(void)+0x11c
CsGui1_8!QGraphicsScene::`vbase destructor'(void)+0x22
designer!QGraphicsScene::`scalar deleting destructor'(void)+0x1c
CsCore1_8!QObject::deleteChildren(void)+0xef
CsCore1_8!CSInternalChildren::deleteChildren(class QObject * object = 0x000002cb`44987d10)+0x17
CsGui1_8!QWidget::~QWidget(void)+0x5c3
designer!qdesigner_internal::DesignerZoomWidget::`scalar deleting destructor'(void)+0x15
....

Note the calls are from DesignerZoomWidget which I assume is not used when zoom is disabled.