Bug 235487 - graphics/mesa-dri 18.3.2 plus xorg-server-1.18.4_11,1 results in segmentation fault
Summary: graphics/mesa-dri 18.3.2 plus xorg-server-1.18.4_11,1 results in segmentation...
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: regression
: 235488 (view as bug list)
Depends on:
Blocks: 233034
  Show dependency treegraph
 
Reported: 2019-02-04 12:00 UTC by Philip Homburg
Modified: 2019-02-19 08:54 UTC (History)
2 users (show)

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


Attachments
Xorg.0.log (27.26 KB, text/plain)
2019-02-04 12:00 UTC, Philip Homburg
no flags Details
possible workaround (2.26 KB, patch)
2019-02-18 00:05 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Homburg 2019-02-04 12:00:28 UTC
Created attachment 201715 [details]
Xorg.0.log

On a Thinkpad X201 running 11.2-RELEASE-p8, starting X with xinit fails:

[   264.922] (II) GLX: Initialized DRI2 GL provider for screen 0
[   264.923] (EE) 
[   264.923] (EE) Backtrace:
[   264.924] (EE) 0: /usr/local/bin/X (OsInit+0x37a) [0x5ace1a]
[   264.925] (EE) 1: /lib/libthr.so.3 (_pthread_sigmask+0x544) [0x802607db4]
[   264.926] (EE) 2: /lib/libthr.so.3 (_pthread_getspecific+0xe12) [0x802607b82]
[   264.926] (EE) 3: ? (?+0xe12) [0x7fffffffffa5]
[   264.927] (EE) 4: /lib/libc.so.7 (memcpy+0x20) [0x80297d940]
[   264.928] (EE) 5: /usr/local/lib/dri/i965_dri.so (__driDriverGetExtensions_i965+0x2c3ac2) [0x807e78952]
[   264.929] (EE) 6: /usr/local/lib/dri/i965_dri.so (__driDriverGetExtensions_i915+0x64f16) [0x807953d46]
[   264.930] (EE) 7: /usr/local/lib/dri/i965_dri.so (__driDriverGetExtensions_i915+0x64094) [0x807952174]
[   264.930] (EE) 8: /usr/local/lib/dri/i965_dri.so (__driDriverGetExtensions_i965+0x3e81) [0x8078f9301]
[   264.931] (EE) 9: /usr/local/lib/dri/i965_dri.so (_init+0x17eac2) [0x80776dbf2]
[   264.932] (EE) 10: /usr/local/lib/dri/i965_dri.so (_init+0x17eb8e) [0x80776e0ae]
[   264.933] (EE) 11: /usr/local/lib/dri/i965_dri.so (__driDriverGetExtensions_i965+0x5896) [0x8078fc3d6]
[   264.933] (EE) 12: /usr/local/lib/dri/i965_dri.so (__driDriverGetExtensions_i965+0x46e4) [0x8078fa384]
[   264.934] (EE) 13: /usr/local/lib/dri/i965_dri.so (_init+0x1731f3) [0x807756c53]
[   264.935] (EE) 14: /usr/local/lib/dri/i965_dri.so (_init+0x17bff1) [0x807768861]
[   264.936] (EE) 15: /usr/local/lib/dri/i965_dri.so (_init+0x17a60e) [0x80776549e]
[   264.936] (EE) 16: /usr/local/lib/dri/i965_dri.so (_init+0x14ef29) [0x80770e789]
[   264.937] (EE) 17: /usr/local/lib/dri/i965_dri.so (_init+0x14f4ce) [0x80770f36e]
[   264.938] (EE) 18: /usr/local/lib/dri/i965_dri.so (_init+0x169f89) [0x807744889]
[   264.939] (EE) 19: /usr/local/lib/xorg/modules/libglamoregl.so (glamor_egl_create_argb8888_based_texture+0x182) [0x80692e5c2]
[   264.939] (EE) 20: /usr/local/lib/xorg/modules/libglamoregl.so (glamor_egl_create_textured_pixmap_from_gbm_bo+0xbf) [0x80692e92f]
[   264.940] (EE) 21: /usr/local/lib/xorg/modules/drivers/modesetting_drv.so (_init+0x3e67) [0x806316397]
[   264.941] (EE) 22: /usr/local/lib/xorg/modules/drivers/modesetting_drv.so (_init+0x3455) [0x806314f25]
[   264.942] (EE) 23: /usr/local/bin/X (xf86CrtcScreenInit+0x143) [0x4adc53]
[   264.943] (EE) 24: /usr/local/bin/X (remove_fs_handlers+0x446) [0x43b546]
[   264.943] (EE) 25: /usr/local/bin/X (_start+0x95) [0x425155]
[   264.944] (EE) 26: ? (?+0x95) [0x800836095]
[   264.944] (EE) 
[   264.944] (EE) Segmentation fault at address 0x0
[   264.944] (EE)
Comment 1 Jan Beich freebsd_committer 2019-02-04 12:29:46 UTC
*** Bug 235488 has been marked as a duplicate of this bug. ***
Comment 2 Jan Beich freebsd_committer 2019-02-04 12:39:59 UTC
mesa-dri was updated 2 times in short succession. Can you check whether regression occurs after 18.2.8 -> 18.3.2 or 18.1.9 -> 18.2.8?

(In reply to Philip Homburg from comment #0)
> [   263.582] Build Operating System: FreeBSD 11.2-RELEASE-p8 amd64 

Do you use i915kms from base system or from graphics/drm-kmod? If the latter is it the latest version i.e., drm-fbsd11.2-kmod-4.9.g20181023?

> [   263.583] (--) PCI:*(0:0:2:0) 8086:0046:17aa:215a rev 2, Mem @ 0xf2000000/4194304, 0xd0000000/268435456, I/O @ 0x00001800/8, BIOS @ 0x????????/65536

0x0046 is Ironlake (Arrandale), 1 generation earlier than SandyBridge which was confirmed to work.
Comment 3 Philip Homburg 2019-02-04 13:00:34 UTC
I have drm-fbsd11.2-kmod-4.11g2018121, but dmesg says

info: [drm] Initialized i915 1.6.0 20080730 for drmn0 on minor 0

So I think it is the base system one that got loaded.

I'll see if I can downgrade mesa-dri.
Comment 4 Philip Homburg 2019-02-04 18:07:17 UTC
It works with 18.1.9_3. I'll see if I can build 18.2.8
Comment 5 Philip Homburg 2019-02-07 10:29:41 UTC
mesa-dri 18.2.8 works as well.
Comment 6 Jan Beich freebsd_committer 2019-02-07 11:02:09 UTC
Let's check if upstream has a fix then. Can you try mesa-dri 18.3.3 / 19.0.0-rc2?

(Ignore patch conflicts if *.rej files only affect PORTREVISION)

$ fetch -o /tmp/mesa-18.3.3.diff 'https://reviews.freebsd.org/D19099?download=true'
$ patch -Efsp0 -i /tmp/mesa-18.3.3.diff -d /usr/ports
$ make all deinstall install clean -C /usr/ports/graphics/mesa-dri

$ fetch -o /tmp/mesa-llvm7.diff 'https://bugs.freebsd.org/bugzilla/attachment.cgi?id=199665'
$ fetch -o /tmp/libdrm-2.4.97.diff 'https://bugs.freebsd.org/bugzilla/attachment.cgi?id=201643'
$ fetch -o /tmp/mesa-19.0.0.diff 'https://reviews.freebsd.org/D19100?download=true'
$ patch -Efsp1 -i /tmp/mesa-llvm7.diff -d /usr/ports
$ patch -Efsp1 -i /tmp/libdrm-2.4.97.diff -d /usr/ports
$ patch -Efsp0 -i /tmp/mesa-19.0.0.diff -d /usr/ports
$ make all deinstall install clean -C /usr/ports/graphics/libdrm
$ make all deinstall install clean -C /usr/ports/graphics/mesa-libs
$ make all deinstall install clean -C /usr/ports/graphics/mesa-dri
Comment 7 Philip Homburg 2019-02-07 12:18:01 UTC
Where do I find 18.3.3? Just change the version number?
Comment 8 Jan Beich freebsd_committer 2019-02-07 12:42:45 UTC
(In reply to Philip Homburg from comment #7)
> Where do I find 18.3.3?

In review D19099 but I've posted instructions in comment 6.

> Just change the version number?

Only if you don't use a patch provided by someone. For patch-level updates bumping version and "make makesum" is often enough.
Comment 9 Philip Homburg 2019-02-08 10:13:05 UTC
19.0.0.rc2 fails the same way as 18.3.2
Comment 10 Martin Birgmeier 2019-02-17 08:41:54 UTC
I have crashes since a while which also seem to be related to 3D acceleration.

They are usually triggered by activities in Firefox, sometimes seemingly also by VirtualBox clients even though I run them mostly headless.

The setup is as follows:
- Thinkpad W520
- GF108 [Quadro 1000M] graphics card
- releng/12.0 with latest patches
- mesa-dri-18.3.2
- nvidia-driver-390.87_2
- xorg-server-1.18.4_11,1

Is this related although using the NVidia driver in this case?

I have another machine with similar crashes since about the same time, this time using Intel 82945GM (945GM GMCH). A third machine using an ATI Radeon HD 4290 does not seem to be affected. Both these machines use drm-fbsd12.0-kmod-4.16.g20190213, also with mesa-dri-18.3.2. The second machine does not even run any 3D clients, just a simple X server with oclock running on top of it (no graphical login manager).

-- Martin
Comment 11 Jan Beich freebsd_committer 2019-02-18 00:05:01 UTC
Created attachment 202111 [details]
possible workaround

Philip, can you try the attached patch? Found from https://github.com/DragonFlyBSD/DeltaPorts/commit/630507ebacd5
If it doesn't help bisecting upstream commits (time-consuming due to patch churn) maybe required as I don't have hardware old enough to be compatible with drm-legacy-kmod.

(In reply to Martin Birgmeier from comment #10)
> Is this related although using the NVidia driver in this case?

nvidia-driver has its own DDX/DRI/libGL implementation, so the stability only depends on xorg-server and kernel changes. mesa-dri is only used for <GL/internal/dri_interface.h>. As GLVND isn't in ports yet libGL implementation cannot be switched at runtime.

> I have another machine with similar crashes since about the same
> time, this time using Intel 82945GM (945GM GMCH).

Maybe related if using iGPU. 945GM is Calistoga, even older than Ironlake.
https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units

> A third machine using an ATI Radeon HD 4290 does not seem to be affected.

Only Intel iGPU on drm-legacy-kmod or in-base drm2 appear to be affected.

> The second machine does not even run any 3D clients, just a simple X
> server with oclock running on top of it (no graphical login
> manager).

mesa-dri is used for DRI2 and AIGLX. However, according to bug 235203 it only affects modesetting(4x).
Comment 12 Jan Beich freebsd_committer 2019-02-19 05:14:17 UTC
Comment on attachment 202111 [details]
possible workaround

Nevermind. This patch is nop on gen < 8 (Haswell or older).
Comment 13 Niclas Zeising freebsd_committer 2019-02-19 08:54:13 UTC
(In reply to Martin Birgmeier from comment #10)

Hi!
It looks like this is a separate issue.  Can you create a separate PR for it, to avoid the confusion?
Thanks!