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

Running WPELaunch segfaults #131

Closed
petrosagg opened this issue Mar 13, 2017 · 17 comments
Closed

Running WPELaunch segfaults #131

petrosagg opened this issue Mar 13, 2017 · 17 comments

Comments

@petrosagg
Copy link
Contributor

petrosagg commented Mar 13, 2017

After creating an SD image using the instructions provided in the README and after making the modifications suggested in #1, the Pi is unable to run WPE.

With the clean image on a Raspberrypi 2 running WPELauncher fails with wpa: could not load the impl library. Is there any backend installed?: libWPEBackend-default.so: cannot open shared object file: No such file or directory.

I tried creating a symlink of /usr/lib/libWPEBackend-default.so -> libWPEBackend-rdk.so but that didn't help. What is the correct way of running this project?

@wouterlucas
Copy link
Contributor

Please try with latest bump of wpewebkit.

@petrosagg
Copy link
Contributor Author

Hm, I just realised I hadn't done this step from the README:

PACKAGECONFIG_append_pn-qemu-native = ""
PACKAGECONFIG_append_pn-nativesdk-qemu = ""
ASSUME_PROVIDED += ""

I'm not sure if it's significant. I'll re-run the build.

@petrosagg
Copy link
Contributor Author

Rebuilding with those changes in my local.conf didn't help. I didn't try building with the new wpe to make sure I change one thing at a time.

But is it correct that I symlink the backend lib? Will the new wpe version you added pick up the correct backend automatically?

@wouterlucas
Copy link
Contributor

Correct, latest WPEWebKit bump should correct that. There was a typo in the linking part, you cant work around that with ln's. If you pull in the latest and rebuild it should be fine.

@petrosagg
Copy link
Contributor Author

I rebuilt the image using the latest commit of this repo with the westeros image and it still segfaults. Here are the precise steps I do:

  1. Run bitbake westeros-wpe-image. meta-wpe is at commit 84386cc
  2. Connect Pi to keyboard, Ethernet, HDMI screen
  3. Boot the Pi
  4. Login as root and run ln -s /usr/lib/libWPEBackend-rdk.so /usr/lib/libWPEBackend-default.so
  5. Run WPELauncher

I can see the yellow mouse cursor of the westeros which works fine. But wpe doesn't seem to start

@petrosagg
Copy link
Contributor Author

I'm running all of these on a RaspberryPi 3

@wouterlucas
Copy link
Contributor

Make sure you tell WPE and Westeros to share the same displayid through exports. The whole launching of westors together with WPE is something we're working on to make it a little easier.

E.g. by setting the correct exports before launching westeros, if not set al ready:
export XDG_RUNTIME_DIR=/tmp
export WAYLAND_DISPLAY=wayland-0
export LD_PRELOAD=/usr/lib/libwayland-egl.so.0.0.0
export GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0

And same before WPE Launcher:
export XDG_RUNTIME_DIR=/tmp
export WAYLAND_DISPLAY=wayland-0

@kraj
Copy link
Collaborator

kraj commented Mar 14, 2017

secondly make sure that you use Thumb2 to compile WPE

@petrosagg
Copy link
Contributor Author

Hm, my build still segfaults.

The westeros-wpe-image runs westeros automatically on startup using a sysv init script that starts westeros by running westeros-init. Then I run WPELaunch with XDG_RUNTIME_DIR=/run and WAYLAND_DISPLAY=wayland-0, which are the same as the auto-started westeros instance.

@kraj Thumb2 is automatically set by the recipe in this repo. I verified that this is the case in my build, wpewebkit is under work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/wpewebkit.

I'm currently rebuilding with GCC_VERSION_forcevariable = "5.4%" to see if it makes a difference.

Do you guys reproduce this issue on your machines or is it only on my side? I'm trying to follow the README as closely as possible with the only difference being that I remove cppsdk and webbridge from the packagegroup.

Here are all the commits of the layers I'm using. If you have a known working set of commits I could try with those:

Build Configuration:
BB_VERSION        = "1.33.2"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "ubuntu-16.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "raspberrypi3"
DISTRO            = "poky"
DISTRO_VERSION    = "2.2+snapshot-20170314"
TUNE_FEATURES     = "arm armv7ve vfp thumb neon vfpv4 callconvention-hard cortexa7"
TARGET_FPU        = "hard"
meta              
meta-poky         
meta-yocto-bsp    = "master:b3d13e058a86cafc33aeab11eddfde77b1fd884f"
meta-raspberrypi  = "master:c768a3d1aed8d16d08afe12fddb359914e0a203a"
meta-metrological = "master:84386ccfd2fc13dbd569b69a41afbfae7bf994dc"
meta-oe           
meta-multimedia   = "master:1dff2351aa6cdafa5a501e8956cb853ab17ed9ae"

@kraj
Copy link
Collaborator

kraj commented Mar 15, 2017

I can confirm the crash as well.

here is a backtrace it happening in /usr/bin/WPEWebProcess

(gdb) bt
#0  0x74fb99a8 in wpe_renderer_backend_egl_create () from /usr/lib/libWPEBackend.so.0
#1  0x764caea8 in WebCore::PlatformDisplayWPE::initialize(int) () from /usr/lib/libWPEWebKit.so.0
#2  0x76c6173a in WTF::RunLoop::performWork() () from /usr/lib/libWPEWebKit.so.0
#3  0x76c7d72e in WTF::RunLoop::RunLoop()::{lambda(void*)#1}::_FUN(void*) () from /usr/lib/libWPEWebKit.so.0
#4  0x7528f7ac in g_main_dispatch (context=0x558ec528) at /usr/src/debug/glib-2.0/1_2.50.3-r0/glib-2.50.3/glib/gmain.c:3203
#5  g_main_context_dispatch (context=context@entry=0x558ec528) at /usr/src/debug/glib-2.0/1_2.50.3-r0/glib-2.50.3/glib/gmain.c:3856
#6  0x7528fb68 in g_main_context_iterate (context=0x558ec528, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /usr/src/debug/glib-2.0/1_2.50.3-r0/glib-2.50.3/glib/gmain.c:3929
#7  0x7528fed4 in g_main_loop_run (loop=0x558d9488) at /usr/src/debug/glib-2.0/1_2.50.3-r0/glib-2.50.3/glib/gmain.c:4125
#8  0x76c7dcee in WTF::RunLoop::run() () from /usr/lib/libWPEWebKit.so.0
#9  0x7594faf8 in int WebKit::ChildProcessMain<WebKit::WebProcess, WebKit::WebProcessMain>(int, char**) () from /usr/lib/libWPEWebKit.so.0
#10 0x75508840 in __libc_start_main (main=0x7ed75d94, argc=1969397760, argv=0x75508840 <__libc_start_main+280>, init=<optimized out>, fini=0x54b2c8b0 <__libc_csu_fini>, rtld_fini=0x76f552b0 <_dl_fini>, stack_end=0x7ed75d94)
    at /usr/src/debug/glibc/2.25-r0/git/csu/libc-start.c:295
#11 0x54b2c6c8 in _start () at ../sysdeps/arm/start.S:110

@zdobersek
Copy link

zdobersek commented Mar 15, 2017

I think the problem is that the wpewebkit recipe is still using the USE_WPE_BACKEND_* configuration options, which were renamed to USE_WPEWEBKIT_BACKEND_*.

https://github.com/WebPlatformForEmbedded/meta-wpe/blob/master/recipes-wpe/wpewebkit/wpewebkit_0.1.bb#L51
WebPlatformForEmbedded/WPEWebKit@2bc9b8d

That way no backend is selected at compile-time, and the loader facility returns null that leads to the crash.

As mentioned in the first comment, the symlink is also necessary, unless the WPEBackend library has the libWPEBackend-rdk library name enforced at compile-time.

@wouterlucas
Copy link
Contributor

Thanks for spotting that @zdobersek !
I'll have to reflect the Backend-rdk changes anyway so I'll try to adjust it and spin up a build when I get a chance

@kraj
Copy link
Collaborator

kraj commented Mar 15, 2017

@zdobersek we have have USE_WPE_INPUT_UDEV, USE_WPE_BUFFER_MANAGEMENT_GBM USE_WPE_BUFFER_MANAGEMENT_BCM_NEXUS and USE_WPE_BUFFER_MANAGEMENT_BCM_RPI as well. Should they also be renamed ?

@zdobersek
Copy link

I don't know about USE_WPE_INPUT_UDEV -- I don't see it in the current code under Source/ThirdParty/WPE-platform/, but it was added recently to the standalone library as USE_INPUT_DEV.

USE_WPE_BUFFER_MANAGEMENT_* options aren't used anymore in libWPEBackend-rdk, so you can remove them.

@petrosagg
Copy link
Contributor Author

I built the image after #133 and it seems to be working nicely! Thanks a lot for the quick response :)

he one thing that doesn't seem to be working and might be related to @zdobersek's comment is the mouse. I can move the westeros cursor but any clicks or mouse moves are not registered by WPE.

@kraj
Copy link
Collaborator

kraj commented Mar 16, 2017

USE_INPUT_DEV is set if USE_WPEWEBKIT_INPUT_LIBINPUT is set in the version thats being used with OE, its on 3ba32633268e76631849564c5eb576aa007937a0 of wpewebkit

@petrosagg
Copy link
Contributor Author

Thanks for fixing the issue. WPE no longer segfaults

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants