620.70.06: NULL deref in ConnectorImpl::ensureMstNodesPoweredUp (via ConnectorImpl2x::notifyAttachBegin) on first modeset after s2idle resume — kwin_wayland killed, black screen
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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)可能重新可做 关联的 PR 已关闭且未合并。 未关闭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 天内回复
-
HTTP/3
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
haskell/bytestring#730 · 1 条评论 ·
-
bug ux/behavior
难度 2/5 1-3 小时 新手友好度 70/100
DeusData/codebase-memory-mcp#3191 ·
维护者通常 1 天内回复
-
area/docdb kind/enhancement mvu-pg15-pg19 priority/low
难度 2/5 1-3 小时 新手友好度 76/100
yugabyte/yugabyte-db#40355 ·
维护者通常 1 天内回复