Bug 91231 - [NV92] Psychonauts (native) segfaults on start when DRI3 enabled
Summary: [NV92] Psychonauts (native) segfaults on start when DRI3 enabled
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nouveau (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Nouveau Project
QA Contact: Xorg Project Team
Keywords: bisected, regression
Depends on:
Reported: 2015-07-05 03:28 UTC by Béla Gyebrószki
Modified: 2015-07-08 04:22 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

trace generated by apitrace (3.02 KB, application/octet-stream)
2015-07-05 03:28 UTC, Béla Gyebrószki
no flags Details
XOrg.log (37.34 KB, text/plain)
2015-07-05 03:29 UTC, Béla Gyebrószki
no flags Details
backtrace from the game and glretrace (1.78 KB, text/plain)
2015-07-05 03:33 UTC, Béla Gyebrószki
no flags Details

Description Béla Gyebrószki 2015-07-05 03:28:02 UTC
Created attachment 116944 [details]
trace generated by apitrace

The game runs natively on Linux. When Mesa was compiled with DRI3 support the game segfaults when starting and I get this in the terminal:
Psychonauts: nv50/nv50_miptree.c:132: nv50_mt_choose_storage_type: Assertion `ms == 0' failed.
The game starts properly if I disable DRI3 at runtime (LIBGL_DRI3_DISABLE=1)

The problem is present since

commit 241e7289f25a342a457952b9b0e539c2f0b81d99
Author: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Date:   Wed Oct 22 11:04:16 2014 +0200

    enable dri3 support without glamor

When replaying the trace with glretrace the message about the assertion is not present, but glretrace segfaults with signal 11.

Fedora 22 32-bit
Kernel 4.0.6-300.fc22.i686+PAE
VGA compatible controller: NVIDIA Corporation G92 [GeForce GTS 250] (rev a2) (prog-if 00 [VGA controller])
Mesa 10.6-branchpoint-826-gff0a41b
Comment 1 Béla Gyebrószki 2015-07-05 03:29:10 UTC
Created attachment 116945 [details]
Comment 2 Ilia Mirkin 2015-07-05 03:30:00 UTC
The assertion is regarding PIPE_BIND_SCANOUT + nr_samples != 0. I suspect this might be a dri st bug which only surfaces with the new mechanisms that dri3 enables.
Comment 3 Béla Gyebrószki 2015-07-05 03:33:02 UTC
Created attachment 116946 [details]
backtrace from the game and glretrace
Comment 4 Béla Gyebrószki 2015-07-06 07:09:52 UTC
If you have a Steam account and Steam for Linux installed you can reproduce the segfault with these native Linux demos on Steam:
- 'Running with Rifles' demo (note: I had to remove libstdc++.so.6 and libxcb.so.1 from ./lib).
- Torchlight II demo (the game starts with default settings, you need to enable anti-aliasing in-game option and restart the game to reproduce this bug).

All those games crash on start with
>nv50/nv50_miptree.c:132: nv50_mt_choose_storage_type: Assertion `ms == 0' failed.
when DRI3 is enabled.
Comment 5 Ilia Mirkin 2015-07-07 17:02:37 UTC
Marek posted a patch for this at http://patchwork.freedesktop.org/patch/53843/
Comment 6 Béla Gyebrószki 2015-07-07 17:29:18 UTC
(In reply to Ilia Mirkin from comment #5)
> Marek posted a patch for this at
> http://patchwork.freedesktop.org/patch/53843/

The patch works and fixes the problem in all the affected games that I know of.
Thank you both for your help fixing this bug.
Comment 7 Béla Gyebrószki 2015-07-08 04:22:01 UTC
Patch committed, marking the bug as fixed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.