Recent

Author Topic: Android 8 crash  (Read 4529 times)

BeniBela

  • Hero Member
  • *****
  • Posts: 777
    • homepage
Android 8 crash
« on: October 15, 2017, 07:30:45 pm »
Has anyone tried anything on Android 8? Google has blocked many syscalls for "security" reasons

My app crashs on startup on its emulator

Code: [Select]
10-15 19:13:52.044  6375  6375 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-15 19:13:52.044  6375  6375 F DEBUG   : Build fingerprint: 'google/sdk_gphone_x86/generic_x86:8.0.0/OSR1.170901.008/4328566:userdebug/dev-keys'
10-15 19:13:52.044  6375  6375 F DEBUG   : Revision: '0'
10-15 19:13:52.044  6375  6375 F DEBUG   : ABI: 'x86'
10-15 19:13:52.044  6375  6375 F DEBUG   : pid: 6353, tid: 6353, name: ibela.videlibri  >>> de.benibela.videlibri <<<
10-15 19:13:52.044  6375  6375 F DEBUG   : signal 31 (SIGSYS), code 1 (SYS_SECCOMP), fault addr --------
10-15 19:13:52.044  6375  6375 F DEBUG   : Cause: seccomp prevented call to disallowed x86 system call 13
10-15 19:13:52.044  6375  6375 F DEBUG   :     eax 0000000d  ebx bfb925d8  ecx ae4a6ab4  edx bfb925d8
10-15 19:13:52.044  6375  6375 F DEBUG   :     esi 8e4949c0  edi 00000009
10-15 19:13:52.044  6375  6375 F DEBUG   :     xcs 00000073  xds 0000007b  xes 0000007b  xfs 0000003b  xss 0000007b
10-15 19:13:52.044  6375  6375 F DEBUG   :     eip ae4a6ac4  ebp bfb925b8  esp bfb92598  flags 00000202
10-15 19:13:52.525  6375  6375 F DEBUG   : backtrace:
10-15 19:13:52.525  6375  6375 F DEBUG   :     #00 pc 00000ac4  [vdso:ae4a6000] (__kernel_vsyscall+16)
10-15 19:13:52.525  6375  6375 F DEBUG   :     #01 pc 000c9062  /data/app/de.benibela.videlibri-wv6hb2Liin-hdGUMUHOiNw==/lib/x86/liblclapp.so
10-15 19:13:52.525  6375  6375 F DEBUG   :     #02 pc 000ca065  /data/app/de.benibela.videlibri-wv6hb2Liin-hdGUMUHOiNw==/lib/x86/liblclapp.so
10-15 19:13:52.526  6375  6375 F DEBUG   :     #03 pc 000eed37  /data/app/de.benibela.videlibri-wv6hb2Liin-hdGUMUHOiNw==/lib/x86/liblclapp.so
10-15 19:13:52.526  6375  6375 F DEBUG   :     #04 pc 00389b23  /system/lib/libart.so (_ZN3art9JavaVMExt17LoadNativeLibraryEP7_JNIEnvRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocat

I think that is syscall sys_time.


marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9090
  • FPC developer.
Re: Android 8 crash
« Reply #1 on: October 15, 2017, 07:48:49 pm »
Did you ever try to compile with -dFPC_USE_LIBC ? The whole RTL i mean

BeniBela

  • Hero Member
  • *****
  • Posts: 777
    • homepage
Re: Android 8 crash
« Reply #2 on: October 15, 2017, 08:16:37 pm »
No

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9090
  • FPC developer.
Re: Android 8 crash
« Reply #3 on: October 15, 2017, 09:00:50 pm »
That switches the RTL to use libc as much as possible, giving you a better chance.

BeniBela

  • Hero Member
  • *****
  • Posts: 777
    • homepage
Re: Android 8 crash
« Reply #4 on: October 15, 2017, 11:26:59 pm »

Code: [Select]
$ sudo make crossinstall OS_TARGET=android CPU_TARGET=i386 PP=$localcompiler OPT=-dFPC_USE_LIBC 
....
/usr/bin/ppcx64 -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/home/theo/opt/fpc-trunk/rtl/units/x86_64-linux -Fix86_64 -FE. -FUx86_64/units/x86_64-linux -Cg -dRELEASE -dFPC_USE_LIBC   -dx86_64 -dGDB -dBROWSERLOG -Fux86 -Sew pp.pas
pp.pas(234,1) Warning: "crtbeginS.o" not found, this will probably cause a linking failure
pp.pas(234,1) Warning: "crtendS.o" not found, this will probably cause a linking failure
/usr/bin/ld: warning: ./link.res contains output sections; did you forget -T?
pp.pas(234,1) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
make[4]: *** [Makefile:4143: ppc] Fehler 1
make[4]: Verzeichnis „/home/theo/opt/fpc-trunk/compiler“ wird verlassen
make[3]: *** [Makefile:4226: cycle] Fehler 2
make[3]: Verzeichnis „/home/theo/opt/fpc-trunk/compiler“ wird verlassen
make[2]: *** [Makefile:2901: compiler_cycle] Fehler 2
make[2]: Verzeichnis „/home/theo/opt/fpc-trunk“ wird verlassen
make[1]: *** [Makefile:2933: build-stamp.i386-android] Fehler 2
make[1]: Verzeichnis „/home/theo/opt/fpc-trunk“ wird verlassen
make: *** [Makefile:3001: crossinstall] Fehler 2


Should I have used CROSSOPT ?

Code: [Select]
$ sudo make crossinstall OS_TARGET=android CPU_TARGET=arm PP=$localcompiler CROSSOPT=-dFPC_USE_LIBC 
....
/usr/bin/mkdir -p /home/theo/opt/fpc-trunk/rtl/units/arm-android
arm-linux-androideabi-as  -o /home/theo/opt/fpc-trunk/rtl/units/arm-android/prt0.o arm/prt0.as
arm-linux-androideabi-as  -o /home/theo/opt/fpc-trunk/rtl/units/arm-android/dllprt0.o arm/dllprt0.as
/home/theo/opt/fpc-trunk/compiler/ppcrossarm -Ur -Tandroid -Parm -XParm-linux-androideabi- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -Fi../linux -Fi../linux/arm -FE. -FU/home/theo/opt/fpc-trunk/rtl/units/arm-android -darm -dRELEASE -dFPC_USE_LIBC -Us -Sg ../linux/system.pp
osmacro.inc(103,11) Error: overloaded functions have the same parameter list
oscdeclh.inc(109,15) Error: Found declaration: FpFstat(LongInt;var Stat):LongInt; CDecl;
osmacro.inc(109,11) Error: overloaded functions have the same parameter list
oscdeclh.inc(110,15) Error: Found declaration: fpLstat(PChar;PStat):LongInt; CDecl;
osmacro.inc(115,11) Error: overloaded functions have the same parameter list
oscdeclh.inc(111,15) Error: Found declaration: FpStat(PChar;var Stat):LongInt; CDecl;
sysandroid.inc(27,13) Error: Identifier not found "do_syscall"
sysandroid.inc(27,24) Error: Identifier not found "syscall_nr_fcntl"
sysandroid.inc(27,42) Error: Identifier not found "TSysParam"
system.pp(394) Fatal: There were 9 errors compiling module, stopping
Fatal: Compilation aborted
make[4]: *** [Makefile:3590: system.ppu] Fehler 1
make[4]: Verzeichnis „/home/theo/opt/fpc-trunk/rtl/android“ wird verlassen
make[3]: *** [Makefile:2810: android_all] Fehler 2
make[3]: Verzeichnis „/home/theo/opt/fpc-trunk/rtl“ wird verlassen
make[2]: *** [Makefile:2644: rtl_all] Fehler 2
make[2]: Verzeichnis „/home/theo/opt/fpc-trunk“ wird verlassen
make[1]: *** [Makefile:2937: build-stamp.arm-android] Fehler 2
make[1]: Verzeichnis „/home/theo/opt/fpc-trunk“ wird verlassen
make: *** [Makefile:3001: crossinstall] Fehler 2


yuriy_sydorov

  • Full Member
  • ***
  • Posts: 157
Re: Android 8 crash
« Reply #5 on: October 17, 2017, 08:58:24 pm »
Should be fixed in r37480 of FPC trunk.

francesco

  • Newbie
  • Posts: 2
Re: Android 8 crash
« Reply #6 on: October 27, 2017, 05:52:02 pm »
Hi,
I have the same crash. I've tried the last development version of FPC but I still have the the same issue.
Has anyone managed to solve it?
Thanks
Bye

BeniBela

  • Hero Member
  • *****
  • Posts: 777
    • homepage
Re: Android 8 crash
« Reply #7 on: October 27, 2017, 07:52:54 pm »
I did not have this crash in the emulator after updating to r37480  :)

(although it added this one on linux. something is always broken  >:()

francesco

  • Newbie
  • Posts: 2
Re: Android 8 crash
« Reply #8 on: November 21, 2017, 10:10:28 am »
Hi,
I tried to install fpc trunk r37480 with fpcupdeluxe, both on windows 8.1 and Ubuntu 16.04 but 
I still have the problem.
How do you solve it?

Thanks

 

TinyPortal © 2005-2018