Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Random crashes on 76.1.13
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Random crashes on 76.1.13
Hi,
Since i updated to 76.1.13, i experienced a lot of random crashes on my app. In runtime, it will simple generate that exception when Windows inform the app needs to be closed. In debug time, it will looping into Delphi's CPU window. Both crashes occurs randomly.
First i thought it was something related to my app, but after days struggling, i rollback CEF4Delphi to 76.1.11 and the crashes stoped.
I don't know why this happened and because they were random and difficult to simulate, i ended up not finding the cause of the crashes. But i'd thought would be useful to inform here.
Will test again when a new version is release, but so far i'm not using 76.1.13.
Since i updated to 76.1.13, i experienced a lot of random crashes on my app. In runtime, it will simple generate that exception when Windows inform the app needs to be closed. In debug time, it will looping into Delphi's CPU window. Both crashes occurs randomly.
First i thought it was something related to my app, but after days struggling, i rollback CEF4Delphi to 76.1.11 and the crashes stoped.
I don't know why this happened and because they were random and difficult to simulate, i ended up not finding the cause of the crashes. But i'd thought would be useful to inform here.
Will test again when a new version is release, but so far i'm not using 76.1.13.
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Random crashes on 76.1.13
I'm sorry to hear that.
Please, let me know if you find anything that could lead to that crash.
Please, let me know if you find anything that could lead to that crash.
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Random crashes on 76.1.13
No problem Salvador, actually i found out the problem is related to my app trying to interact with the page (get html source, execute JS) BEFORE the page is totally completed loading. I started a new thread about it.
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Random crashes on 76.1.13
The random crashes still happens and i'm trying to identify the cause.
What i could find so far is usually the issue happens in a heavy traffic page, like a Facebook page that list thousands of itens. When running the app in Delphi, usually i'll get a 'Out of memory' exception and Delphi opens System.pas unit. Sometimes when i hit F9 , the app will continue running, but sometimes will crash. I'm attaching the image showing the problem.
Because it's random, it's very hard to find out what is happening
What i could find so far is usually the issue happens in a heavy traffic page, like a Facebook page that list thousands of itens. When running the app in Delphi, usually i'll get a 'Out of memory' exception and Delphi opens System.pas unit. Sometimes when i hit F9 , the app will continue running, but sometimes will crash. I'm attaching the image showing the problem.
Because it's random, it's very hard to find out what is happening

You do not have the required permissions to view the files attached to this post.
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Random crashes on 76.1.13
It's not possible to know the cause of that error with that screenshot.
It would be much easier if you could find a repeatable way to reproduce that error or at least create a simple program capable of reproducing that error randomly.
Please, set System.ReportMemoryLeaksOnShutdown to TRUE in the DPR file to see if there are memory leaks even when you don't see the "out of memory" error.
It would be much easier if you could find a repeatable way to reproduce that error or at least create a simple program capable of reproducing that error randomly.
Please, set System.ReportMemoryLeaksOnShutdown to TRUE in the DPR file to see if there are memory leaks even when you don't see the "out of memory" error.
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Random crashes on 76.1.13
Will do that, thanks for the hint !salvadordf wrote: Sun Sep 22, 2019 1:49 pm It's not possible to know the cause of that error with that screenshot.
It would be much easier if you could find a repeatable way to reproduce that error or at least create a simple program capable of reproducing that error randomly.
Please, set System.ReportMemoryLeaksOnShutdown to TRUE in the DPR file to see if there are memory leaks even when you don't see the "out of memory" error.

-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Random crashes on 76.1.13
I could find out that the 'Out of memory' exception usually occurs in pages with a huge html source ; after i tried to retrieve its html source, i see the generated file with the html source has more than 7MB ! Is there any option i should try to set in GlobalCefApp to deal with such big pages ?
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Random crashes on 76.1.13
If you really need to handle huge web pages then I would suggest that you build your application in 64 bits.
32 bits applications have a 2GB limit in Windows, or 3GB if you add the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the DPR file.
I downloaded the "War and Peace" novel, by Leo Tolstoy, from the Gutenberg Project website :
https://www.gutenberg.org/files/2600/2600-0.txt
It's "only" 3MB so I copied it several times inside a HTML file to create a 12MB file with these contents :
Then I used MiniBrowser in 32bits to open it using a FILE url and I clicked the context menu option to copy the HTML to the clipboard.
It worked as expected and I could paste all the HTML into the notepad. This means that perhaps your web page has too many videos or flash contents and you reach the limit for 32 bits applications.
Try disabling all non essential content :
You can also try to register a JavaScript extension to save the HTML directly to a file. This would be executed in the render process and you would avoid any possible issues transferring big chunks of HTML from the render process to the browser process. The JSExtension demo has a context menu option to visit the DOM that uses the JS extension to send the HTML to the browser process but you could save it to a file instead.
32 bits applications have a 2GB limit in Windows, or 3GB if you add the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the DPR file.
I downloaded the "War and Peace" novel, by Leo Tolstoy, from the Gutenberg Project website :
https://www.gutenberg.org/files/2600/2600-0.txt
It's "only" 3MB so I copied it several times inside a HTML file to create a 12MB file with these contents :
Code: Select all
<html><body><pre>...</pre></body></html>
It worked as expected and I could paste all the HTML into the notepad. This means that perhaps your web page has too many videos or flash contents and you reach the limit for 32 bits applications.
Try disabling all non essential content :
- Set GlobalCEFApp.FlashEnabled to FALSE
- Set GlobalCEFApp.DisablePDFExtension to TRUE
- Set GlobalCEFApp.DisableExtensions to TRUE
- Set GlobalCEFApp.AutoplayPolicy to appDocumentUserActivationRequired
- Set GlobalCEFApp.PluginPolicy to PLUGIN_POLICY_SWITCH_BLOCK
- Set GlobalCEFApp.DisableImageLoading to TRUE
- Set GlobalCEFApp.DisablePlugins to TRUE
You can also try to register a JavaScript extension to save the HTML directly to a file. This would be executed in the render process and you would avoid any possible issues transferring big chunks of HTML from the render process to the browser process. The JSExtension demo has a context menu option to visit the DOM that uses the JS extension to send the HTML to the browser process but you could save it to a file instead.
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Random crashes on 76.1.13
Nice insights, thank you very much for that ! Will try do disable things and see what happens.
Thanks again Salvador !
Thanks again Salvador !

-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Random crashes on 76.1.13
Is it possible to change GlobalCEFApp.DisableImageLoading after calling GlobalCEFApp.StartMainProcess ? Or i just have the opportunity once, when the app starts ?