App crash on windows

Hi,

I tried to port my app on Windows but got random crashes with no information provided by the IDE.
In the event log of Windows, I just have an information that the issue comes from XojoGUIFramework64.dll

I tried to download WinDbg Preview and attach the process to find the issue but I don’t have any clue.

I have a login window that open when the app start and there is no crash on this window, but when I access other windows, it start to crash randomly. Sometimes on the first window and sometimes after X min of use.

I have Windows 10 fully updated
I use plugins from einhugur (treeview, picturebuttons, datecontrol), the MBS plugins and the DataView from pidogSoftware

Here is the trace I get from WinDbg Preview. it’s just a sample but you can find the full trace here https://pastebin.com/qhYR5E7Q

(329c.2b48): Break instruction exception - code 80000003 (first chance)
ntdll!DbgBreakPoint:
00007fff`0e523170 cc              int     3
0:009> g
ModLoad: 00007ffe`f5880000 00007ffe`f5a25000   C:\\Windows\\WinSxS\\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.17763.1217_none_0f5935e9ade084a1\\Gdiplus.DLL
ModLoad: 00007ffe`ef1c0000 00007ffe`ef1c7000   C:\\Windows\\SYSTEM32\\RICHED32.DLL
ModLoad: 00007ffe`e9ef0000 00007ffe`e9f89000   C:\\Windows\\SYSTEM32\\RICHED20.dll
ModLoad: 00007ffe`c21c0000 00007ffe`c21d9000   C:\\Windows\\SYSTEM32\\USP10.dll
ModLoad: 00007ffe`f7980000 00007ffe`f79b9000   C:\\Windows\\SYSTEM32\\msls31.dll
ModLoad: 00007ffe`d2fa0000 00007ffe`d32d4000   C:\\Windows\\SYSTEM32\\msftedit.DLL
ModLoad: 00007ffe`e0320000 00007ffe`e049b000   C:\\Windows\\System32\\Windows.Globalization.dll
ModLoad: 00007ffe`de9b0000 00007ffe`dea0c000   C:\\Windows\\System32\\Bcp47Langs.dll
ModLoad: 00007ffe`e0740000 00007ffe`e076a000   C:\\Windows\\System32\\bcp47mrm.dll
ModLoad: 00007ffe`d2f70000 00007ffe`d2f99000   C:\\Windows\\SYSTEM32\\globinputhost.dll
ModLoad: 00007ffe`d6370000 00007ffe`d6386000   C:\\Windows\\system32\\OnDemandConnRouteHelper.dll
ModLoad: 00007fff`02290000 00007fff`0229b000   C:\\Windows\\SYSTEM32\\WINNSI.DLL
ModLoad: 00007fff`0b920000 00007fff`0b928000   C:\\Windows\\System32\SI.dll
ModLoad: 00007ffe`fa0a0000 00007ffe`fa0b6000   C:\\Windows\\SYSTEM32\\dhcpcsvc6.DLL
ModLoad: 00007ffe`fd110000 00007ffe`fd12c000   C:\\Windows\\SYSTEM32\\dhcpcsvc.DLL
ModLoad: 00007ffe`ef7c0000 00007ffe`ef857000   C:\\Windows\\SYSTEM32\\webio.dll
ModLoad: 00007fff`09a40000 00007fff`09b07000   C:\\Windows\\SYSTEM32\\DNSAPI.dll
ModLoad: 00007ffe`fd100000 00007ffe`fd10a000   C:\\Windows\\System32\\rasadhlp.dll
ModLoad: 00007ffe`f93c0000 00007ffe`f9439000   C:\\Windows\\System32\\fwpuclnt.dll
ModLoad: 00007fff`09790000 00007fff`09814000   C:\\Windows\\system32\\schannel.DLL
ModLoad: 00007ffe`cef90000 00007ffe`cefa5000   C:\\Windows\\SYSTEM32\\mskeyprotect.dll
ModLoad: 00007ffe`cf760000 00007ffe`cf784000   C:\\Windows\\system32\
cryptsslp.dll
ModLoad: 00007fff`098a0000 00007fff`098aa000   C:\\Windows\\SYSTEM32\\DPAPI.DLL
ModLoad: 00007ffe`d6370000 00007ffe`d6386000   C:\\Windows\\system32\\OnDemandConnRouteHelper.dll
(329c.266c): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
XojoGUIFramework64!enableMenuItems+0xb26:
00007ffe`988ff0d6 ff5018          call    qword ptr [rax+18h] ds:00000000`00000018=????????????????
0:000> g
(329c.266c): Access violation - code c0000005 (!!! second chance !!!)
XojoGUIFramework64!enableMenuItems+0xb26:
00007ffe`988ff0d6 ff5018          call    qword ptr [rax+18h] ds:00000000`00000018=????????????????
0:000> g
(329c.266c): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
XojoGUIFramework64!enableMenuItems+0xb26:
00007ffe`988ff0d6 ff5018          call    qword ptr [rax+18h] ds:00000000`00000018=????????????????
0:000> g
(329c.266c): Access violation - code c0000005 (!!! second chance !!!)
XojoGUIFramework64!enableMenuItems+0xb26:
00007ffe`988ff0d6 ff5018          call    qword ptr [rax+18h] ds:00000000`00000018=????????????????
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\atlmfc.natvis'
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\concurrency.natvis'
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\cpp_rest.natvis'
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\stl.natvis'
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\Windows.Data.Json.natvis'
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\Windows.Devices.Geolocation.natvis'
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\Windows.Devices.Sensors.natvis'
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\Windows.Media.natvis'
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\windows.natvis'
NatVis script unloaded from 'C:\\Program Files\\WindowsApps\\Microsoft.WinDbg_1.2001.2001.0_neutral__8wekyb3d8bbwe\\amd64\\Visualizers\\winrt.natvis'

Here are the stack I have on breakpoints in the WinDbg Preview

I searched the forum and tried to figure out what was the issue by disabling code regarding MacOS but can not find the issue.

Thank you

Are you compiling on windows? This crash happens when using xojo debuger?

Yes I am compiling using Windows and the crash happens when using the debuger and also with a build version

It’s a very strange behaviour
At some point the windows app crash without any alert and even not catched by the system itself, where macOS app is full stable.

Pattern not found but seems to appear more frequently on a dev environment with less server resources
We use URL connection to fetch data

Just in case of you may have experienced same kind of issue… !

We are stuck since few days on that point

For these types of crashes I would recommend creating a Feedback case and send us a link to where we can download the executable with steps to reproduce, and/or attach a minidump. Make note of what version of Xojo the executable was compiled with. The more recent the better of course.

Looked since a few months on it but we are still stuck after we tried so many things. Created a feedback for it. feedback://showreport?report_id=61922

This looks like a memory corruption in the heap.
It may not be related to what you just did before, but to something run earlier, where some code overwrote memory of something else.

Running with some tool to detect memory corruption may show what code writes behind the end of an allocated block.

see

Thank you for the tip. Trying to look into that. Not so familiar with this kind of stuff. This is what we get but some reports are bigger.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<avrf:logfile xmlns:avrf="Application Verifier">
	<avrf:logSession TimeStarted="2020-09-30 : 15:00:40" PID="7436" Version="2">
		<avrf:logEntry Time="2020-09-30 : 15:01:33" LayerName="Locks" StopCode="0x201" Severity="Error">
			<avrf:message>Unloading DLL containing an active critical section.</avrf:message>
			<avrf:parameter1>7ff8884aef20 - Critical section address. Run !cs -s &lt;address&gt; to get more information.</avrf:parameter1>
			<avrf:parameter2>12cec20 - Critical section initialization stack trace. Run dps &lt;address&gt; to dump the stack trace.</avrf:parameter2>
			<avrf:parameter3>70782fde - DLL name address.</avrf:parameter3>
			<avrf:parameter4>7ff888480000 - DLL base address.</avrf:parameter4>
			<avrf:stackTrace>
				<avrf:trace>vfbasics!+7ff89fd151b3 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd13ae4 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd17251 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlRemoveVectoredContinueHandler+190 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!memset+d8ce ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!LdrUnloadDll+119 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!LdrUnloadDll+93 ( @ 0)</avrf:trace>
				<avrf:trace>KERNELBASE!FreeLibraryAndExitThread+3c ( @ 0)</avrf:trace>
				<avrf:trace>C:\WINDOWS\System32\DriverStore\FileRepository\nvdm.inf_amd64_6cd15b1bcbca91ac\nvdlistx.dll+000000000000A43C</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd26a74 ( @ 0)</avrf:trace>
				<avrf:trace>KERNEL32!BaseThreadInitThunk+14 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlUserThreadStart+21 ( @ 0)</avrf:trace>
			</avrf:stackTrace>
		</avrf:logEntry>
		<avrf:logEntry Time="2020-09-30 : 15:02:20" LayerName="Heaps" StopCode="0x13" Severity="Error">
			<avrf:message>First chance access violation for current stack trace.</avrf:message>
			<avrf:parameter1>b122ef91 - Invalid address causing the exception.</avrf:parameter1>
			<avrf:parameter2>7ff878c6f7a5 - Code address executing the invalid access.</avrf:parameter2>
			<avrf:parameter3>14e670 - Exception record.</avrf:parameter3>
			<avrf:parameter4>14e180 - Context record.</avrf:parameter4>
			<avrf:stackTrace>
				<avrf:trace>vrfcore!VerifierDisableVerifier+787 ( @ 0)</avrf:trace>
				<avrf:trace>verifier!VerifierStopMessage+b9 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlApplicationVerifierStop+96 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd12825 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd13658 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd12bca ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlIsGenericTableEmpty+1a6 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlRaiseException+1e6 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!KiUserExceptionDispatcher+2e ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!URLConnection_SetValidateCertificates+1245 ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!ApplicationSupportsHiDPI+1b01 ( @ 0)</avrf:trace>
				<avrf:trace>USER32!EnumChildWindows+656 ( @ 0)</avrf:trace>
				<avrf:trace>USER32!DispatchMessageW+2ac ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!enableMenuItems+9eb ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+140e43b3e ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!enableMenuItems+1048 ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!RuntimeRun+3c ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+140f29988 ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+1465014b1 ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+1464fc579 ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+14651691a ( @ 0)</avrf:trace>
				<avrf:trace>KERNEL32!BaseThreadInitThunk+14 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlUserThreadStart+21 ( @ 0)</avrf:trace>
			</avrf:stackTrace>
		</avrf:logEntry>
		<avrf:logEntry Time="2020-09-30 : 15:03:10" LayerName="Heaps" StopCode="0x13" Severity="Error">
			<avrf:message>First chance access violation for current stack trace.</avrf:message>
			<avrf:parameter1>a22e1f91 - Invalid address causing the exception.</avrf:parameter1>
			<avrf:parameter2>7ff878c6f7a5 - Code address executing the invalid access.</avrf:parameter2>
			<avrf:parameter3>14e670 - Exception record.</avrf:parameter3>
			<avrf:parameter4>14e180 - Context record.</avrf:parameter4>
			<avrf:stackTrace>
				<avrf:trace>vrfcore!VerifierDisableVerifier+787 ( @ 0)</avrf:trace>
				<avrf:trace>verifier!VerifierStopMessage+b9 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlApplicationVerifierStop+96 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd12825 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd13658 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd12bca ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlIsGenericTableEmpty+1a6 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlRaiseException+1e6 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!KiUserExceptionDispatcher+2e ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!URLConnection_SetValidateCertificates+1245 ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!ApplicationSupportsHiDPI+1b01 ( @ 0)</avrf:trace>
				<avrf:trace>USER32!EnumChildWindows+656 ( @ 0)</avrf:trace>
				<avrf:trace>USER32!DispatchMessageW+2ac ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!enableMenuItems+9eb ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+140e43b3e ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!enableMenuItems+1048 ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!RuntimeRun+3c ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+140f29988 ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+1465014b1 ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+1464fc579 ( @ 0)</avrf:trace>
				<avrf:trace>Laby!+14651691a ( @ 0)</avrf:trace>
				<avrf:trace>KERNEL32!BaseThreadInitThunk+14 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlUserThreadStart+21 ( @ 0)</avrf:trace>
			</avrf:stackTrace>
		</avrf:logEntry>
		<avrf:logEntry Time="2020-09-30 : 15:04:20" LayerName="Heaps" StopCode="0x13" Severity="Error">
			<avrf:message>First chance access violation for current stack trace.</avrf:message>
			<avrf:parameter1>c6a4afd8 - Invalid address causing the exception.</avrf:parameter1>
			<avrf:parameter2>7ff878cf6dcc - Code address executing the invalid access.</avrf:parameter2>
			<avrf:parameter3>14c630 - Exception record.</avrf:parameter3>
			<avrf:parameter4>14c140 - Context record.</avrf:parameter4>
			<avrf:stackTrace>
				<avrf:trace>vrfcore!VerifierDisableVerifier+787 ( @ 0)</avrf:trace>
				<avrf:trace>verifier!VerifierStopMessage+b9 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlApplicationVerifierStop+96 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd12825 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd13658 ( @ 0)</avrf:trace>
				<avrf:trace>vfbasics!+7ff89fd12bca ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlIsGenericTableEmpty+1a6 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!RtlRaiseException+1e6 ( @ 0)</avrf:trace>
				<avrf:trace>ntdll!KiUserExceptionDispatcher+2e ( @ 0)</avrf:trace>
				<avrf:trace>XojoGUIFramework64!OvalShapeSegmentsSetter+dfc ( @ 0)</avrf:trace>
			</avrf:stackTrace>
		</avrf:logEntry>
	</avrf:logSession>
</avrf:logfile>

I am still looking at it

Are you using URLConnection? If so, can you temporarily remove that code to see if your app stops crashing?

We use URLConnection to contact our API to get data, I will try to remove all the calls and see if the crashes keep coming

Maybe switch to CURLSMBS class in MBS Xojo CURL Plugin may help as a workaround?

I will try that also

Are you using 64 bit? Can you try compiling to a Win 32 bit version target? I gave up Xojo Win 64 targets waiting for stabilization, since it appeared. :stuck_out_tongue:

Hi,

tried that but still not working sadly. I am trying to create a binary project that I can post on the feedback app.