Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcef.so can't be loaded in Ubuntu 23.10 for RaspberryPi #457

Open
salvadordf opened this issue Apr 18, 2023 · 15 comments
Open

libcef.so can't be loaded in Ubuntu 23.10 for RaspberryPi #457

salvadordf opened this issue Apr 18, 2023 · 15 comments
Labels

Comments

@salvadordf
Copy link
Owner

salvadordf commented Apr 18, 2023

There's an initialization issue in Ubuntu 23.10 for RaspberryPi (ARM CPU).

libcef.so can't be loaded and GlobalCEFApp.StartMainProcess fails with a blank background.

Perhaps chromium has changed the default TLS model.

Workaround :
Open a terminal window and execute the following command :
export LD_PRELOAD=<FULL-PATH-TO-libcef.so>
Then run the GTK3 demos.

Original forum thread :
https://forum.lazarus.freepascal.org/index.php/topic,62987.0.html

CEF forum thread :
https://magpcss.org/ceforum/viewtopic.php?f=6&t=19622#p54408

CEF issue :
chromiumembedded/cef#3616

Chromium issue :
https://bugs.chromium.org/p/chromium/issues/detail?id=1508362

@afuriza
Copy link

afuriza commented Apr 21, 2023

In X86 Linux it works fine with GTK3, I am using the 109.1.11 version but I also have the same problem, it doesn't show any error but a blank screen in ARM or AArch64.
image

Also, I can't run simplecef in ARM or AArch64, it doesn't give any output in console. No matter which version, 112 or 109.
image

Is not this the bug of the CEF builds from Spotify CDN?

@rcla
Copy link

rcla commented Apr 21, 2023

@afuriza

I use the version that @salvadordf recommended "CEF 106.1.1 which includes Chromium 106.0.5249.119"

Release 106.0.5249.119

And I download the Sample application and run "cefsimple" and it works without problems inside Ubuntu Desktop arm64 and Fedora 37 aarch64
Download Cefsimple arm64

cefsimple running on Fedora aarch64:
cefsimple

Please note that LCL widget type "gtk3" is in "alpha" stage.

@afuriza
Copy link

afuriza commented Apr 21, 2023

@rcla Thank you, that helps me a lot. I'll try the version 106.

@afuriza
Copy link

afuriza commented Apr 22, 2023

I just tested the "cefsimple" in Ubuntu AArch64, it works but blank window on any demo from CEF4Delphi without any error or any log produced.

@jwj76
Copy link

jwj76 commented May 31, 2023

I also encountered the same problem on Linuxarm64. Using getconf PAGESIZE, it is 65536. Some people say that the PAGESIZE of libcef.so is 4096, and all errors occur. Is it possible? How to solve it?

@jwj76
Copy link

jwj76 commented Jun 2, 2023

Using ldd libcef.so to display the results is not a dynamic executable.

Use/lib64/ld Linux arrch64. so. 1-- list libcef. so

Elf load command alignment not page aligned

Readelf - l libcef.so returns a load segment size of 0x1000 (4K)

Getconf PAGESIZE, which is 65536 (64K)

Use file libcef.so to check if it is normal.

The CEF version used is 87.0.4280.141.

@salvadordf
Copy link
Owner Author

I tried to use cmem but LoadLibrary also returns 0.
I still need to learn a lot about programming in Linux to debug this issue.

@jwj76
Copy link

jwj76 commented Nov 1, 2023

For CEF4_87. 0.4280.141 LinuxAarch64 cannot be getconf PAGESIZE system of 64 k. Since Chromium will not be compiled, the following attempts can only be made:
The platform is:
Ubuntu Server 20.04 arm64 pagesize=4k
CEF4_87.0.4280.141LinuxArmhf pagesize=64K

  1. Use dpkg --add-architecture armhf
    Added Armhf runtime support.
  2. Use apt to increase the dependency packages required by CEF. Note that apt install xxxx:armhf is used to add the package. Also use ln -s /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so3 to install the loader.
  3. After all the dependencies are added, CEF can run normally and display web pages.
    Question:
    Perform the following operations in the Kylin arm64 pagesize=64K environment.
  4. Copy all files of /lib/arm-linux-gnueabihf in Ubuntu to the corresponding directory of Kylin.
  5. Since the pagesize of libLLVM-15.so.1 =4k, find the libLLVM15 for armhf dependency package with pagesize=64K. And download libncursesw.so.6 dependency. Copy them all to /lib/arm-linux-gnueabihf.
  6. ln -s /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so3
    In this case, the CEF test program can be run, but the error "fatal:page_allocator_internals_posix.h(169) check failed" occurs twice. And the interface is blank and does not load the page.
    Display thread discovery with ps
    Ubuntu Server 20.04 arm64 cef has 6 threads
    The cef in Kylin arm64 has only 5 threads.

View pagesize with readelf -l xxx.so. After LOAD, 0x1000 is 4K, and 0x10000 is 64K.

@salvadordf
Copy link
Owner Author

I'm getting the same error with a beta version of CEF4Delphi that uses CEF 119.

I replaced the LoadLibrary call with this :
FLibHandle := TLibHandle(dlopen(PAnsiChar(UTF8Encode(LibCefPath + #0)), RTLD_LAZY or RTLD_LOCAL));

dlopen is returning a zero and a call to dlerror gives this message :
cannot allocate memory in static TLS block.

This message is the same in x86 and Raspberry when I try to load libcef.so

@salvadordf
Copy link
Owner Author

salvadordf commented Nov 14, 2023

Workaround
Open a terminal window and execute the following command :
export LD_PRELOAD=<FULL-PATH-TO-libcef.so>
Then run the GTK3 demos.

CEF 118 and older versions worked correctly in Intel x64.

@salvadordf salvadordf changed the title libcef.so can't be loaded in Ubuntu for RaspberryPi libcef.so can't be loaded in Ubuntu for RaspberryPi and Linux Mint for x64 Nov 16, 2023
@salvadordf salvadordf added the x64 label Nov 16, 2023
@jwj76
Copy link

jwj76 commented Nov 26, 2023

When the cef program of armhf (32) is executed in arm64, after the fcitx input method is enabled, two characters will appear when the keyboard enters one character in the English input state. You cannot enter any characters in the Chinese state, including English. After fcitx is disabled, input characters are normal. Please tell me how to set up to use fcitx to input Chinese.

@salvadordf
Copy link
Owner Author

There are several CEF issues related to the IME in Linux.
Please, use our forum for questions unrelated to this libcef.so issue.

@jwj76
Copy link

jwj76 commented Dec 1, 2023

The armhf version of CEF running under arm64 cannot be used in Chinese. There is no associated SO library file, armhf default input method is xim. Only add fcitx fcitx5 ibus and other input methods in the armhf library file, and set up can be used.

@jwj76
Copy link

jwj76 commented Dec 2, 2023

Now you can use cef+flash+ Chinese input in Arm64.
Thank you all!
The method is to install armhf support under arm64 and choose linux arm when developing and compiling. And install CEF required Armhf required library files.
The principle is the same as running win32 programs under win64. windows64 already includes 32 - and 64-bit dynamic libraries. There is no arm32 library in arm64, so you need to install it manually.
There's still a slight problem.
getconf PAGESIZE 4096 works in arm64. There's no problem.
But in getconf PAGESIZE 65536, it may not work.
The fatal page_allocator_internals_posix.h(169) check failed error message is displayed.
CEF is also loading, that is, showing the page as blank.

@salvadordf salvadordf added upstream Issue in the CEF libraries and removed help wanted labels Dec 5, 2023
@salvadordf
Copy link
Owner Author

The CEF 119.4.7 update fixes the "cannot allocate memory in static TLS block" issue for x64 CPUs but Ubuntu 23.10 for Raspberry Pi is still affected.

@salvadordf salvadordf changed the title libcef.so can't be loaded in Ubuntu for RaspberryPi and Linux Mint for x64 libcef.so can't be loaded in Ubuntu 23.10 for RaspberryPi Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants