Joined72 1 Posted Monday at 02:54 PM Can anyone tell me why raising a hardware exception like an Access Violation crashes a 64-bit Android application, starting with Delphi 12.3 (including Delphi 13), but not up to Delphi 11.3? PS: On 32-bit Android, it works fine in any version of Delphi. Share this post Link to post
DelphiUdIT 268 Posted Monday at 03:55 PM 56 minutes ago, Joined72 said: Can anyone tell me why raising a hardware exception like an Access Violation crashes a 64-bit Android application, starting with Delphi 12.3 (including Delphi 13), but not up to Delphi 11.3? PS: On 32-bit Android, it works fine in any version of Delphi. You must give us more informations and you must try to debug the application to see where it crash. After that post some part of relevant source code. We do not have the magical globe. Share this post Link to post
Joined72 1 Posted Monday at 04:52 PM put PByte(nil)^ := 0; into a TButton OnClick event and run WITHOUT debug on Andoird 64bit That's all. 1 Share this post Link to post
DelphiUdIT 268 Posted Monday at 05:57 PM 57 minutes ago, Joined72 said: PByte(nil)^ := 0; Are you kidding me Why would you do something like this? It definitely crash the app. You deferencing a nil pointer (and this is already a mistake), and you write inside too. 1 Share this post Link to post
Joined72 1 Posted Monday at 07:50 PM I'm just simulating a real Access Violation and on Win32/Win64 the same code only show the classic "EAccessViolation" error message box, while on Android 64bit crashes the app completely but on Android 32bit works as on Win32/Win64 (showing the same EAccessViolation Error message box). Share this post Link to post
DelphiUdIT 268 Posted Monday at 09:05 PM (edited) @Joined72 I tested it on old system and it's true that in Android 64 the app crash. But I tested various exceptions and only this particolar form of literal dereferencing crash the application. PByte(nil)^ //<---- this is what in Android 64 crash the app. Also other type of pointer like "PInteger(nil)^" do the same. var a: pointer; a := nil; PByte(a)^ //<---- this throw an exception If you dereference a normal variabile wich value is nil, an exception will throw but the application still run. If no other person on the forum can help, open an issue on QP. Even if that kind of "writing" doesn't make sense, it still shouldn't crash the program. P.S.: Try / except block doesn't work, the application crash inside. Edited Monday at 09:10 PM by DelphiUdIT Share this post Link to post
Joined72 1 Posted Tuesday at 09:34 AM (edited) 12 hours ago, DelphiUdIT said: @Joined72 I tested it on old system and it's true that in Android 64 the app crash. But I tested various exceptions and only this particolar form of literal dereferencing crash the application. PByte(nil)^ //<---- this is what in Android 64 crash the app. Also other type of pointer like "PInteger(nil)^" do the same. var a: pointer; a := nil; PByte(a)^ //<---- this throw an exception Can you explain how the PByte(a)^ simple throw the exception? If I use PByte(a)^ := 0; I see the same crash. Edited Tuesday at 09:34 AM by Joined72 Share this post Link to post
DelphiUdIT 268 Posted Tuesday at 12:24 PM 2 hours ago, Joined72 said: Can you explain how the PByte(a)^ simple throw the exception? Assign it to a byte var for example, or try to use an helper (.toString) or .... Share this post Link to post