FEX-Emu / FEX

A fast usermode x86 and x86-64 emulator for Arm64 Linux
https://fex-emu.com
MIT License
2.34k stars 123 forks source link

Chromium crashing in PRoot container on Termux #1264

Open AarizYT opened 3 years ago

AarizYT commented 3 years ago

Host Distro: Arch Linux ARM aarch64 Guest RootFS: Arch Linux x86_64

I tried running Chromium using FEX-Emu inside a Termux PRoot container but it crashed. (my whole Termux session crashed)

Here are the log files (with and without --no-silentlog):- log.txt logv.txt

Sonicadvance1 commented 3 years ago

While the logs don't have any strong evidence pointing to the exact failure there could be multiple things at play here. 1) We don't support applications doing real self-modifying code right now. So something like chromium's JIT breaks our JIT. 2) You have an ARMv8.0 CPU without the v8.1 atomics. This could very likely result in emulation bugs atm. We have ARMv8.1 as a real minimum spec. As evident that last time I tested chromium on my ARMv8.2+ device, it was "fine" until it hit some SMC.

Sonicadvance1 commented 3 years ago

Just retested chrome on my ARMv8.2 board and it "worked". Make sure to follow the guide on the wiki for setting up the rootfs: https://wiki.fex-emu.com/index.php/Development:Setting_up_RootFS In particular, make sure to look at the "6.3 File Deletion" section. If you don't remove those files (from the rootfs, not the host!) then it causes chrome issues.

Sonicadvance1 commented 3 years ago

It also looks like your Android kernel doesn't have inotify syscalls enabled? No idea what problems that will cause Chromium, but kernel emulation bits are outside of the scope of FEX.

AarizYT commented 3 years ago

I forgot to remove some files from the RootFS that were supposed to be deleted so I deleted them and Chromium didn't start this time but I got a different log this time.

log3.txt logv3.txt

Sonicadvance1 commented 3 years ago

Now that looks like a real crash due to ARMv8.0 just from the lack of information in the logs. With #1267 merged you might get slightly more information. Also could pass in --no-multiblock to FEXLoader to remove the non-fatal Missing OpDispatcher messages

AarizYT commented 2 years ago

Here's the output:- Log.txt

It crashes with a Segmentation fault so is there a way to get more details?

Sonicadvance1 commented 2 years ago

If you pass in the --no-silent option to FEXLoader then there may be some more logs. Hard to tell though. Chromium is particularly nasty for FEX to handle still. Any web browser does a bunch of JIT code which we don't 100% handle.

AarizYT commented 2 years ago

Here's the output with --no-silent flag:- Log2.txt

Sonicadvance1 commented 2 years ago

Nothing too interesting in that log. I'm going to guess it is the ARMv8.0 atomic problem again which isn't quite 100% solved. I'd guess an ARMv8.1 device wouldn't hit this problem.