DelphiEncryptionCompendium icon indicating copy to clipboard operation
DelphiEncryptionCompendium copied to clipboard

application in android32 release mode hangs in splash screen

Open dkounal opened this issue 3 years ago • 7 comments

I use Delphi 10.4.2 and I have Oneplus7 android 11

Steps to reproduce the behavior: Just add DECCiphers in uses list in an activity, compile it in Android 32bit release mode, default settings: a) run it without debugging from IDE and it hangs on splash screen. b) run it with debugging from IDE and it gives error: Project .apk raised exception class Bus Error (10) (see image for stack/memory) c) playing with Compiling options and rebuild it after each change: i) Turning off optimization, the problem is solved ii) If "Debug Information" or "Limited Debug information" is selected again the problem is solved.

In debug mode or in both modes of android64, everything is ok

The "exception class Bus Error" is described in the following link as a problem of the compiler for android32 with packed classes: https://support.tmssoftware.com/t/exception-class-bus-error-when-saving-file/3623

DEC error

dkounal avatar Jul 29 '21 14:07 dkounal

  1. Can this have the same cause as this one? https://github.com/MHumm/DelphiEncryptionCompendium/issues/26
  2. What happens if you disable automatic registration of all cipher classes?

MHumm avatar Jul 29 '21 19:07 MHumm

I disabled initialization section of DECCiphers.pas but then problem persists

dkounal avatar Jul 29 '21 20:07 dkounal

I have disabled also initialization section of DECFormatBase, DECCipherBase, DECCRC and the problems stops

dkounal avatar Jul 29 '21 20:07 dkounal

Interesting research results you have.

I have the same crash with this code: `unit MainForm;

interface

uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls;

type TForm2 = class(TForm) Button1: TButton; Label1: TLabel; procedure Button1Click(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end;

var Form2: TForm2;

implementation

uses DECHash;

{$R *.fmx}

procedure TForm2.Button1Click(Sender: TObject); var Hash: THash_MD5; begin

Hash := THash_MD5.Create; Try sleep(1000); Finally Hash.Free; End;

Label1.Text := 'Finished'; end;

end.`

As you can see that only uses DECHash and what DECHash uses. It leads to the same error and when disabling the code in the initialization sections of DECHash, DECCRC and DECFormatBase it doesn't help.

There is a closed QP report about something maybe related: https://quality.embarcadero.com/browse/RSP-18188

It talks about packed records, which are used in DEC as well, but I don't know yet why they are used in DEC.

MHumm avatar Jul 29 '21 20:07 MHumm

This problem should exist also in Delphi 10.3.3 as it says in the above link from tmssoftware. How possible do you believe it can be fixed in DEC?

dkounal avatar Jul 29 '21 21:07 dkounal

it seems to be a compiler problem and there are reports for that: https://quality.embarcadero.com/browse/RSP-32457 https://quality.embarcadero.com/browse/RSP-18188 https://quality.embarcadero.com/browse/RSP-17299

dkounal avatar Jul 30 '21 07:07 dkounal

That may be a compiler bug, but maybe you can narrow it down further so we can check which one if anyone of those and maybe even work around those? Example: I saw now, that DEC often uses packed records, but I don't know yet for which reason...

MHumm avatar Jul 30 '21 11:07 MHumm