Recent

Author Topic: LAMW: Linux crash in emulator  (Read 1693 times)

iru

  • Sr. Member
  • ****
  • Posts: 321
LAMW: Linux crash in emulator
« on: February 28, 2021, 11:16:24 am »
Gentlefolk,

My environment - Lenovo X240 laptop, Linux Mint 20.1, Lazarus 2.0.10, FPC 3.0.4.

I have worked my way through the various LAMW tutorials in (LAMW/lazandroidmodulewizard/docs/linux) and given issues with the age of some of the tutorials, changes in linux, sdk, gradle, ant revisions, etc I have finally wound up with the following installed by following the tutorial by Daniel Oliveira.

The file ~/LAMW/lamw4linux/lamw-instal.log
Generate LAMW_INSTALL_VERSION=0.3.6.1
Info:
LAMW4Linux:/home/iru/LAMW/lamw4linux
LAMW workspace:/home/iru/Dev/LAMWProjects
Android SDK:/home/iru/LAMW/sdk
Android NDK:/home/iru/LAMW/ndk
Gradle:/home/iru/LAMW/gradle-6.6.1
OLD_ANDROID_SDK=1
ANT_VERSION=1.10.8
GRADLE_VERSION=6.6.1
SDK_TOOLS_VERSION=r25.2.5
NDK_VERSION=r21d
FPC_VERSION=3.2.0
LAZARUS_VERSION=2.0.10
AARCH64_SUPPORT=1
Install-date:Sat 27 Feb 2021 09:31:05 AEDT

Lazarus starts and I can build/compile a LAMW GUI program correctly.

The 'LAMW Build Android Apk and Run' starts and displays the emulator.

No operating system displayed..... Just a blank emulator display and the Android control buttons.

Starting the emulator with '~/LAMW/sdk/tools$ ./emulator -avd avd-3 -show-kernel' displays a lot of data (avd-3 is the LAZ-LAMW output of a simple screen with one button).
.
The first part looks like a reasonable Intel based hardware startup, however then  it appears the Linux OS underneath Android is crashing over and over again. The following below is partial emulator output of the first crash...

I am getting lost in the size and complexity of Android-SDK-Lazarus-LAMW-FPC.
Is the 'kernel' bad, the wrong version....

Any suggestions, brilliant ideas appreciated, help....Ian

emulator: WARNING: userdata partition is resized from 1 M to 2048 M

ERROR: resizing partition e2fsck failed with exit code 8
emulator: Listening for console connections on port: 5556
emulator: Serial number of this emulator (for ADB): emulator-5556
[    0.000000] Linux version 4.14.112+ (android-build@abfarm-us-east1-c-0078) (Android (5657785 based on r353983d) clang version 9.0.4 (https://android.googlesource.com/toolchain/llvm-project 2a90cc9d899e6fe6dcf0da193244b25f75735c7b) (based on LLVM 9.0.4svn)) #1 SMP PREEMPT Fri Sep 13 21:20:42 UTC 2019
[    0.000000] Command line: qemu=1 androidboot.hardware=ranchu clocksource=pit console=ttyS0,38400 android.qemud=1 android.checkjni=1 qemu.gles=0 cma=8M
[    0.000000] x86/fpu: x87 FPU will use FXSAVE
[    0.000000] e820: BIOS-provided physical RAM map:
.
.
.
.
    1.636990] hidraw: raw HID events driver (C) Jiri Kosina
[    1.639666] usbcore: registered new interface driver usbhid
[    1.643228] usbhid: USB HID core driver
[    1.644729] ashmem: initialized
[    1.646110] BUG: unable to handle kernel NULL pointer dereference at         (ptrval)
[    1.648288] IP: goldfish_pipe_device_v1_init+0x13a/0x19d
[    1.649666] PGD 0 P4D 0
[    1.650391] Oops: 0002 [#1] PREEMPT SMP NOPTI
[    1.651504] Modules linked in:
[    1.651535] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.14.112+ #1
[    1.651535] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5.1-0-g8936dbb-20141113_115728-nilsson.home.kraxel.org 04/01/2014
[    1.651535] task:         (ptrval) task.stack:         (ptrval)
[    1.651535] RIP: 0010:goldfish_pipe_device_v1_init+0x13a/0x19d
[    1.651535] RSP: 0000:ffffb0124000bc20 EFLAGS: 00010246
[    1.651535] RAX: ffff9d943f241218 RBX: 0000000000000000 RCX: ffff9d94bf241218
[    1.651535] RDX: ffffffff80000000 RSI: 0000000000000000 RDI: 000000003f241218
[    1.651535] RBP: ffffb0124000bc40 R08: ffffffff7fffffff R09: ffff9d943f241200
[    1.651535] R10: ffff9d943f241200 R11: ffff9d943d56a100 R12: ffff9d943cf4e198
[    1.651535] R13: 0000000000000000 R14: ffff9d943f2ad800 R15: ffff9d943f2ad810
[    1.651535] FS:  0000000000000000(0000) GS:ffff9d943fc00000(0000) knlGS:0000000000000000
[    1.651535] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    1.651535] CR2: 000000000000001c CR3: 000000001f40e000 CR4: 00000000000006b0
[    1.651535] Call Trace:
[    1.651535]  goldfish_pipe_probe+0x9f/0xb4
[    1.651535]  platform_drv_probe+0x52/0xa2
[    1.651535]  driver_probe_device+0x246/0x287
[    1.651535]  __driver_attach+0x72/0x96
[    1.651535]  ? driver_attach+0x1b/0x1b
[    1.651535]  bus_for_each_dev+0x84/0xbf
[    1.651535]  driver_attach+0x19/0x1b
[    1.651535]  bus_add_driver+0x12e/0x200
[    1.651535]  ? pmc_atom_init+0x2af/0x2af
[    1.651535]  driver_register+0x89/0xc8
[    1.651535]  ? pmc_atom_init+0x2af/0x2af
[    1.651535]  __platform_driver_register+0x31/0x33
[    1.651535]  goldfish_pipe_driver_init+0x12/0x14
[    1.651535]  do_one_initcall+0x100/0x1f0
[    1.651535]  ? _raw_spin_unlock_irqrestore+0x8/0x34
[    1.651535]  ? ida_simple_get+0xae/0x114
[    1.651535]  ? preempt_count_add+0x6e/0xbd
[    1.651535]  ? _raw_write_unlock+0x11/0x26
[    1.651535]  ? parameq+0x14/0x57
[    1.651535]  ? repair_env_string+0x17/0x5f
[    1.651535]  ? set_debug_rodata+0x12/0x12
[    1.651535]  ? parse_args+0xeb/0x261
[    1.651535]  kernel_init_freeable+0x180/0x219
[    1.651535]  ? rest_init+0xbc/0xbc
[    1.651535]  kernel_init+0x9/0x131
[    1.651535]  ret_from_fork+0x1f/0x30
[    1.651535] Code: c0 76 0a 48 8b 3c 25 10 50 e1 88 eb 0f 48 c7 c7 00 00 00 80 48 2b 3c 25 68 94 e2 88 48 01 cf 48 89 fb 48 c1 eb 20 49 8b 74 24 10 <89> 5e 1c 49 8b 74 24 10 89 7e 18 49 8b 74 24 10 8b 7e 1c 49 8b
[    1.651535] RIP: goldfish_pipe_device_v1_init+0x13a/0x19d RSP: ffffb0124000bc20
[    1.651535] CR2: 000000000000001c
[    1.651535] ---[ end trace 583e055ca79655f0 ]---

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW: Linux crash in emulator
« Reply #1 on: February 28, 2021, 06:30:51 pm »

Hi. Iru!

Welcome!

Please, plug a "configured for development" real device!
any old [Android 4.3, ...] is good!   But Android 6.0 is recommended....

But if you need play using an emulator ...  "googling"  you will get many tutorial
how to setup one....

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: LAMW: Linux crash in emulator
« Reply #2 on: March 02, 2021, 04:24:27 am »
Thank you for the response.
I have connected an old tablet and the APK load and operate OK.

Another question. If I try and build/compile any of the LAMW/lazandroidmodulewizard/demos/GUI programs I get the following error message it fails with the following message:

Fatal: Cannot find system used by controls. Make sure all ppu files of a package are in its output directory. ppu in wrong directory=/home/iru/LAMW/lamw4linux/usr/lib/fpc/3.2.0/units/arm-android/rtl/system.ppu..

So far I have failed to determine the cause or work out a config change that resolves the error.

Any suggestions?  Ian.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: LAMW: Linux crash in emulator
« Reply #3 on: March 03, 2021, 01:30:21 am »

Quote
So far I have failed to determine the cause or work out a config change that resolves the error.

Can you create and Run a NEW project?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: LAMW: Linux crash in emulator
« Reply #4 on: March 03, 2021, 02:39:50 am »
YES, can create a new project, build/compile, build the APK and run the APK on a tablet. All clean, no errors.

Thankyou for responding, Ian

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1738
Re: LAMW: Linux crash in emulator
« Reply #5 on: March 03, 2021, 07:34:28 am »
You might try to enable more verbosity in the Project Options [-va]. And look at the output of FPC. The message that system.ppu cannot be found can [also] be caused my a mismatch of FPU options or CPU options.

 

TinyPortal © 2005-2018