Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QVariant saving fails on second "consecutive" save
Forum Updated to NodeBB v4.3 + New Features

QVariant saving fails on second "consecutive" save

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 3 Posters 1.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MateoAero
    wrote on last edited by
    #7

    Of course it is not metatype. This is the declaration:

    class UTILS_EXPORT XSignal : public QQuickItem
    {
    	Q_OBJECT;
    	Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged); 
    	Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged);
    	Q_PROPERTY(quint32 frequency READ frequency WRITE setFrequency NOTIFY frequencyChanged);
    	...
    public:
    	XSignal(QQuickItem *parent = nullptr);
    	~XSignal();
    
    	enum _pinType {
    		ARDUINO_BOARD = 0,
    		MCP,
    		LED,
    		DIRECT,
    		SCALED,
    		MAP,
    		LED_POWER,
    		PRODUCT,
    		UNASSIGNED
    	};
    	Q_ENUM(_pinType); //The one causing the error on second loop of save
    
    	//PROPERTIES
    	const QVariant& value() const;
    	Q_INVOKABLE void setValue(const QVariant& newValue);
    
    	const QString& url() const ;
    	void setUrl(const QString& newUrl);
    ...
    };
    
    
    QDataStream UTILS_EXPORT &operator<<(QDataStream& out, const XSignal& data);
    QDataStream UTILS_EXPORT &operator>>(QDataStream &in, XSignal & data);
    

    Then, these operators:

    QDataStream & operator<<(QDataStream & out, const XSignal & data)
    {
    	auto p = data.metaObject();
    	QMap<QByteArray,QVariant> signalAttributes;
    	for (auto i = p->propertyOffset(); i < p->propertyCount(); i++)
    	{
    		auto prop = p->property(i);
    		if(prop.isWritable()/* && strcmp(prop.name(),"secSignal")*/)
    			signalAttributes[prop.name()] = data.property(prop.name());
    	}
    	return out << signalAttributes;
    }
    
    QDataStream & operator>>(QDataStream & in, XSignal & data)
    {
    	QMap<QByteArray, QVariant> signalAttributes;
    	in >> signalAttributes;
    	
    	for (auto k : signalAttributes.keys())
    	{
    		if (k == "secSignal")
    		{
    			auto url = signalAttributes.value("url");
    			auto v = signalAttributes.value(k).toString();
    			qDebug() << url << v;
    		}
    		data.setProperty(k, signalAttributes.value(k));
    	}
    
    	return in;
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #8

      @MateoAero said in QVariant saving fails on second "consecutive" save:

      QQuickItem

      Why is it a QQuickItem and not just a QObject since you are not using any feature of it ?

      By the way, making it a QObject to avoid memory management is not really a good idea. QObject is a non trivial class and generating thousands of them has a cost.

      You might also want to consider using Q_GADGET which us lighter weight.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • M Offline
        M Offline
        MateoAero
        wrote on last edited by
        #9

        Yes, I know. I use it as a child in QML of an element that access its properties to show/edit them. I know it can be simplified, but at this very moment in the project it is fine for me as is, and it worked until a couple of days ago. Again, I don't understand why making two saves in a row works the first time but not the second one...

        kshegunovK 1 Reply Last reply
        0
        • M MateoAero

          Yes, I know. I use it as a child in QML of an element that access its properties to show/edit them. I know it can be simplified, but at this very moment in the project it is fine for me as is, and it worked until a couple of days ago. Again, I don't understand why making two saves in a row works the first time but not the second one...

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #10

          Something's not right with the objects, and if I were to hazard a guess, you have a dangling reference. Have you made absolutely sure you're not deleting the object in the meantime? What's the stack trace from the crash exactly?

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MateoAero
            wrote on last edited by MateoAero
            #11

            The problem is the stack just states a breakpoint has been triggered, nothing else. The reference are for sure valid, as I can go step by step in

            QDataStream & operator<<(QDataStream & out, const XSignal & data)
            {
            	auto p = data.metaObject();
            	QMap<QByteArray,QVariant> signalAttributes;
            	for (auto i = p->propertyOffset(); i < p->propertyCount(); i++)
            	{
            		auto prop = p->property(i);
            		if(prop.isWritable()/* && strcmp(prop.name(),"secSignal")*/)
            			signalAttributes[prop.name()] = data.property(prop.name());
            	}
            	return out << signalAttributes;
            }
            
            

            Indeed, I can go as deep as QDataStream.h, line 342:
            s << it.key() << it.value();

            And it still shows a valid iterator, even when it breaks...

            kshegunovK 1 Reply Last reply
            0
            • M MateoAero

              The problem is the stack just states a breakpoint has been triggered, nothing else. The reference are for sure valid, as I can go step by step in

              QDataStream & operator<<(QDataStream & out, const XSignal & data)
              {
              	auto p = data.metaObject();
              	QMap<QByteArray,QVariant> signalAttributes;
              	for (auto i = p->propertyOffset(); i < p->propertyCount(); i++)
              	{
              		auto prop = p->property(i);
              		if(prop.isWritable()/* && strcmp(prop.name(),"secSignal")*/)
              			signalAttributes[prop.name()] = data.property(prop.name());
              	}
              	return out << signalAttributes;
              }
              
              

              Indeed, I can go as deep as QDataStream.h, line 342:
              s << it.key() << it.value();

              And it still shows a valid iterator, even when it breaks...

              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by kshegunov
              #12

              @MateoAero said in QVariant saving fails on second "consecutive" save:

              The reference are for sure valid, as I can go step by step in

              The fact that you can enter the function doesn't, by any measure mean the object's valid, neither can such a thing be deduced by what you see as data from reading the memory. Humor me, provide a stack trace.

              Read and abide by the Qt Code of Conduct

              1 Reply Last reply
              2
              • M Offline
                M Offline
                MateoAero
                wrote on last edited by
                #13

                Re: QVariant saving fails on second "consecutive" save

                I don't understand what you mean. So far, whenever I trace an error by debugging step by step I have always been able to locate the problem in memory. Nonetheless, here you have the debug output:

                'testsd.exe' (Win32): Loaded 'C:\Users\JAVI\source\repos\mcsimxpand\bin\testsd.exe'. Symbols loaded.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Symbols loaded.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Users\JAVI\source\repos\mcsimxpand\bin\xutilsd.dll'. Symbols loaded.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Qmld.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Cored.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1d.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Guid.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Networkd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Quickd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\mpr.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\netapi32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5SerialPortd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140_1d.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\userenv.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dxgi.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\d3d11.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\IPHLPAPI.DLL'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dnsapi.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\srvcli.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\netutils.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5QmlModelsd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\nsi.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'.
                'testsd.exe' (QML): Connecting to the QML runtime...
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\platforms\qwindowsd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\wtsapi32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\wldp.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\umpdc.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_serverd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_debuggerd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_inspectord.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_messagesd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_nativedebuggerd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_previewd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_profilerd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_quickprofilerd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_locald.dll'.
                QML Debugger: Connecting to socket {4743FBB3-1294-4C9E-96AE-F6C53936C133}...
                Initialized.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\clbcatq.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\propsys.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick.2\qtquick2plugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5QmlWorkerScriptd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Controls.2\qtquickcontrols2plugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5QuickControls2d.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5QuickTemplates2d.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Layouts\qquicklayoutsplugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Window.2\windowplugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\Qt\labs\platform\qtlabsplatformplugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Widgetsd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\Qt\labs\folderlistmodel\qmlfolderlistmodelplugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Templates.2\qtquicktemplates2plugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Controls\qtquickcontrolsplugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\Qt\labs\settings\qmlsettingsplugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Dialogs\dialogplugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQml\qmlplugind.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\d3d9.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvldumdx.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\cryptnet.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\drvstore.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\wintrust.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\imagehlp.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\rsaenh.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvd3dumx.dll'.
                The thread 0x19dc has exited with code 0 (0x0).
                'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvd3dumx.dll'
                'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\drvstore.dll'
                'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\devobj.dll'
                'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvldumdx.dll'
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\opengl32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\glu32.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\AppXDeploymentClient.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvoglv64.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\drvstore.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ntmarta.dll'.
                The thread 0x19f0 has exited with code 0 (0x0).
                The thread 0x131c has exited with code 0 (0x0).
                The thread 0x3acc has exited with code 0 (0x0).
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DXCore.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\winsta.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DWrite.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\NapiNSP.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\pnrpnsp.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\wshbth.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\nlaapi.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\mswsock.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\winrnr.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Program Files\Bonjour\mdnsNSP.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qgifd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qicnsd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qicod.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qjpegd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qsvgd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Svgd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qtgad.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qtiffd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qwbmpd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qwebpd.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\winhttp.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dhcpcsvc6.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dhcpcsvc.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\sspicli.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\OnDemandConnRouteHelper.dll'.
                'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\OnDemandConnRouteHelper.dll'
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvldumdx.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvd3dumx.dll'.
                The thread 0x25e4 has exited with code 0 (0x0).
                'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvd3dumx.dll'
                'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvldumdx.dll'
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DataExchange.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dcomp.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\twinapi.appcore.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\TextInputFramework.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\CoreUIComponents.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'.
                'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\WinTypes.dll'
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'.
                'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\WinTypes.dll'
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\oleacc.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\UIAutomationCore.dll'.
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\sxs.dll'.
                mincore\com\oleaut32\dispatch\ups.cpp(2122)\OLEAUT32.dll!00007FFD53A99DD6: (caller: 00007FFD53A991E9) ReturnHr(1) tid(2d44) 8002801D Library not registered.
                Debug Error!

                Program: C:\Qt\5.15.2\msvc2019_64\bin\Qt5Cored.dll
                Module: 5.15.2
                File: kernel\qvariant.cpp
                Line: 2601

                ASSERT failure in QVariant::save: "Invalid type to save", file kernel\qvariant.cpp, line 2601

                (Press Retry to debug the application)
                'testsd.exe' (Win32): Loaded 'C:\Windows\System32\TextShaping.dll'.
                testsd.exe has triggered a breakpoint.

                If you meant the call stack:
                Qt5Cored.dll!00007ffc8791815d() Unknown
                Qt5Cored.dll!00007ffc8791692f() Unknown
                Qt5Cored.dll!00007ffc8790801d() Unknown
                Qt5Cored.dll!00007ffc87dd45da() Unknown
                Qt5Cored.dll!00007ffc87dd549d() Unknown

                xutilsd.dll!QtPrivate::writeAssociativeContainer<QMap<QByteArray,QVariant>>(QDataStream & s, const QMap<QByteArray,QVariant> & c) Line 343 C++
                xutilsd.dll!operator<<<QByteArray,QVariant>(QDataStream & s, const QMap<QByteArray,QVariant> & map) Line 480 C++
                xutilsd.dll!operator<<(QDataStream & out, const XSignal & data) Line 802 C++
                xutilsd.dll!XSignalManager::saveSignals(const QString & filename) Line 245 C++
                xutilsd.dll!XSignalManager::addSignal(XSignal * refSignal) Line 203 C++
                xutilsd.dll!XSignalManager::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 168 C++
                xutilsd.dll!XSignalManager::qt_metacall(QMetaObject::Call _c, int id, void * * a) Line 307 C++
                Qt5Cored.dll!00007ffc87d540b8() Unknown
                Qt5Qmld.dll!00007ffc8bb6d6d0() Unknown
                Qt5Qmld.dll!00007ffc8b912a95() Unknown
                Qt5Qmld.dll!00007ffc8b913846() Unknown
                Qt5Qmld.dll!00007ffc8b90f988() Unknown
                Qt5Qmld.dll!00007ffc8b90f47b() Unknown
                Qt5Qmld.dll!00007ffc8b702eaf() Unknown
                Qt5Qmld.dll!00007ffc8b9553e5() Unknown
                Qt5Qmld.dll!00007ffc8b951d45() Unknown
                Qt5Qmld.dll!00007ffc8b890774() Unknown
                Qt5Qmld.dll!00007ffc8bb9fcaf() Unknown
                Qt5Qmld.dll!00007ffc8bb10601() Unknown
                Qt5Qmld.dll!00007ffc8bb10d5a() Unknown
                Qt5Qmld.dll!00007ffc8bb6c4ed() Unknown
                Qt5Qmld.dll!00007ffc8bad3219() Unknown
                Qt5Cored.dll!00007ffc87db6426() Unknown
                Qt5Cored.dll!00007ffc87da36d7() Unknown
                Qt5QuickTemplates2d.dll!00007ffc88b29034() Unknown
                Qt5QuickTemplates2d.dll!00007ffc88a1cc68() Unknown
                Qt5QuickTemplates2d.dll!00007ffc88a1bf28() Unknown
                Qt5QuickTemplates2d.dll!00007ffc88a5c78f() Unknown
                Qt5Quickd.dll!00007ffc85f3f173() Unknown
                Qt5QuickTemplates2d.dll!00007ffc88a1b34d() Unknown
                Qt5Cored.dll!00007ffc87d45f41() Unknown
                Qt5Cored.dll!00007ffc87d479df() Unknown
                Qt5Cored.dll!00007ffc87d43341() Unknown
                Qt5Guid.dll!00007ffc868fd6be() Unknown
                Qt5Cored.dll!00007ffc87d44aaf() Unknown
                Qt5Cored.dll!00007ffc87d42b92() Unknown
                Qt5Quickd.dll!00007ffc85f8b8f7() Unknown
                Qt5Quickd.dll!00007ffc85f8f7e7() Unknown
                Qt5Quickd.dll!00007ffc85f8e18c() Unknown
                Qt5Quickd.dll!00007ffc85f86f2c() Unknown
                Qt5Guid.dll!00007ffc869271f7() Unknown
                Qt5Quickd.dll!00007ffc85f86c75() Unknown
                Qt5Cored.dll!00007ffc87d45f41() Unknown
                Qt5Cored.dll!00007ffc87d479df() Unknown
                Qt5Cored.dll!00007ffc87d43341() Unknown
                Qt5Guid.dll!00007ffc868fd6be() Unknown
                Qt5Cored.dll!00007ffc87d44aaf() Unknown
                Qt5Cored.dll!00007ffc87d4494b() Unknown
                Qt5Guid.dll!00007ffc86901ab3() Unknown
                Qt5Guid.dll!00007ffc86905016() Unknown
                Qt5Guid.dll!00007ffc868cf102() Unknown
                qwindowsd.dll!00007ffc8ab14802() Unknown
                Qt5Cored.dll!00007ffc87e170b2() Unknown
                qwindowsd.dll!00007ffc8ab147b4() Unknown
                Qt5Cored.dll!00007ffc87d3f39b() Unknown
                Qt5Cored.dll!00007ffc87d3f604() Unknown
                Qt5Cored.dll!00007ffc87d42919() Unknown
                Qt5Guid.dll!00007ffc868fd648() Unknown
                testsd.exe!main(int argc, char * * argv) Line 67 C++
                testsd.exe!WinMain(HINSTANCE
                * formal, HINSTANCE * __formal, char * __formal, int __formal) Line 97 C++
                testsd.exe!invoke_main() Line 107 C++
                testsd.exe!__scrt_common_main_seh() Line 288 C++
                testsd.exe!__scrt_common_main() Line 331 C++
                testsd.exe!WinMainCRTStartup(void * __formal) Line 17 C++
                kernel32.dll!00007ffd55757034() Unknown
                ntdll.dll!RtlUserThreadStart() Unknown

                kshegunovK 1 Reply Last reply
                0
                • M MateoAero

                  Re: QVariant saving fails on second "consecutive" save

                  I don't understand what you mean. So far, whenever I trace an error by debugging step by step I have always been able to locate the problem in memory. Nonetheless, here you have the debug output:

                  'testsd.exe' (Win32): Loaded 'C:\Users\JAVI\source\repos\mcsimxpand\bin\testsd.exe'. Symbols loaded.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Symbols loaded.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Users\JAVI\source\repos\mcsimxpand\bin\xutilsd.dll'. Symbols loaded.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Qmld.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Cored.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1d.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Guid.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Networkd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Quickd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\mpr.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\netapi32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5SerialPortd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140_1d.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\userenv.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dxgi.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\d3d11.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\IPHLPAPI.DLL'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dnsapi.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\srvcli.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\netutils.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5QmlModelsd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\nsi.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'.
                  'testsd.exe' (QML): Connecting to the QML runtime...
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\platforms\qwindowsd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\wtsapi32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\wldp.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\umpdc.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_serverd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_debuggerd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_inspectord.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_messagesd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_nativedebuggerd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_previewd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_profilerd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_quickprofilerd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\qmltooling\qmldbg_locald.dll'.
                  QML Debugger: Connecting to socket {4743FBB3-1294-4C9E-96AE-F6C53936C133}...
                  Initialized.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\clbcatq.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\propsys.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick.2\qtquick2plugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5QmlWorkerScriptd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Controls.2\qtquickcontrols2plugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5QuickControls2d.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5QuickTemplates2d.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Layouts\qquicklayoutsplugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Window.2\windowplugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\Qt\labs\platform\qtlabsplatformplugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Widgetsd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\Qt\labs\folderlistmodel\qmlfolderlistmodelplugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Templates.2\qtquicktemplates2plugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Controls\qtquickcontrolsplugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\Qt\labs\settings\qmlsettingsplugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQuick\Dialogs\dialogplugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\qml\QtQml\qmlplugind.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\d3d9.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvldumdx.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\cryptnet.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\drvstore.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\wintrust.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\imagehlp.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\rsaenh.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvd3dumx.dll'.
                  The thread 0x19dc has exited with code 0 (0x0).
                  'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvd3dumx.dll'
                  'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\drvstore.dll'
                  'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\devobj.dll'
                  'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvldumdx.dll'
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\opengl32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\glu32.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\AppXDeploymentClient.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvoglv64.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\drvstore.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\ntmarta.dll'.
                  The thread 0x19f0 has exited with code 0 (0x0).
                  The thread 0x131c has exited with code 0 (0x0).
                  The thread 0x3acc has exited with code 0 (0x0).
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DXCore.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\winsta.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DWrite.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\NapiNSP.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\pnrpnsp.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\wshbth.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\nlaapi.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\mswsock.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\winrnr.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Program Files\Bonjour\mdnsNSP.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qgifd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qicnsd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qicod.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qjpegd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qsvgd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\bin\Qt5Svgd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qtgad.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qtiffd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qwbmpd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qwebpd.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\winhttp.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dhcpcsvc6.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dhcpcsvc.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\sspicli.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\OnDemandConnRouteHelper.dll'.
                  'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\OnDemandConnRouteHelper.dll'
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvldumdx.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvd3dumx.dll'.
                  The thread 0x25e4 has exited with code 0 (0x0).
                  'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvd3dumx.dll'
                  'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvmdi.inf_amd64_799504293a3d3200\nvldumdx.dll'
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\DataExchange.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\dcomp.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\twinapi.appcore.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\TextInputFramework.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\CoreUIComponents.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'.
                  'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\WinTypes.dll'
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'.
                  'testsd.exe' (Win32): Unloaded 'C:\Windows\System32\WinTypes.dll'
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\oleacc.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\UIAutomationCore.dll'.
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\sxs.dll'.
                  mincore\com\oleaut32\dispatch\ups.cpp(2122)\OLEAUT32.dll!00007FFD53A99DD6: (caller: 00007FFD53A991E9) ReturnHr(1) tid(2d44) 8002801D Library not registered.
                  Debug Error!

                  Program: C:\Qt\5.15.2\msvc2019_64\bin\Qt5Cored.dll
                  Module: 5.15.2
                  File: kernel\qvariant.cpp
                  Line: 2601

                  ASSERT failure in QVariant::save: "Invalid type to save", file kernel\qvariant.cpp, line 2601

                  (Press Retry to debug the application)
                  'testsd.exe' (Win32): Loaded 'C:\Windows\System32\TextShaping.dll'.
                  testsd.exe has triggered a breakpoint.

                  If you meant the call stack:
                  Qt5Cored.dll!00007ffc8791815d() Unknown
                  Qt5Cored.dll!00007ffc8791692f() Unknown
                  Qt5Cored.dll!00007ffc8790801d() Unknown
                  Qt5Cored.dll!00007ffc87dd45da() Unknown
                  Qt5Cored.dll!00007ffc87dd549d() Unknown

                  xutilsd.dll!QtPrivate::writeAssociativeContainer<QMap<QByteArray,QVariant>>(QDataStream & s, const QMap<QByteArray,QVariant> & c) Line 343 C++
                  xutilsd.dll!operator<<<QByteArray,QVariant>(QDataStream & s, const QMap<QByteArray,QVariant> & map) Line 480 C++
                  xutilsd.dll!operator<<(QDataStream & out, const XSignal & data) Line 802 C++
                  xutilsd.dll!XSignalManager::saveSignals(const QString & filename) Line 245 C++
                  xutilsd.dll!XSignalManager::addSignal(XSignal * refSignal) Line 203 C++
                  xutilsd.dll!XSignalManager::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 168 C++
                  xutilsd.dll!XSignalManager::qt_metacall(QMetaObject::Call _c, int id, void * * a) Line 307 C++
                  Qt5Cored.dll!00007ffc87d540b8() Unknown
                  Qt5Qmld.dll!00007ffc8bb6d6d0() Unknown
                  Qt5Qmld.dll!00007ffc8b912a95() Unknown
                  Qt5Qmld.dll!00007ffc8b913846() Unknown
                  Qt5Qmld.dll!00007ffc8b90f988() Unknown
                  Qt5Qmld.dll!00007ffc8b90f47b() Unknown
                  Qt5Qmld.dll!00007ffc8b702eaf() Unknown
                  Qt5Qmld.dll!00007ffc8b9553e5() Unknown
                  Qt5Qmld.dll!00007ffc8b951d45() Unknown
                  Qt5Qmld.dll!00007ffc8b890774() Unknown
                  Qt5Qmld.dll!00007ffc8bb9fcaf() Unknown
                  Qt5Qmld.dll!00007ffc8bb10601() Unknown
                  Qt5Qmld.dll!00007ffc8bb10d5a() Unknown
                  Qt5Qmld.dll!00007ffc8bb6c4ed() Unknown
                  Qt5Qmld.dll!00007ffc8bad3219() Unknown
                  Qt5Cored.dll!00007ffc87db6426() Unknown
                  Qt5Cored.dll!00007ffc87da36d7() Unknown
                  Qt5QuickTemplates2d.dll!00007ffc88b29034() Unknown
                  Qt5QuickTemplates2d.dll!00007ffc88a1cc68() Unknown
                  Qt5QuickTemplates2d.dll!00007ffc88a1bf28() Unknown
                  Qt5QuickTemplates2d.dll!00007ffc88a5c78f() Unknown
                  Qt5Quickd.dll!00007ffc85f3f173() Unknown
                  Qt5QuickTemplates2d.dll!00007ffc88a1b34d() Unknown
                  Qt5Cored.dll!00007ffc87d45f41() Unknown
                  Qt5Cored.dll!00007ffc87d479df() Unknown
                  Qt5Cored.dll!00007ffc87d43341() Unknown
                  Qt5Guid.dll!00007ffc868fd6be() Unknown
                  Qt5Cored.dll!00007ffc87d44aaf() Unknown
                  Qt5Cored.dll!00007ffc87d42b92() Unknown
                  Qt5Quickd.dll!00007ffc85f8b8f7() Unknown
                  Qt5Quickd.dll!00007ffc85f8f7e7() Unknown
                  Qt5Quickd.dll!00007ffc85f8e18c() Unknown
                  Qt5Quickd.dll!00007ffc85f86f2c() Unknown
                  Qt5Guid.dll!00007ffc869271f7() Unknown
                  Qt5Quickd.dll!00007ffc85f86c75() Unknown
                  Qt5Cored.dll!00007ffc87d45f41() Unknown
                  Qt5Cored.dll!00007ffc87d479df() Unknown
                  Qt5Cored.dll!00007ffc87d43341() Unknown
                  Qt5Guid.dll!00007ffc868fd6be() Unknown
                  Qt5Cored.dll!00007ffc87d44aaf() Unknown
                  Qt5Cored.dll!00007ffc87d4494b() Unknown
                  Qt5Guid.dll!00007ffc86901ab3() Unknown
                  Qt5Guid.dll!00007ffc86905016() Unknown
                  Qt5Guid.dll!00007ffc868cf102() Unknown
                  qwindowsd.dll!00007ffc8ab14802() Unknown
                  Qt5Cored.dll!00007ffc87e170b2() Unknown
                  qwindowsd.dll!00007ffc8ab147b4() Unknown
                  Qt5Cored.dll!00007ffc87d3f39b() Unknown
                  Qt5Cored.dll!00007ffc87d3f604() Unknown
                  Qt5Cored.dll!00007ffc87d42919() Unknown
                  Qt5Guid.dll!00007ffc868fd648() Unknown
                  testsd.exe!main(int argc, char * * argv) Line 67 C++
                  testsd.exe!WinMain(HINSTANCE
                  * formal, HINSTANCE * __formal, char * __formal, int __formal) Line 97 C++
                  testsd.exe!invoke_main() Line 107 C++
                  testsd.exe!__scrt_common_main_seh() Line 288 C++
                  testsd.exe!__scrt_common_main() Line 331 C++
                  testsd.exe!WinMainCRTStartup(void * __formal) Line 17 C++
                  kernel32.dll!00007ffd55757034() Unknown
                  ntdll.dll!RtlUserThreadStart() Unknown

                  kshegunovK Offline
                  kshegunovK Offline
                  kshegunov
                  Moderators
                  wrote on last edited by kshegunov
                  #14

                  I find it odd that you apparently have the debug libraries, but the trace doesn't show the functions called. Anyway, I have this creeping suspicion that the SignalManager outlives its employees, or rather that the QML engine frees them at some point while you still keep a pointer around. What you can try to do, is to keep a QPointer<XSignal> instead of a raw pointer. If at saveSignals any of these QPointers is null, then I'm correct.

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MateoAero
                    wrote on last edited by
                    #15

                    The pointer is not null. I added a trace in the loop:

                    		QDataStream ds(&f2);
                    		ds.setVersion(QDataStream::Qt_5_14);
                    		for (auto sig : mpSignals)
                    		{
                    			ds << *sig;
                    			qDebug() << sig;
                    		}
                    		f2.close();
                    

                    The result on the first signal on the first call to saveSignals():

                    [27/10/2021-18:12:22.399] (DEBUG)--> void __cdecl XSignalManager::saveSignals(const class QString &)Saving omp signals

                    [27/10/2021-18:12:22.400] (DEBUG)--> class QDataStream &__cdecl operator <<(class QDataStream &,const class XSignal &)Saving signal "com.Generic.MCP_Indicators"

                    [27/10/2021-18:12:22.400] (DEBUG)--> class QDataStream &__cdecl operator <<(class QDataStream &,const class XSignal &)QMap(("alias", QVariant(QString, "MCP"))("col", QVariant(ushort, 65535))("defaultValue", QVariant(int, 0))("frequency", QVariant(uint, 20))("hideOnSignal", QVariant(QString, ""))("inverted", QVariant(bool, false))("led", QVariant(ushort, 65535))("ledDigits", QVariant(ushort, 65535))("mappedValues", QVariant(QByteArray, "\x00\x00\x00\x00"))("mcp", QVariant(ushort, 65535))("minDigits", QVariant(ushort, 65535))("oSignal", QVariant(QString, ""))("pin", QVariant(ushort, 5))("pinType", QVariant(int, 0))("pwm0", QVariant(ushort, 0))("pwm255", QVariant(ushort, 255))("row", QVariant(ushort, 65535))("secSignal", QVariant(QString, ""))("sigScale", QVariant(double, 1))("url", QVariant(QString, "com.Generic.MCP_Indicators"))("value", QVariant(QString, ""))("zeroDigits", QVariant(ushort, 65535)))

                    The result when saving the first signal for the second time:
                    [27/10/2021-18:12:28.616] (DEBUG)--> void __cdecl XSignalManager::saveSignals(const class QString &)Saving omp signals

                    [27/10/2021-18:12:28.616] (DEBUG)--> class QDataStream &__cdecl operator <<(class QDataStream &,const class XSignal &)Saving signal "com.Generic.MCP_Indicators"

                    [27/10/2021-18:12:28.617] (DEBUG)--> class QDataStream &__cdecl operator <<(class QDataStream &,const class XSignal &)QMap(("alias", QVariant(QString, "MCP"))("col", QVariant(ushort, 65535))("defaultValue", QVariant(int, 0))("frequency", QVariant(uint, 20))("hideOnSignal", QVariant(QString, ""))("inverted", QVariant(bool, false))("led", QVariant(ushort, 65535))("ledDigits", QVariant(ushort, 65535))("mappedValues", QVariant(QByteArray, "\x00\x00\x00\x00"))("mcp", QVariant(ushort, 65535))("minDigits", QVariant(ushort, 65535))("oSignal", QVariant(QString, ""))("pin", QVariant(ushort, 5))("pinType", QVariant(XSignal::_pinType, "ARDUINO_BOARD"))("pwm0", QVariant(ushort, 0))("pwm255", QVariant(ushort, 255))("row", QVariant(ushort, 65535))("secSignal", QVariant(QString, ""))("sigScale", QVariant(double, 1))("url", QVariant(QString, "com.Generic.MCP_Indicators"))("value", QVariant(QString, ""))("zeroDigits", QVariant(ushort, 65535)))

                    [27/10/2021-18:12:28.617] (ERROR)--> QVariant::save: unable to save type 'XSignal::_pinType' (type id: 1941).

                    [27/10/2021-18:12:28.618] (FATAL)--> ASSERT failure in QVariant::save: "Invalid type to save", file kernel\qvariant.cpp, line 2601

                    However, it seems that when loading them pinType is returned as an int, and is thus writable without any issue. However, when saving the second time, I don't know still why, it is already the correct type (XSignal:_pinType) and thus fails. Thank you for the support! I will mark it as solved, if I need help figuring out when it changes to the correct type I will create a separate post :)

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      MateoAero
                      wrote on last edited by
                      #16

                      Just for the record, in case it may serve anyone:

                      The problem was that, as reflected above, the data was stored as an int and thus, when loaded, the first access to it as as an int. I still have not found the specific point in my code (too long to see in such a short time) where the correct type was set to the variant (I reckon it will be in some access to it). In order to get rid of this problem, I had to define the << and >> operators for the affected types (Enums) and register them by means of:

                      qRegisterMetaTypeStreamOperators<XSignal::_pinType>("XSignal::_pinType");
                      
                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved