Alexander Halser 26 Posted April 21, 2020 I am using TEmbeddedWB (an extended version of TWebBrowser, the "latest" from GitHub from 2011) in a VCL application, where it works just fine. The very same code compiled with 64 bit, however, crashes on some pages/scripts. The crash comes from C:\Windows\System32\jscript9.dll and reads: First chance exception at $00007FFF99D9840. Exception Class $C00000090 with message "c00000090 FLOAT_INVALID_OPERATION' It can be duplicated with a very simple test app in Delphi 10.1 or 10.3. If I use a standard TWebBrowser instead of TEmbeddedWB, it runs fine both as 32 and 64 bit. So I assume it is some declaration issue in one of the old units of TEmbeddedWB, that are not compatible with 64 bit. Any suggestions what to look for in the code? Share this post Link to post
David Heffernan 2345 Posted April 22, 2020 Isn't this just the age old issue that Delphi's RTL unmasks floating point hardware exceptions, but most other tools (including the MS tools) mask them. So the ActiveX control that implements the embedded browser expects floating point hardware exceptions to be masked and is caught out by your host having unmasked them. Resolve the problem in the traditional way by masking floating point hardware exceptions. There are countless SO posts on this subject which will show you how to do this. 4 1 Share this post Link to post
Alexander Halser 26 Posted April 22, 2020 Thank you! This has indeed solved the issue. initialization {$IFDEF WIN64} System.Math.SetExceptionMask(exAllArithmeticExceptions); {$ENDIF} Share this post Link to post
David Heffernan 2345 Posted April 22, 2020 2 hours ago, Alexander Halser said: Thank you! This has indeed solved the issue. initialization {$IFDEF WIN64} System.Math.SetExceptionMask(exAllArithmeticExceptions); {$ENDIF} Do this for both 32 and 64 bit. Just because you might get away with it in 32 bit for now, doesn't mean you always will. And if your app doesn't need floating point exceptions unmasked then mask them. Have consistency between 32 and 64 bit. 2 Share this post Link to post
Attila Kovacs 629 Posted April 22, 2020 20 hours ago, Alexander Halser said: If I use a standard TWebBrowser instead of TEmbeddedWB, it runs fine TWebBrowser is in SHDocVw.pas which has FSetExceptMask(femALLEXCEPT); in the initialization section. I don't know ~WB. Share this post Link to post
Alexander Halser 26 Posted April 22, 2020 Quote TWebBrowser is in SHDocVw.pas which has FSetExceptMask(femALLEXCEPT); That part was missing in the ~WB version. Must have been added in more recent versions of SHDocVw.pas. Share this post Link to post
Joseph MItzen 251 Posted April 23, 2020 23 hours ago, David Heffernan said: Isn't this just the age old issue that Delphi's RTL unmasks floating point hardware exceptions, but most other tools (including the MS tools) mask them. Damn, even floating points have to wear masks right now. 3 Share this post Link to post
saeiddavoody 0 Posted November 8 On 4/22/2020 at 9:16 PM, Alexander Halser said: Thank you! This has indeed solved the issue. initialization {$IFDEF WIN64} System.Math.SetExceptionMask(exAllArithmeticExceptions); {$ENDIF} Hi, Is this solution works on Delphi 12.2? Where should I add your code? Share this post Link to post
Brian Evans 105 Posted November 8 27 minutes ago, saeiddavoody said: Hi, Is this solution works on Delphi 12.2? Where should I add your code? Starting with Delphi 12 they are disabled by default. What's New - RAD Studio - Disabling Floating-Point Exceptions on All Platforms Share this post Link to post
DelphiUdIT 171 Posted November 8 (edited) 30 minutes ago, saeiddavoody said: Hi, Is this solution works on Delphi 12.2? Where should I add your code? Read here: https://docwiki.embarcadero.com/RADStudio/Athens/en/Floating_Point_Operation_Exception_Masks The math exceptions are already masked from AThens 12. P.S.: @Brian Evans sorry, I write concurrently with you. Edited November 8 by DelphiUdIT Share this post Link to post
saeiddavoody 0 Posted November 8 23 minutes ago, Brian Evans said: Starting with Delphi 12 they are disabled by default. What's New - RAD Studio - Disabling Floating-Point Exceptions on All Platforms Thank you, I installed the EmbeddedWB component in Delphi 12.2 . In the sample project When platform is 64 bit the EmbeddedWB1.Navigate statement cause crash and closes the application. What is the problem? Share this post Link to post
saeiddavoody 0 Posted November 8 26 minutes ago, DelphiUdIT said: Read here: https://docwiki.embarcadero.com/RADStudio/Athens/en/Floating_Point_Operation_Exception_Masks The math exceptions are already masked from AThens 12. P.S.: @Brian Evans sorry, I write concurrently with you. Thank you, I explained the problem in previous post. Share this post Link to post
DelphiUdIT 171 Posted November 8 16 minutes ago, saeiddavoody said: Thank you, I explained the problem in previous post. I don't know the EmbeddedWB, so I cannot help you. Sorry. Share this post Link to post