Bug 238931 - graphics/mesa-dri: mutter and gnome-shell segfault when i915kms.ko from base is used
Summary: graphics/mesa-dri: mutter and gnome-shell segfault when i915kms.ko from base ...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-x11 mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-01 18:14 UTC by Ting-Wei Lan
Modified: 2019-07-30 18:46 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (x11)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2019-07-01 18:14:41 UTC
Since the update of Mesa to 18.3.2, I am unable to run mutter and gnome-shell with i915kms.ko from base. Xorg can be successfully started, and simple programs such as xterm and glxgears work. However, GDM won't show anything because gnome-shell segfault immediately in /usr/local/lib/dri/i965_dri.so. The segfault issue can be avoided by downgrading Mesa to 18.2.8 or switching to drm-fbsd12.0-kmod, but downgrading is seldom the correct way to resolve problem. Switching to drm-fbsd12.0-kmod is also not practical on this computer because of memory leak: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238925. I tried to upgrade Mesa to 18.3.6 with patch from https://reviews.freebsd.org/D19099, but the result was the same. I also tried the patch posted at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235487#c11, but it didn't help as well.

This is the backtrace of mutter 3.33.3-30-gf2f4af0d5 running with Mesa 18.3.6.

#0  memcpy () at /usr/src/lib/libc/amd64/string/memmove.S:268
#1  0x000000080415c2d5 in ?? () from /usr/local/lib/dri/i965_dri.so
#2  0x000000080415b170 in ?? () from /usr/local/lib/dri/i965_dri.so
#3  0x0000000803e8f6db in ?? () from /usr/local/lib/dri/i965_dri.so
#4  0x0000000803e8e791 in ?? () from /usr/local/lib/dri/i965_dri.so
#5  0x0000000803e95fa1 in ?? () from /usr/local/lib/dri/i965_dri.so
#6  0x0000000803b87c9a in ?? () from /usr/local/lib/dri/i965_dri.so
#7  0x0000000803b87d76 in ?? () from /usr/local/lib/dri/i965_dri.so
#8  0x0000000803e97a65 in ?? () from /usr/local/lib/dri/i965_dri.so
#9  0x0000000803e96824 in ?? () from /usr/local/lib/dri/i965_dri.so
#10 0x0000000803b71d91 in ?? () from /usr/local/lib/dri/i965_dri.so
#11 0x0000000803b71faa in ?? () from /usr/local/lib/dri/i965_dri.so
#12 0x0000000800b52ce1 in _cogl_texture_driver_upload_to_gl (ctx=0x802d40800, gl_target=<optimized out>, gl_handle=1, is_foreign=0, source_bmp=0x802c634a0, internal_gl_format=6408, source_gl_format=6408, 
    source_gl_type=5121, error=0x0) at ../../source/mutter/cogl/cogl/driver/gl/gl/cogl-texture-driver-gl.c:333
#13 0x0000000800b47860 in allocate_from_bitmap (tex_2d=<optimized out>, loader=<optimized out>, error=0x0) at ../../source/mutter/cogl/cogl/driver/gl/cogl-texture-2d-gl.c:268
#14 0x0000000800b757fa in cogl_texture_allocate (texture=0x802c24ea0, error=0x0) at ../../source/mutter/cogl/cogl/cogl-texture.c:1087
#15 0x0000000800b76c52 in cogl_texture_2d_new_from_data (ctx=0x802d40800, width=1, height=1, format=<optimized out>, rowstride=<optimized out>, data=<optimized out>, error=0x0)
    at ../../source/mutter/cogl/cogl/cogl-texture-2d.c:224
#16 0x0000000800b54eb4 in cogl_context_new (display=<optimized out>, error=<optimized out>) at ../../source/mutter/cogl/cogl/cogl-context.c:398
#17 0x0000000800c53009 in clutter_backend_do_real_create_context (backend=<optimized out>, driver_id=<optimized out>, error=<optimized out>) at ../../source/mutter/clutter/clutter/clutter-backend.c:294
#18 0x0000000800c52cbf in clutter_backend_real_create_context (backend=<optimized out>, error=0x7fffffffd780) at ../../source/mutter/clutter/clutter/clutter-backend.c:377
#19 0x0000000800c6af95 in _clutter_feature_init (error=0x7fffffffd780) at ../../source/mutter/clutter/clutter/clutter-feature.c:101
#20 0x0000000800c7f119 in clutter_init_real (error=0x7fffffffd780) at ../../source/mutter/clutter/clutter/clutter-main.c:1355
#21 0x0000000800c7ef12 in post_parse_hook (context=<optimized out>, group=<optimized out>, data=<optimized out>, error=0x7fffffffd780) at ../../source/mutter/clutter/clutter/clutter-main.c:1513
#22 0x00000008004906c8 in g_option_context_parse (context=0x802d0e220, argc=0x802d0e220, argv=<optimized out>, error=<optimized out>) at ../../source/glib/glib/goption.c:2224
#23 0x0000000800c7f2e8 in clutter_parse_args (argc=0x0, argv=0x0, error=0x7fffffffd7c0) at ../../source/mutter/clutter/clutter/clutter-main.c:1732
#24 0x0000000800c7f1de in clutter_init (argc=0x0, argv=0x0) at ../../source/mutter/clutter/clutter/clutter-main.c:1794
#25 0x00000008002feebb in meta_clutter_init () at ../../source/mutter/src/backends/meta-backend.c:1355
#26 0x0000000800345904 in meta_init () at ../../source/mutter/src/core/main.c:592
#27 0x0000000000219678 in main (argc=1, argv=0x7fffffffd8f8) at ../../source/mutter/src/core/mutter.c:82
Comment 1 Jacques Chanel 2019-07-01 18:55:47 UTC
I have a very similar problem then Ting-Wei Lan with my Thinkpad T410s 
(agp0: <Intel Ironlake (M) SVGA controller> on vgapci0) running 11.2-stable
I don't run mutter but mate.
All binaries depending on clutter (mpv, quadrapassel, swellfoop, lightsoff...) segfault on clutter init in i965_dri.so unless I downgrade mesa-dri to -18.2.8
Comment 2 Niclas Zeising freebsd_committer 2019-07-29 12:33:03 UTC
Have you tried using i915kms.ko from the drm-kmod port?
Comment 3 Ting-Wei Lan 2019-07-29 15:36:38 UTC
(In reply to Niclas Zeising from comment #2)
Yes, everything works fine if drm-fbsd12.0-kmod is used. Does this mean using i915kms.ko from base is no longer supported?
Comment 4 Niclas Zeising freebsd_committer 2019-07-29 20:18:59 UTC
(In reply to Ting-Wei Lan from comment #3)
> (In reply to Niclas Zeising from comment #2)
> Yes, everything works fine if drm-fbsd12.0-kmod is used. Does this mean
> using i915kms.ko from base is no longer supported?

i915kms.ko from base is being phased out, but there is still some support.  However, if the drm-kmod ports work for you, it's better to use that.  It's more up to date, and have support for newer hardware (which might not be an issue in your case), and it's where the development focus is.
Comment 5 Ting-Wei Lan 2019-07-30 16:34:05 UTC
(In reply to Niclas Zeising from comment #4)
It works for me after bug 238925 was resolved, but it looks unexpected for a Mesa update to break the usage of i915kms.ko from base. Will it be fixed, or users are expected to switch to drm-kmod port if they need Mesa?
Comment 6 Niclas Zeising freebsd_committer 2019-07-30 18:46:29 UTC
(In reply to Ting-Wei Lan from comment #5)
> (In reply to Niclas Zeising from comment #4)
> It works for me after bug 238925 was resolved, but it looks unexpected for a
> Mesa update to break the usage of i915kms.ko from base. Will it be fixed, or
> users are expected to switch to drm-kmod port if they need Mesa?

It might be that the update to mesa triggers other code paths in the driver which causes the issue.  There have been some other reports about issues with the base i915kms.ko in 11.2, but only for specific hardware, to my knowledge.

While it's not good that there are issues, since there is a working solution, it is hard to motivate spending too much time on this.