URLConnection In Windows - Crashing

Hi all,

I have a question regarding the deployment of a database intensive app on Windows 10. On Mac the app runs flawlessly, in Windows I get random shutdowns on the software. These cannot be replicated or repeated, the app simply shuts down. From what I have read here in the Forum, the problem seems to be arising in the URLConnection / Xojo.Net.HTTPSocket.

Originally I made use of the mysql engine and this worked absolutely fine - under both Mac and Windows. The problem is that for this to work, the program needs a persistent database connection - here by us in Africa that is not an easy thing to achieve and establishing a reliable connection via the internet…

So the program was redeveloped using an API. In that way we have reduced network traffic by 95%. Works absolutely brilliantly and reliably on Mac, problems to no end on Windows.

I have spent the last week intensively hunting down the problem, changed all the connections from xojo.net.httpsockets to URLConnections. Sometimes the app will run for hours, no problem, other times it terminates on startup or after a few seconds (tracing the error gives something with WinGUIF.dll - can’t remember it exactly now).

I have also changed the Listboxes to using NoHeaders etc. Problem remains.

Any ideas would be helpful, otherwise this may just be the end of Xojo for me (that after many, many years all the way back from the early versions of Real Basic). This new software forms the basis of a new business venture, and if it is not stable, its a no-go. Thank you for reading this post and regards from Walvis Bay in Namibia.

PS: Using third party plugins is a no-no for us. With our exchange rates and limited budgets, this option becomes way to expensive.

Had an issue like that with random crashes using URLConnection on Windows only (worked fine on MacOS)

  • Are you checking that the control still exists when you receive the response in ContentReceived ?
  • On the close on the window or object that made the call, I added the disconnect of all pending URLConnection requests (created a super that handle this on the close event)

Maybe that will help you narrow down the issue

Thank you Julien,

I will give that I try - especially the Disconnect. I just assumed that the connection would terminate itself anyway. Will also do a status check at the beginning of the ContentReceived Event.

Will let you know.

Thank you.

According to the Windows Event Viewer, the App runs into an Application Error, faulting module is XojoGUIFramework64.dll, Exception Code is 0xc0000005.

What version of Xojo are you using and how are you doing your URLConnection, sendsync/send/property on window/global/addhandler etc.?

Hi Julien,

I am on 2021r2.1 - using the URLConnection in Async mode with a SEND command.

A.

Have you dropped URLConnection on a window, added a property, or some other method?

A 0xc0000005 is an access violation error. Probably something corrupted/crashing IN SUCH machine. Open the Windows Event Viewer and try to see if you get more hints from the logs.

Check if you are not trying to access released/being released resources in some window. If not, if the culprit could be the DLL, try to reinstall Xojo and see if it fixes it.

Thanks Rick,

I am busy going through the code to see if I’m dropping connections somewhere. The strange thing is that the drop outs are completely random and not repeatable. It seems to be the XojoGUIFramework64.dll that is the culprit. I know there was an issue with the Has Header option in Listboxes that was causing problem too. Busy going through the code to check if there are any problems. I have tried reinstalling, even tried installing a Windows version of Xojo and compile in that - that is even worse (and it gives no exception errors or anything in Xojo, the app just quits)… On Mac the program runs flawlessly and totally reliable.

A.

Windows have different timing resolution (slower), bugs related to timers sometimes shows in one or another. Timers and threads are some usual originators of memory access bugs.

Looking back at my notes, I was having random crashes in Windows using Xojo 2019R1 and URLConnection.
See discussion at 2019 R1 Xojo.net.HTTPSocket and URLConnection - General - Xojo Programming Forum

Some of these bugs may have been fixed, but perhaps new ones were introduced?

Also, my code has a note that doing anything in the URLConnection.SendingProgressed() event could lead to crashes on Windows. Perhaps try removing that code and see if it helps?

Thanks Rick, I’ll give that one a try. I do have a timer firing on the main screen every second to get the system time.

^^

Hi Julian, not that I can find. What I did do however, was to make sure that all ContentReceived events end in a Socket disconnect. I have also changed over all sockets from Xojo.Net.HTTPSockets to URLConnections. Interestingly, the old Xojo sockets needed a memory block in the send command. The new URLSockets use a string - so I dropped the use of all memory blocks in the app. So far it seems to run stably.

Thanks for your suggestions,
A.

1 Like