alogrep 0 Posted March 14 Hi. I have this simple code, where the except block is not entered; n:=0; try d:=100/n; except on E:system.SysUtils.Exception do showmessage(e.message); end; I attached the Options->tools configuration and the Project'sone. May I did something foolish, I uninstalled Madacept with revo Uninstaller, before removing it from the IDE packages? Any way to repair this problem? Share this post Link to post
Remy Lebeau 1393 Posted March 14 (edited) You are invoking floating-point division, not integer division. All floating-point exceptions have been intentionally disabled by default in Delphi 12: http://docwiki.embarcadero.com/RADStudio/Athens/en/What's_New#Disabling_Floating-Point_Exceptions_on_All_Platforms Dividing a floating-point value by 0 used to raise an EDivByZero exception, but by default it no longer does so. This page explains how to restore the old behavior if you really need it: http://docwiki.embarcadero.com/RADStudio/Athens/en/Floating_Point_Operation_Exception_Masks#How_to_Restore_Old_Behavior Edited March 14 by Remy Lebeau 1 Share this post Link to post
alogrep 0 Posted March 14 Thanks. Ok that was just for testing. However I do not get any exception notifications aymore. If there is any erro, the App just stops the execution. Sometimes it freezes completely. Share this post Link to post
alogrep 0 Posted March 14 Now whatever esception happens it is catched IFF it is inside a try/except block. Otherwise it is ignored and the app goes to a arandom part of the application (mostly it returns to the form that contains the code that was being executed) Share this post Link to post
Rollo62 536 Posted March 15 (edited) 12 hours ago, Remy Lebeau said: http://docwiki.embarcadero.com/RADStudio/Athens/en/Floating_Point_Operation_Exception_Masks#How_to_Restore_Old_Behavior Thanks for pointing to this nice page, which shows the overview of old and new behaviour nicely. http://docwiki.embarcadero.com/RADStudio/Athens/en/Floating_Point_Operation_Exception_Masks I've tried to summarize that and make the relevant differences even more visible in this overview: Edited March 15 by Rollo62 Share this post Link to post
David Heffernan 2345 Posted March 15 57 minutes ago, Rollo62 said: Thanks for pointing to this nice page, which shows the overview of old and new behaviour nicely. http://docwiki.embarcadero.com/RADStudio/Athens/en/Floating_Point_Operation_Exception_Masks I've tried to summarize that and make the relevant differences even more visible in this overview: I was interested to see different behaviour between VCL and FMX on Windows, in pre Delphi 12. I'm not sure that this is especially intentional. It happens because FMX.Platform.Win uses FMX.WebBrowser which uses FMX.WebBrowser.Win which uses System.Win.InternetExplorer which does this in its initialization FSetExceptMask(femALLEXCEPT); I guess it does this because this the IE library implementation expects exceptions to be masked. Similarly a default FMX app will use Winapi.EdgeUtils which also masks exceptions for the same reason. I actually think it makes sense to have all platforms behaving the same way and exceptions being masked by default. That being the platform standard on all of these platforms. Myself, I'm going to keep unmasking exceptions because my codebase relies on that. I hope that the Delphi RTL will continue supporting being used with exceptions unmasked. Share this post Link to post
Rollo62 536 Posted March 15 (edited) 2 hours ago, David Heffernan said: I'm not sure that this is especially intentional. It happens because FMX.Platform.Win uses FMX.WebBrowser which uses FMX.WebBrowser.Win which uses System.Win.InternetExplorer which does this in its initialization The exception mask is touched by a few internet or browser related units: Quote \source\internet\SHDocVw.pas [1] \source\internet\SHDocVw.pas(6852): FSetExceptMask(femALLEXCEPT); \source\internet\Web.ApacheApp.pas [2] \source\internet\Web.ApacheApp.pas(98): FSetExceptMask($32); \source\internet\Web.ApacheApp.pas(115): FSetExceptMask(PrevFMask); \source\rtl\common\System.Math.pas [1] \source\rtl\common\System.Math.pas(7069): FSetExceptMask(MaskBits); \source\rtl\common\System.Win.InternetExplorer.pas [1] \source\rtl\common\System.Win.InternetExplorer.pas(5407): FSetExceptMask(femALLEXCEPT); \source\rtl\sys\System.pas [5] \source\rtl\sys\System.pas(2649): function FSetExceptMask(NewMasks: UInt32; ExceptMasks: UInt32 = femALLEXCEPT): UInt32; \source\rtl\sys\System.pas(7431): function FSetExceptMask(NewMasks: UInt32; ExceptMasks: UInt32 = femALLEXCEPT): UInt32; \source\rtl\sys\System.pas(7566): function FSetExceptMask(NewMasks: UInt32; ExceptMasks: UInt32 = femALLEXCEPT): UInt32; \source\rtl\sys\System.pas(7904): function FSetExceptMask(NewMasks: UInt32; ExceptMasks: UInt32): UInt32; \source\rtl\sys\System.pas(16815): OldExceptMask := FSetExceptMask(femUNDERFLOW, femUNDERFLOW); \source\rtl\win\Winapi.EdgeUtils.pas [1] \source\rtl\win\Winapi.EdgeUtils.pas(317): FSetExceptMask(femALLEXCEPT); I'm not too deep in the exploration of the ExceptionMask-business, but probably it would make sense, to separate those concerns, by units with specific defines in a conditional compilational way. That way, standard-apps ( without internet / browser ) will be able to have all equal settings over all platforms, right? Only when using a browser, then this would need to be considered as a separate case. I'm not sure what the pro's and con's would be. To be honest, the internet is everywhere nowadays, an assumption that the browser is available by default, is a fair choice too. Edited March 15 by Rollo62 Share this post Link to post
Lajos Juhász 293 Posted March 15 2 minutes ago, Rollo62 said: That way, standard-apps ( without internet / browser ) will be able to have all equal settings over all platforms, right? Only when using a browser, then this would need to be considered as a separate case. I'm not sure what the pro's and con's would be. To be honest, the internet is everywhere nowadays, an assumption that the browser is available by default, is a fair choice too. No. The change was made to follow the Windows standard. Other languages assume or will change the exception masks. That was fragile in previous versions of the Delphi. They made the change to follow other languages and minimalize the possibilities to have problems when calling an external DLL. The price is that we have to adjust our code. Share this post Link to post
David Heffernan 2345 Posted March 15 4 hours ago, Lajos Juhász said: No. The change was made to follow the Windows standard. Other languages assume or will change the exception masks. That was fragile in previous versions of the Delphi. They made the change to follow other languages and minimalize the possibilities to have problems when calling an external DLL. The price is that we have to adjust our code. The point I think is that FMX projects masked exceptions previously by accident rather than design. Why should making an empty FMX project bring in all those units and change the floating point control state? I understand why the change to the default was made. I kind of agree with it. But changing your code to match isn't always going to be easy. I think it would be a huge task for any code base that is heavily numerical. I certainly wouldn't change. Share this post Link to post