620.70.06: NULL deref in ConnectorImpl::ensureMstNodesPoweredUp (via ConnectorImpl2x::notifyAttachBegin) on first modeset after s2idle resume — kwin_wayland killed, black screen
メンテナーはふだん 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
- Wayland session (KWin) on RTX 50-series, single DP monitor.
- Let the system auto-suspend (s2idle) for ~1 h.
- 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 はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/open-gpu-kernel-modules のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
メンテナーはふだん 1 日以内に返信
-
nvidia-drm: NULL dereference in nv_drm_create_sync_file() when sync_file_create() fails (kernel oops when fs.file-max is exhausted)再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NVIDIA/open-gpu-kernel-modules#1601 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NVIDIA/open-gpu-kernel-modules#1479 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
PlatformRequestHandler: missing !bInit guard on bSystemParamLimitUpdate causes NV_ERR_INVALID_DATA at boot対応中かも @SammyTourani が 69 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
NVIDIA/open-gpu-kernel-modules#1360 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NVIDIA/open-gpu-kernel-modules#1343 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
NVIDIA/open-gpu-kernel-modules の issue をすべて見る
似ている issue
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameオープンgame: 010065A014024000 ios
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
seedds/nxnative#3714 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
area/docdb kind/enhancement mvu-pg15-pg19 priority/low
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
yugabyte/yugabyte-db#40355 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Vector Sets fastjson recursion depth limit (MAX_RECURSION_DEPTH_LIMIT) missing in 8.12.0, 8.12.1, and unstable対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Jstar269/nakagawa-recomp#3753 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
ly05010419/MacNativeGames#2474 ·
メンテナーはふだん 1 日以内に返信