Comments (7)
I'm hitting this as well, did some investigation here.
The backtrace is like so,
Thread 1 (LWP 252):
#0 strlen () at ../sysdeps/aarch64/strlen.S:94
#1 0x0000007fab1aa064 in __GI___strdup (s=0x0) at strdup.c:41
#2 0x0000007fa84c434c in wayland_drm_init (display=display@entry=0x2c312720, device_name=0x0, callbacks=0x7feacc8b48, callbacks@entry=0x7feacc8b68, user_data=user_data@entry=0x2c33bea0, flags=0) at wayland-drm.c:252
#3 0x0000007fa84bde4c in dri2_bind_wayland_display_wl (drv=<optimised out>, disp=0x2c33bea0, wl_dpy=0x2c312720) at drivers/dri2/egl_dri2.c:2839
#4 0x0000007fa84b4130 in eglBindWaylandDisplayWL (dpy=<optimised out>, display=0x2c312720) at main/eglapi.c:2197
#5 0x0000007fa7a592d8 in _ZN2WS8Instance10initializeEPv (this=0x2c347eb0, eglDisplay=0x2c33bea0) at /home/cturner/buildroot/buildroot-2019.02.2/output_wpe_64/build/wpebackend-fdo-1.0.0/src/ws.cpp:239
#6 0x0000007fa7a5825c in wpe_fdo_initialize_for_egl_display (display=<optimised out>) at /home/cturner/buildroot/buildroot-2019.02.2/output_wpe_64/build/wpebackend-fdo-1.0.0/src/initialize-egl.cpp:34
#7 0x0000007fa7a7343c in cog_platform_setup (platform=<optimised out>, shell=<optimised out>, params=<optimised out>, error=0x7feacc8c98) at /home/cturner/buildroot/buildroot-2019.02.2/output_wpe_64/build/cog-063df115456a24e464d1e6f284df22a0e65aea8e/platform/cog-platform-fdo.c:1390
#8 0x0000000000402454 in ?? ()
#9 0x0000007feacc8be0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
The dri2_dpy structure's device_name is NULL, I'm not sure why. There's fairly decent error handling for NULL device_names in dri2_initialize_wayland_drm inside mesa3d. Completely new to that codebase. Does the stack trace help diagnose the issue for anyone? I have a core if more information must be squeezed from it.
I didn't see any errors passing LIBGL_DEBUG=verbose WAYLAND_DEBUG=1 either 🤷♂️
from cog.
So, according to https://bugs.webkit.org/show_bug.cgi?id=182490#c0, "swrast drivers do not provide BindWaylandDisplay (as they rely on wl_shm instead of Mesa extensions), and newer Mesa asserts that the extension is enabled when the entrypoint is called". I'm definitely using swrast here. However, we're are correct checking extension strings and checking return values from eglGetProcAddress in backend fdo
if (isEGLExtensionSupported(extensions, "EGL_WL_bind_wayland_display")) {
eglBindWaylandDisplayWL = reinterpret_cast<PFNEGLBINDWAYLANDDISPLAYWL>(eglGetProcAddress("eglBindWaylandDisplayWL"));
eglQueryWaylandBufferWL = reinterpret_cast<PFNEGLQUERYWAYLANDBUFFERWL>(eglGetProcAddress("eglQueryWaylandBufferWL"));
}
if (!eglBindWaylandDisplayWL || !eglQueryWaylandBufferWL)
return false;
so it's not the same issue as in the WK bug. I would think that the extension lookup should fail with swrast? Perhaps it doesn't and instead we need to avoid this and use wl_shm?
Another experiment I did in init_egl is to try getting an EGL display using eglGetPlatformDisplay or eglGetPlatformDisplayEXT before using eglGetDisplay
. This is what WebKit does, but it didn't help the device name being NULL in the end, in case someone else thinks about try that...
from cog.
Some more debug logging,
# G_MESSAGES_DEBUG=all MESA_DEBUG=1 EGL_LOG_LEVEL=debug LIBGL_DEBUG=verbose WAYLAND_DEBUG=1 cog -P fdo http://google.com
(cog:500): Cog-DEBUG: 11:10:23.889: platform_setup: Platform name: fdo
(cog:500): Cog-DEBUG: 11:10:23.890: platform_setup: Platform plugin: libcogplatform-fdo.so
[1569196.740] -> [email protected]_registry(new id wl_registry@2)
[1569197.520] -> [email protected](new id wl_callback@3)
[1569198.817] [email protected]_id(3)
[1569199.076] [email protected](1, "wl_compositor", 4)
Wayland: Got a wl_compositor interface
[1569199.437] -> [email protected](1, "wl_compositor", 4, new id [unknown]@4)
[1569199.618] [email protected](2, "wl_subcompositor", 1)
[1569199.734] [email protected](3, "wp_viewporter", 1)
[1569199.830] [email protected](4, "wp_presentation", 1)
[1569199.949] [email protected](5, "zwp_relative_pointer_manager_v1", 1)
[1569200.078] [email protected](6, "zwp_pointer_constraints_v1", 1)
[1569200.280] [email protected](7, "zwp_input_timestamps_manager_v1", 1)
[1569200.425] [email protected](8, "wl_data_device_manager", 3)
[1569200.536] [email protected](9, "wl_shm", 1)
[1569200.644] [email protected](10, "wl_output", 3)
[1569200.745] [email protected](11, "zwp_input_panel_v1", 1)
[1569200.962] [email protected](12, "zwp_text_input_manager_v1", 1)
[1569201.062] [email protected](13, "zxdg_shell_v6", 1)
Wayland: Got an xdg_shell interface
[1569201.311] -> [email protected](13, "zxdg_shell_v6", 1, new id [unknown]@5)
[1569201.751] [email protected](14, "wl_shell", 1)
Wayland: Got a wl_shell interface
[1569202.085] -> [email protected](14, "wl_shell", 1, new id [unknown]@6)
[1569202.334] [email protected](15, "weston_desktop_shell", 1)
[1569202.475] [email protected](16, "weston_screenshooter", 1)
[1569202.583] [email protected](0)
Cog-INFO: 11:10:23.909: CHT: EGL_KHR_platform_wayland
Cog-INFO: 11:10:23.909: eglGetPlatformDisplay
[1569204.867] -> [email protected]_registry(new id wl_registry@3)
[1569205.163] -> [email protected](new id wl_callback@7)
[1569205.805] [email protected]_id(7)
[1569205.888] [email protected](1, "wl_compositor", 4)
[1569206.082] [email protected](2, "wl_subcompositor", 1)
[1569206.211] [email protected](3, "wp_viewporter", 1)
[1569206.293] [email protected](4, "wp_presentation", 1)
[1569206.627] [email protected](5, "zwp_relative_pointer_manager_v1", 1)
[1569206.878] [email protected](6, "zwp_pointer_constraints_v1", 1)
[1569206.956] [email protected](7, "zwp_input_timestamps_manager_v1", 1)
[1569207.040] [email protected](8, "wl_data_device_manager", 3)
[1569207.188] [email protected](9, "wl_shm", 1)
[1569207.266] [email protected](10, "wl_output", 3)
[1569207.404] [email protected](11, "zwp_input_panel_v1", 1)
[1569207.523] [email protected](12, "zwp_text_input_manager_v1", 1)
[1569207.643] [email protected](13, "zxdg_shell_v6", 1)
[1569207.878] [email protected](14, "wl_shell", 1)
[1569207.976] [email protected](15, "weston_desktop_shell", 1)
[1569208.096] [email protected](16, "weston_screenshooter", 1)
[1569208.452] [email protected](0)
[1569209.096] -> [email protected]_registry(new id wl_registry@7)
[1569209.218] -> [email protected](new id wl_callback@8)
[1569209.771] [email protected]_id(8)
[1569209.859] [email protected](1, "wl_compositor", 4)
[1569209.982] [email protected](2, "wl_subcompositor", 1)
[1569210.092] [email protected](3, "wp_viewporter", 1)
[1569210.167] [email protected](4, "wp_presentation", 1)
[1569210.282] [email protected](5, "zwp_relative_pointer_manager_v1", 1)
[1569210.539] [email protected](6, "zwp_pointer_constraints_v1", 1)
[1569210.635] [email protected](7, "zwp_input_timestamps_manager_v1", 1)
[1569210.740] [email protected](8, "wl_data_device_manager", 3)
[1569210.991] [email protected](9, "wl_shm", 1)
[1569211.257] -> [email protected](9, "wl_shm", 1, new id [unknown]@9)
[1569211.588] [email protected](10, "wl_output", 3)
[1569211.797] [email protected](11, "zwp_input_panel_v1", 1)
[1569211.901] [email protected](12, "zwp_text_input_manager_v1", 1)
[1569212.016] [email protected](13, "zxdg_shell_v6", 1)
[1569212.231] [email protected](14, "wl_shell", 1)
[1569212.379] [email protected](15, "weston_desktop_shell", 1)
[1569212.551] [email protected](16, "weston_screenshooter", 1)
[1569212.673] [email protected](0)
[1569212.858] -> [email protected](new id wl_callback@8)
[1569213.153] [email protected]_id(8)
[1569213.223] [email protected](0)
[1569213.401] [email protected](1)
[1569213.468] [email protected](909199186)
[1569213.526] [email protected](0)
libEGL debug: DRI2: dlopen(/usr/lib/dri/swrast_dri.so)
libEGL debug: found extension `DRI_Core'
libEGL info: found extension DRI_Core version 2
libEGL debug: found extension `DRI_SWRast'
libEGL info: found extension DRI_SWRast version 4
libEGL debug: found extension `DRI_CopySubBuffer'
libEGL debug: found extension `DRI_ConfigOptions'
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libEGL debug: found extension `DRI_TexBuffer'
libEGL info: found extension DRI_TexBuffer version 2
libEGL debug: found extension `DRI_RENDERER_QUERY'
libEGL debug: found extension `DRI_CONFIG_QUERY'
libEGL debug: found extension `DRI2_Fence'
libEGL debug: found extension `DRI_NoError'
libEGL debug: found extension `DRI_IMAGE'
libEGL debug: found extension `DRI_FlushControl'
libEGL debug: found extension `DRI_TexBuffer'
libEGL debug: found extension `DRI_RENDERER_QUERY'
libEGL info: found extension DRI_RENDERER_QUERY version 1
libEGL debug: found extension `DRI_CONFIG_QUERY'
libEGL info: found extension DRI_CONFIG_QUERY version 1
libEGL debug: found extension `DRI2_Fence'
libEGL info: found extension DRI2_Fence version 2
libEGL debug: found extension `DRI_NoError'
libEGL info: found extension DRI_NoError version 1
libEGL debug: found extension `DRI_IMAGE'
libEGL info: found extension DRI_IMAGE version 6
libEGL debug: found extension `DRI_FlushControl'
libEGL info: found extension DRI_FlushControl version 1
libEGL debug: did not find optional extension DRI_Robustness version 1
libEGL debug: did not find optional extension DRI2_Interop version 1
libEGL debug: did not find optional extension DRI2_Blob version 1
libEGL debug: did not find optional extension DRI_MutableRenderBufferDriver version 1
libEGL debug: No DRI config supports native format XRGB2101010
libEGL debug: No DRI config supports native format ARGB2101010
libEGL debug: No DRI config supports native format XBGR2101010
libEGL debug: No DRI config supports native format ABGR2101010
Cog-INFO: 11:10:23.949: EGL version 1.4 initialized.
[1569468.424] -> [email protected]_surface(new id wl_surface@8)
[1569468.626] -> [email protected]_xdg_surface(new id zxdg_surface_v6@10, wl_surface@8)
[1569468.732] -> [email protected]_toplevel(new id zxdg_toplevel_v6@11)
[1569469.100] -> [email protected]_title("Cog")
[1569469.497] -> [email protected]_app_id("com.igalia.Cog")
libEGL debug: mincore failed: Cannot allocate memory
[1569470.057] -> [email protected]()
[1569471.469] -> [email protected]_pool(new id wl_shm_pool@12, fd 13, 3145728)
[1569471.681] -> [email protected]_buffer(new id wl_buffer@13, 0, 1024, 768, 4096, 1)
[1569472.092] -> [email protected]()
Segmentation fault
This is with a patch to use eglGetPlatformDisplay
, which doesn't seem to affect anything. The interesting part to me is this allocation failure?
libEGL debug: mincore failed: Cannot allocate memory
Version information I'm using here (taken from the default in buildroot-wpe):
Cog: 063df11
WPEBackend-fdo: 1.0.0
from cog.
The first issue for me was that I was running 64-bit ARM. I was having deadlock issues that are sort of known to the community with the DRM backends. It's not clear what the fix is, but the pi devs are basically saying that's not completely a supported configuration as of 2018. Who knows...
The second issue was that the stable buildroot was shipping a mesa with a few critical vc4 driver bugs. I'm on the latest mesa release and I can at least run a compositor and cog now. Not done further testing yet. You'll want weston built with DRM and you'll also want to ensure you have the vc4 overlay enabled in the firmware and a mesa version that is not bugged.
In summary this overlay is out-of-date. I'd recommend using none of the bundled packages here and instead rely on a current version of buildroot (mesa 18.3.3 for example is a terrible revision for vc4). I'll work on creating a defconfig giving a decent user experience out-of-the-box, because as of today this overlay is broken.
from cog.
I'm seeing the same problem - Segmentation fault
when running cog -P fdo
on weston --backend=fbdev-backend.so
. Same environment, same libraries do work when running cog -P fdo
on weston --backend=drm-backend.so
. I'm using Alpine Linux 3.14.2 (32bit), armv7 on RPi 4.
Any ideas why this might be happening? For investigation purposes, I'm attaching logs which can be diffed:
- fbdev_cog_fail.log & fbdev_weston_fail.log - the logs from cog and weston when running against fbdev. Here cog makes
Segmentation fault
. - drm_fdo_cog.log & drm_weston.log - the logs from cog and weston when running against drm-backend.so. This works fine, the website loads and is visible on the screen.
- apk_list.log - used/installed packages and their versions
- ldd_cog.log - result of
ldd cog
- cog_version.log - result of
cog --version
from cog.
I am facing the same issue @piotrwest . Sadly I am not able to fallback to the drm-backend.so on my platform.
Were you able to resolve this issue?
Cog_SegFaultLog.txt
GDB Log with Stacktrace
from cog.
@piotrwest @HowardACornwell Could you please re-check with Cog 0.12.4? I think there are good chances that it could work as it includes fixes for software rendering so at least it should help when running with Weston's fbdev
backend.
from cog.
Related Issues (20)
- Missing cog-export.h header in the cogcore_headers
- gtk4: Pointer coordinates wrongly reported when the window is on a monitor with fractional scaling HOT 1
- [Clean-up] Remove redundant platform safe-guards in core
- Remove cog_platform_init_web_view() from the API
- MouseEvent buttons property not set in wayland backend
- Crash calling wl_pointer_set_cursor() in cog-utils.c HOT 2
- /snap/wpe-webkit-mir-kiosk/101/usr/bin/cog memory increases until it crashes.
- Identifiers for touch points are not constant in multi touch HOT 5
- cog flickering and not HW accelerated on NXP iMX8M-Plus HOT 2
- Latest COG w/DRM backend has no focus HOT 2
- [wpe-2.38.5][wpe-webkit-mir-kiosk] Long touch/press not working
- (wpe-webkit-mir-kiosk) - Launch homepage on idle HOT 3
- DRM key-repeat only repeats once
- Is DRM missing cog_launcher_get_viewport()?
- cogctl ping fails but reload etc works
- Crash due to `SIGTRAP` after `Creating pipes for GWakeup: Too many open files` HOT 2
- Bad rendering of https://ttnmapper.org HOT 1
- Segfault in `wl_list_remove`
- Segmentation fault for drm platform with gles renderer
- Failing to initialize EGL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cog.