Open benibela opened 7 months ago
Thank you for the bug report. However, it appears there's a misunderstanding in the approach taken to diagnose the crash report. The disassembled code provided is based on the x86 architecture, which is not fully applicable to the crash context in this case. The crash occurred on a Samsung Galaxy S21 FE 5G device running Android 14 (SDK 34), which uses the ARM architecture, specifically AArch64 for 64-bit ARM processors.
To accurately diagnose the issue, one would need to analyze the crash using an AArch64 disassembler or debugger, as the x86 code and addresses will not correspond to the actual execution path or memory layout on the device where the crash was reported. Adjusting the analysis to focus on the correct architecture is essential for identifying the root cause of the SIGSEGV (Segmentation Fault).
In summary, to move forward with debugging, ensure that the analysis is performed with the correct architecture in mind, focusing on AArch64 rather than x86. This involves doing an analysis directly on the AArch64 liblclapp.so
from the [whatever-stripped-away]arm64_v8a.apk
file, which, in the end, is just a ZIP file with a different file extension. This approach will provide more accurate insights into the crash's root cause by examining the correct instruction set and memory addresses relevant to the device and application in question.
But, however, I'll take a look into it regarding with a prospect towards CurrentChunk.
Here is the correct disassembler (but it is the same file, you can see they both start with a9bf7bfd with reveerse endian)
0000000000234a50 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64>:
PTRPOSCHAR():
components/pascal/import/flre/src/FLRE.pas:5727
const MaskA=TFLREPtrUInt({$ifdef cpu64}$fefefefefefefeff{$else}$fefefeff{$endif}); // it is: 0-$01010101 / 0-$0101010101010101
MaskB=TFLREPtrUInt({$ifdef cpu64}$8080808080808080{$else}$80808080{$endif});
var CurrentChar:PFLRERawByteChar;
CurrentChunk:pptruint;
XorMask,XoredChunk,Size:TFLREPtrUInt;
begin
234a50: a9bf7bfd stp x29, x30, [sp, #-16]!
234a54: 910003fd mov x29, sp
234a58: d10143ff sub sp, sp, #0x50
234a5c: 390003e0 strb w0, [sp]
234a60: f90007e1 str x1, [sp, #8]
234a64: f9000be2 str x2, [sp, #16]
234a68: f9000fe3 str x3, [sp, #24]
components/pascal/import/flre/src/FLRE.pas:5728
result:=-1;
234a6c: 92800000 mov x0, #0xffffffffffffffff // #-1
234a70: f90013e0 str x0, [sp, #32]
components/pascal/import/flre/src/FLRE.pas:5730
Size:=TextLength-Offset;
234a74: f9400be0 ldr x0, [sp, #16]
234a78: f9400fe1 ldr x1, [sp, #24]
234a7c: cb010000 sub x0, x0, x1
234a80: f90027e0 str x0, [sp, #72]
components/pascal/import/flre/src/FLRE.pas:5731
if (Offset<TextLength) and (TFLREPtrInt(Size)>0) then begin
234a84: f9400fe1 ldr x1, [sp, #24]
234a88: f9400be0 ldr x0, [sp, #16]
234a8c: eb00003f cmp x1, x0
234a90: 5400160a b.ge 234d50 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x300> // b.tcont
234a94: f94027e0 ldr x0, [sp, #72]
234a98: f100001f cmp x0, #0x0
234a9c: 540015ad b.le 234d50 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x300>
components/pascal/import/flre/src/FLRE.pas:5733
XorMask:=TFLREUInt8(SearchChar);
234aa0: 394003e0 ldrb w0, [sp]
234aa4: f9001fe0 str x0, [sp, #56]
components/pascal/import/flre/src/FLRE.pas:5734
XorMask:=XorMask or (XorMask shl 8);
234aa8: f9401fe0 ldr x0, [sp, #56]
234aac: d378dc00 lsl x0, x0, #8
234ab0: f9401fe1 ldr x1, [sp, #56]
234ab4: aa000020 orr x0, x1, x0
234ab8: f9001fe0 str x0, [sp, #56]
components/pascal/import/flre/src/FLRE.pas:5735
XorMask:=XorMask or (XorMask shl 16);
234abc: f9401fe0 ldr x0, [sp, #56]
234ac0: d370bc00 lsl x0, x0, #16
234ac4: f9401fe1 ldr x1, [sp, #56]
234ac8: aa000020 orr x0, x1, x0
234acc: f9001fe0 str x0, [sp, #56]
components/pascal/import/flre/src/FLRE.pas:5737
{$ifdef cpu64}
XorMask:=XorMask or (XorMask shl 32);
234ad0: f9401fe0 ldr x0, [sp, #56]
234ad4: d3607c01 lsl x1, x0, #32
234ad8: f9401fe0 ldr x0, [sp, #56]
234adc: aa010000 orr x0, x0, x1
234ae0: f9001fe0 str x0, [sp, #56]
components/pascal/import/flre/src/FLRE.pas:5740
{$endif}
CurrentChar:=@Text[Offset];
234ae4: f94007e1 ldr x1, [sp, #8]
234ae8: f9400fe0 ldr x0, [sp, #24]
234aec: 8b000020 add x0, x1, x0
234af0: f90017e0 str x0, [sp, #40]
components/pascal/import/flre/src/FLRE.pas:5742
if Size>(SizeOf(TFLREPtrUInt)*2) then begin
234af4: f94027e0 ldr x0, [sp, #72]
234af8: f100401f cmp x0, #0x10
234afc: 54001249 b.ls 234d44 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x2f4> // b.plast
components/pascal/import/flre/src/FLRE.pas:5745
// Alignment initialization
CurrentChunk:=pointer(TFLREPtrUInt(TFLREPtrUInt(CurrentChar) and not (SizeOf(TFLREPtrUInt)-1)));
234b00: f94017e0 ldr x0, [sp, #40]
234b04: 927df000 and x0, x0, #0xfffffffffffffff8
234b08: f9001be0 str x0, [sp, #48]
components/pascal/import/flre/src/FLRE.pas:5748
// Try to get first chunk
if TFLREPtrUInt(CurrentChunk)>=TFLREPtrUInt(Text) then begin
234b0c: f9401be0 ldr x0, [sp, #48]
234b10: f94007e1 ldr x1, [sp, #8]
234b14: eb01001f cmp x0, x1
234b18: 540000e3 b.cc 234b34 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0xe4> // b.lo, b.ul, b.last
components/pascal/import/flre/src/FLRE.pas:5750
// Yes, we can the get first chunk
XoredChunk:=CurrentChunk^ xor XorMask;
234b1c: f9401be0 ldr x0, [sp, #48]
234b20: f9400001 ldr x1, [x0]
234b24: f9401fe0 ldr x0, [sp, #56]
234b28: ca010000 eor x0, x0, x1
234b2c: f90023e0 str x0, [sp, #64]
234b30: 14000002 b 234b38 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0xe8>
components/pascal/import/flre/src/FLRE.pas:5753
end else begin
// No, so return dummy value to force to check the few first characters
XoredChunk:=0;
234b34: f90023ff str xzr, [sp, #64]
components/pascal/import/flre/src/FLRE.pas:5757
end;
// Jump to next chunk
inc(CurrentChunk);
234b38: f9401be0 ldr x0, [sp, #48]
234b3c: 91002000 add x0, x0, #0x8
234b40: f9001be0 str x0, [sp, #48]
components/pascal/import/flre/src/FLRE.pas:5760
// Subtract the first chunk from size
dec(TFLREPtrUInt(Size),TFLREPtrUInt(CurrentChunk)-TFLREPtrUInt(CurrentChar));
234b44: f9401be0 ldr x0, [sp, #48]
234b48: f94017e1 ldr x1, [sp, #40]
234b4c: cb010000 sub x0, x0, x1
234b50: f94027e1 ldr x1, [sp, #72]
234b54: cb000021 sub x1, x1, x0
234b58: f90027e1 str x1, [sp, #72]
components/pascal/import/flre/src/FLRE.pas:5763
// Scan first chunk
if (((XoredChunk+MaskA) and not XoredChunk) and MaskB)<>0 then begin
234b5c: f94023e0 ldr x0, [sp, #64]
234b60: b200c3e1 mov x1, #0x101010101010101 // #72340172838076673
234b64: cb010001 sub x1, x0, x1
234b68: f94023e0 ldr x0, [sp, #64]
234b6c: aa2003e0 mvn x0, x0
234b70: 8a010000 and x0, x0, x1
234b74: 9201c000 and x0, x0, #0x8080808080808080
234b78: f100001f cmp x0, #0x0
234b7c: 54000b80 b.eq 234cec <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x29c> // b.none
components/pascal/import/flre/src/FLRE.pas:5764
while TFLREPtrUInt(CurrentChar)<TFLREPtrUInt(CurrentChunk) do begin
234b80: 1400000e b 234bb8 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x168>
components/pascal/import/flre/src/FLRE.pas:5765
if CurrentChar^=SearchChar then begin
234b84: f94017e0 ldr x0, [sp, #40]
234b88: 39400001 ldrb w1, [x0]
234b8c: 394003e0 ldrb w0, [sp]
234b90: 6b00003f cmp w1, w0
234b94: 540000c1 b.ne 234bac <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x15c> // b.any
components/pascal/import/flre/src/FLRE.pas:5766
result:=TFLREPtrUInt(CurrentChar)-TFLREPtrUInt(Text);
234b98: f94017e0 ldr x0, [sp, #40]
234b9c: f94007e1 ldr x1, [sp, #8]
234ba0: cb010000 sub x0, x0, x1
234ba4: f90013e0 str x0, [sp, #32]
components/pascal/import/flre/src/FLRE.pas:5767
exit;
234ba8: 1400006a b 234d50 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x300>
components/pascal/import/flre/src/FLRE.pas:5769
end;
inc(CurrentChar);
234bac: f94017e0 ldr x0, [sp, #40]
234bb0: 91000400 add x0, x0, #0x1
234bb4: f90017e0 str x0, [sp, #40]
components/pascal/import/flre/src/FLRE.pas:5764
while TFLREPtrUInt(CurrentChar)<TFLREPtrUInt(CurrentChunk) do begin
234bb8: f94017e0 ldr x0, [sp, #40]
234bbc: f9401be1 ldr x1, [sp, #48]
234bc0: eb01001f cmp x0, x1
234bc4: 54fffe03 b.cc 234b84 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x134> // b.lo, b.ul, b.last
components/pascal/import/flre/src/FLRE.pas:5774
end;
end;
// Scan until the last whole chunk
while Size>=SizeOf(TFLREPtrUInt) do begin
234bc8: 14000049 b 234cec <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x29c>
components/pascal/import/flre/src/FLRE.pas:5775
XoredChunk:=CurrentChunk^ xor XorMask;
234bcc: f9401be0 ldr x0, [sp, #48]
234bd0: f9400000 ldr x0, [x0]
234bd4: f9401fe1 ldr x1, [sp, #56]
234bd8: ca000020 eor x0, x1, x0
234bdc: f90023e0 str x0, [sp, #64]
components/pascal/import/flre/src/FLRE.pas:5776
if (((XoredChunk+MaskA) and not XoredChunk) and MaskB)<>0 then begin
234be0: f94023e1 ldr x1, [sp, #64]
234be4: b200c3e0 mov x0, #0x101010101010101 // #72340172838076673
234be8: cb000021 sub x1, x1, x0
234bec: f94023e0 ldr x0, [sp, #64]
234bf0: aa2003e0 mvn x0, x0
234bf4: 8a010000 and x0, x0, x1
234bf8: 9201c000 and x0, x0, #0x8080808080808080
234bfc: f100001f cmp x0, #0x0
234c00: 540006a0 b.eq 234cd4 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x284> // b.none
components/pascal/import/flre/src/FLRE.pas:5814
result:=TFLREPtrUInt(pointer(@CurrentChar[7]))-TFLREPtrUInt(Text);
exit;
end;
{$endif}
{$else}
CurrentChar:=pointer({$ifdef BIG_ENDIAN}TFLREPtrUInt(TFLREPtrUInt(CurrentChunk)+TFLREPtrUInt(SizeOf(TFLREPtrUInt)-1)){$else}CurrentChunk{$endif});
234c04: f9401be0 ldr x0, [sp, #48]
234c08: f90017e0 str x0, [sp, #40]
components/pascal/import/flre/src/FLRE.pas:5815
XoredChunk:=XoredChunk xor XorMask;
234c0c: f94023e1 ldr x1, [sp, #64]
234c10: f9401fe0 ldr x0, [sp, #56]
234c14: ca010000 eor x0, x0, x1
234c18: f90023e0 str x0, [sp, #64]
components/pascal/import/flre/src/FLRE.pas:5816
if TFLREUInt8(SearchChar)=0 then begin
234c1c: 394003e0 ldrb w0, [sp]
234c20: 7100001f cmp w0, #0x0
234c24: 54000381 b.ne 234c94 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x244> // b.any
components/pascal/import/flre/src/FLRE.pas:5818
// Special case
XoredChunk:=not XoredChunk;
234c28: f94023e0 ldr x0, [sp, #64]
234c2c: aa2003e0 mvn x0, x0
234c30: f90023e0 str x0, [sp, #64]
components/pascal/import/flre/src/FLRE.pas:5819
while (XoredChunk<>0) and ((XoredChunk and $ff)<>$ff) do begin
234c34: 14000007 b 234c50 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x200>
components/pascal/import/flre/src/FLRE.pas:5820
XoredChunk:=XoredChunk shr 8;
234c38: f94023e0 ldr x0, [sp, #64]
234c3c: d348fc00 lsr x0, x0, #8
234c40: f90023e0 str x0, [sp, #64]
components/pascal/import/flre/src/FLRE.pas:5821
{$ifdef BIG_ENDIAN}dec{$else}inc{$endif}(CurrentChar);
234c44: f94017e0 ldr x0, [sp, #40]
234c48: 91000400 add x0, x0, #0x1
234c4c: f90017e0 str x0, [sp, #40]
components/pascal/import/flre/src/FLRE.pas:5819
while (XoredChunk<>0) and ((XoredChunk and $ff)<>$ff) do begin
234c50: f94023e0 ldr x0, [sp, #64]
234c54: f100001f cmp x0, #0x0
234c58: 540002e0 b.eq 234cb4 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x264> // b.none
234c5c: f94023e0 ldr x0, [sp, #64]
234c60: 92401c00 and x0, x0, #0xff
234c64: f103fc1f cmp x0, #0xff
234c68: 54000260 b.eq 234cb4 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x264> // b.none
234c6c: 17fffff3 b 234c38 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x1e8>
234c70: 14000011 b 234cb4 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x264>
234c74: 14000010 b 234cb4 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x264>
components/pascal/import/flre/src/FLRE.pas:5824
end;
end else begin
while (XoredChunk<>0) and ((XoredChunk and $ff)<>TFLREUInt8(SearchChar)) do begin
234c78: 14000007 b 234c94 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x244>
components/pascal/import/flre/src/FLRE.pas:5825
XoredChunk:=XoredChunk shr 8;
234c7c: f94023e0 ldr x0, [sp, #64]
234c80: d348fc00 lsr x0, x0, #8
234c84: f90023e0 str x0, [sp, #64]
components/pascal/import/flre/src/FLRE.pas:5826
{$ifdef BIG_ENDIAN}dec{$else}inc{$endif}(CurrentChar);
234c88: f94017e0 ldr x0, [sp, #40]
234c8c: 91000400 add x0, x0, #0x1
234c90: f90017e0 str x0, [sp, #40]
components/pascal/import/flre/src/FLRE.pas:5824
while (XoredChunk<>0) and ((XoredChunk and $ff)<>TFLREUInt8(SearchChar)) do begin
234c94: f94023e0 ldr x0, [sp, #64]
234c98: f100001f cmp x0, #0x0
234c9c: 540000c0 b.eq 234cb4 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x264> // b.none
234ca0: f94023e0 ldr x0, [sp, #64]
234ca4: 92401c00 and x0, x0, #0xff
234ca8: 394003e1 ldrb w1, [sp]
234cac: eb01001f cmp x0, x1
234cb0: 54fffe61 b.ne 234c7c <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x22c> // b.any
components/pascal/import/flre/src/FLRE.pas:5829
end;
end;
if XoredChunk<>0 then begin
234cb4: f94023e0 ldr x0, [sp, #64]
234cb8: f100001f cmp x0, #0x0
234cbc: 540000c0 b.eq 234cd4 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x284> // b.none
components/pascal/import/flre/src/FLRE.pas:5830
result:=TFLREPtrUInt(pointer(CurrentChar))-TFLREPtrUInt(Text);
234cc0: f94017e1 ldr x1, [sp, #40]
234cc4: f94007e0 ldr x0, [sp, #8]
234cc8: cb000020 sub x0, x1, x0
234ccc: f90013e0 str x0, [sp, #32]
components/pascal/import/flre/src/FLRE.pas:5831
exit;
234cd0: 14000020 b 234d50 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x300>
components/pascal/import/flre/src/FLRE.pas:5835
end;
{$endif}
end;
inc(CurrentChunk);
234cd4: f9401be0 ldr x0, [sp, #48]
234cd8: 91002000 add x0, x0, #0x8
234cdc: f9001be0 str x0, [sp, #48]
components/pascal/import/flre/src/FLRE.pas:5836
dec(Size,SizeOf(TFLREPtrUInt));
234ce0: f94027e0 ldr x0, [sp, #72]
234ce4: d1002000 sub x0, x0, #0x8
234ce8: f90027e0 str x0, [sp, #72]
components/pascal/import/flre/src/FLRE.pas:5774
while Size>=SizeOf(TFLREPtrUInt) do begin
234cec: f94027e0 ldr x0, [sp, #72]
234cf0: f100201f cmp x0, #0x8
234cf4: 54fff6c2 b.cs 234bcc <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x17c> // b.hs, b.nlast
components/pascal/import/flre/src/FLRE.pas:5840
end;
// Set chunkwise to charwise pointer
CurrentChar:=pointer(CurrentChunk);
234cf8: f9401be0 ldr x0, [sp, #48]
234cfc: f90017e0 str x0, [sp, #40]
components/pascal/import/flre/src/FLRE.pas:5844
end;
// Scan rest of the remained characters, if there are any
while Size>0 do begin
234d00: 14000011 b 234d44 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x2f4>
components/pascal/import/flre/src/FLRE.pas:5845
if CurrentChar^=SearchChar then begin
234d04: f94017e0 ldr x0, [sp, #40]
234d08: 39400001 ldrb w1, [x0]
234d0c: 394003e0 ldrb w0, [sp]
234d10: 6b00003f cmp w1, w0
234d14: 540000c1 b.ne 234d2c <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x2dc> // b.any
components/pascal/import/flre/src/FLRE.pas:5846
result:=TFLREPtrUInt(pointer(CurrentChar))-TFLREPtrUInt(Text);
234d18: f94017e1 ldr x1, [sp, #40]
234d1c: f94007e0 ldr x0, [sp, #8]
234d20: cb000020 sub x0, x1, x0
234d24: f90013e0 str x0, [sp, #32]
components/pascal/import/flre/src/FLRE.pas:5847
exit;
234d28: 1400000a b 234d50 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x300>
components/pascal/import/flre/src/FLRE.pas:5849
end;
inc(CurrentChar);
234d2c: f94017e0 ldr x0, [sp, #40]
234d30: 91000400 add x0, x0, #0x1
234d34: f90017e0 str x0, [sp, #40]
components/pascal/import/flre/src/FLRE.pas:5850
dec(Size);
234d38: f94027e0 ldr x0, [sp, #72]
234d3c: d1000400 sub x0, x0, #0x1
234d40: f90027e0 str x0, [sp, #72]
components/pascal/import/flre/src/FLRE.pas:5844
while Size>0 do begin
234d44: f94027e0 ldr x0, [sp, #72]
234d48: f100001f cmp x0, #0x0
234d4c: 54fffdc8 b.hi 234d04 <FLRE_$$_PTRPOSCHAR$CHAR$PCHAR$INT64$INT64$$INT64+0x2b4> // b.pmore
components/pascal/import/flre/src/FLRE.pas:5854
end;
end;
end;
234d50: f94013e0 ldr x0, [sp, #32]
234d54: 910003bf mov sp, x29
234d58: a8c17bfd ldp x29, x30, [sp], #16
234d5c: d65f03c0 ret
I got a crash report
on samsung r9q (Galaxy S21 FE 5G) with Android 14 (SDK 34)
If I put the address in gdb, it gives
Perhaps something is wrong with CurrentChunk