fpc_LibInitializeUnits crashes on x86 Android
Original Reporter info from Mantis: BeniBela @benibela
-
Reporter name: Benito van der Zander
Original Reporter info from Mantis: BeniBela @benibela
- Reporter name: Benito van der Zander
Description:
fpc_LibInitializeUnits cannot write to IsLibrary anymore.
Probably nothing can write to any global variable
(gdb) disassemble
Dump of assembler code for function fpc_libinitializeunits:
0x96f54640 <+0>: lea esp,[esp-0xc]
0x96f54644 <+4>: mov DWORD PTR [esp],ebx
0x96f54647 <+7>: mov DWORD PTR [esp+0x4],esi
0x96f5464b <+11>: call 0x96f476e0 <SYSTEM_$$_FPC_GETEIPASECX$$POINTER>
0x96f54650 <+16>: add ecx,0x19b5fc
0x96f54656 <+22>: mov esi,ecx
0x96f54658 <+24>: mov eax,DWORD PTR [esi+0x5b40]
=> 0x96f5465e <+30>: mov BYTE PTR [eax],0x1
0x96f54661 <+33>: mov eax,DWORD PTR [esi+0x4ee8]
0x96f54667 <+39>: mov BYTE PTR [eax],0x1
0x96f5466a <+42>: mov ebx,esi
0x96f5466c <+44>: call 0x96f545c0 <fpc_initializeunits>
0x96f54671 <+49>: mov ebx,DWORD PTR [esp]
0x96f54674 <+52>: mov esi,DWORD PTR [esp+0x4]
0x96f54678 <+56>: lea esp,[esp+0xc]
0x96f5467c <+60>: ret
End of assembler dump.
(gdb) print/x $eax
$9 = 0x970f6770
That does not look like a writeable address:
/proc/maps:
96f16000-970ee000 r-xp 00000000 fc:00 336 /data/app/de.benibela.videlibri.debug-L0gf5huaCqbDOhNLKP_FYw==/lib/x86/liblclapp.so
970ee000-970ef000 ---p 00000000 00:00 0
970ef000-97167000 r--p 001d8000 fc:00 336 /data/app/de.benibela.videlibri.debug-L0gf5huaCqbDOhNLKP_FYw==/lib/x86/liblclapp.so
Additional information:
$ ~/bin/i686-linux-android-ld.bfd --version
GNU ld (GNU Binutils) 2.27.0.20170315
Mantis conversion info:
- Mantis ID: 35641
- OS: Android
- OS Build: 8
- Build: r40721
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 44002 (#392fc0b6)