620.70.06: NULL deref in ConnectorImpl::ensureMstNodesPoweredUp (via ConnectorImpl2x::notifyAttachBegin) on first modeset after s2idle resume — kwin_wayland killed, black screen

オープン
#1,568 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c

調査の方向性

Start by reading src/common/displayport group and device lifetime code, then trace ConnectorImpl::ensureMstNodesPoweredUp and ConnectorImpl2x::notifyAttachBegin against the reported call stack. The report describes a possible stale DeviceImpl after s2idle resume, but does not identify a specific source file or reproducing test. Done means resolving the device lifetime failure and preventing the first modeset after resume from dereferencing a null vtable.

索引モデルが issue の本文から書いたものです。

説明

NVIDIA Driver Version

620.70.06 (open kernel modules)

Operating System and Version

Arch Linux (CachyOS kernel)

Kernel Release

7.3.4-1-cachyos

Hardware

  • GPU: GeForce RTX 5060 Ti (GB206, 10de:2d04), VBIOS 98.06.4E.40.38
  • iGPU also present: AMD Renoir (amdgpu); display connected only to the NVIDIA card
  • Board: B450M (BIOS 5.17, 12/13/2024)
  • Display: LG UltraGear over DisplayPort, single monitor, direct connection (no hub/dock/MST)

Software

  • KDE Plasma 6.8.3, kwin_wayland 6.8.3 (Wayland session)
  • nvidia_drm.modeset=1, nvidia_drm.fbdev=1
  • nvidia-suspend/resume/hibernate systemd services: disabled
  • PreserveVideoMemoryAllocations: 2, DynamicPowerManagement: 3

Describe the bug

The system suspended (s2idle) after an idle period. On wake, the kernel resumed normally (disks, network and audio came back), but ~2 seconds after PM: suspend exit, the first atomic commit from kwin_wayland oopsed inside nvidia_modeset. kwin_wayland was killed with IRQs disabled, the display stayed black, and only a hard reset got the machine back. The rest of the system stayed alive; it kept logging network traffic for several minutes.

Earlier in the same boot (about 3 h before the suspend), this warning appeared once:
WARNING: nvidia-drm/nvidia-drm-crtc.h:371 at __nv_drm_handle_flip_event (nv_flip == NULL).

Analysis

The faulting instruction is at ensureMstNodesPoweredUp+0x53:

48 8b 03        mov rax, [rbx]        ; rbx = Device* from target->enumDevices()
48 8b 40 18     mov rax, [rax+0x18]   ; <-- faults: vtable pointer is NULL (CR2 = 0x18)
48 3d ...       cmp rax, <fn>         ; devirtualization check for dev->isVideoSink()

So the Device* returned by target->enumDevices() points to an object whose vtable pointer is 0. That looks like a stale or freed DeviceImpl still linked in the Group after resume. The monitor was probably re-detected or removed during resume while the group membership wasn't updated. The connector-state guard at the top of the function (connectorActive / isDiscoveryDetectComplete) did not catch it.

Note that notifyAttachBegin iterates the same list right after ensureMstNodesPoweredUp() returns. So adding a linkUseMultistream() guard (this is an SST link) would only move the crash, not fix the lifetime problem.

I checked the 620.73.04 tag: ensureMstNodesPoweredUp and the group/device lifetime code in src/common/displayport are unchanged, so this is likely still present. This may be related to #1454 (NULL deref on modeset after DP re-plug).

To Reproduce

  1. Wayland session (KWin) on RTX 50-series, single DP monitor.
  2. Let the system auto-suspend (s2idle) for ~1 h.
  3. Wake it. The crash happens on the first modeset after resume.

This has happened once so far, so it is not reliably reproducible.

Kernel log (oops)

PM: suspend exit
BUG: kernel NULL pointer dereference, address: 0000000000000018
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
Oops: Oops: 0000 [#1] SMP NOPTI
CPU: 2 UID: 1000 PID: 906 Comm: kwin_wayland Tainted: G        W  O        7.3.4-1-cachyos #1 PREEMPT(full)
RIP: 0010:_ZN11DisplayPort13ConnectorImpl23ensureMstNodesPoweredUpEPNS_5GroupE.part.0+0x53/0x2e0 [nvidia_modeset]
Code: ... 48 89 c3 0f 1f 00 48 8b 03 <48> 8b 40 18 48 3d d0 61 b6 c1 0f 85 1d 02 00 00 ...
RAX: 0000000000000000 RBX: ffff8b6b211fc008
Call Trace:
 _ZN11DisplayPort15ConnectorImpl2x17notifyAttachBeginEPNS_5GroupERKNS_15DpModesetParamsE+0x263/0xe00 [nvidia_modeset]
 _ZN11DisplayPort13ConnectorImpl12dpPreModesetERKNS_18DpPreModesetParamsE+0x87/0x150 [nvidia_modeset]
 nvDPPreSetMode+0x144/0x250 [nvidia_modeset]
 KickoffModesetUpdateState+0xe8/0x220 [nvidia_modeset]
 nvSetDispModeEvo+0x3e98/0x4c00 [nvidia_modeset]
 nvKmsIoctl+0xdc/0x1b0 [nvidia_modeset]
 nvkms_ioctl_from_kapi_try_pmlock+0x4b/0x80 [nvidia_modeset]
 ApplyModeSetConfig+0xd98/0xfb0 [nvidia_modeset]
 nv_drm_atomic_commit+0x584/0xab0 [nvidia_drm]
 drm_atomic_commit+0xc3/0xf0
 drm_mode_atomic_ioctl.cold+0x348/0x5d8
 drm_ioctl+0x305/0x4d0
 do_syscall_64+0x8f/0x380
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
note: kwin_wayland[906] exited with irqs disabled

Bug Incidence

Once

nvidia-bug-report.log.gz

(to attach: generated after the next occurrence)

主要言語
C
スター
17.7k
フォーク
2k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/open-gpu-kernel-modules のほかの issue

NVIDIA/open-gpu-kernel-modules の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。