DRM crash when connecting a screen while resuming from suspend
Both times the crash happened, this was the sequence of actions:
- Suspend laptop with no external monitors connected
- Plug USB-C cable with external monitor
- Resume
Steps 2 and 3 do not have to be in that order; it's possible to cause this by first resuming but then quickly attaching the USB-C cable before the screen comes up.
It does not happen 100% of the time: I have done the above without problems recently. Though they may have been different monitors / docks.
Xorg.log:
[ 60851.418] (II) modeset(0): Output DP-3-1 has no monitor section
[ 60851.421] (EE)
[ 60851.421] (EE) Backtrace:
[ 60851.421] (EE) 0: /usr/bin/Xorg.bin (xorg_backtrace+0x7e) [0x5618d751aaae]
[ 60851.421] (EE) 1: /usr/bin/Xorg.bin (0x5618d7344000+0x1df409) [0x5618d7523409]
[ 60851.421] (EE) 2: /lib64/libc.so.6 (0x7f95d5a00000+0x3f1b0) [0x7f95d5a3f1b0]
[ 60851.421] (EE) 3: /usr/lib64/xorg/modules/drivers/modesetting_drv.so (0x7f95d545f000+0xe2a0) [0x7f95d546d2a0]
[ 60851.421] (EE) 4: /usr/lib64/xorg/modules/drivers/modesetting_drv.so (0x7f95d545f000+0x14d00) [0x7f95d5473d00]
[ 60851.421] (EE) 5: /usr/bin/Xorg.bin (0x5618d7344000+0x1e2192) [0x5618d7526192]
[ 60851.421] (EE) 6: /usr/bin/Xorg.bin (WaitForSomething+0x1c9) [0x5618d751d4f9]
[ 60851.421] (EE) 7: /usr/bin/Xorg.bin (0x5618d7344000+0x4ceb8) [0x5618d7390eb8]
[ 60851.422] (EE) 8: /lib64/libc.so.6 (0x7f95d5a00000+0x281b0) [0x7f95d5a281b0]
[ 60851.422] (EE) 9: /lib64/libc.so.6 (__libc_start_main+0x8b) [0x7f95d5a28279]
[ 60851.422] (EE) 10: /usr/bin/Xorg.bin (_start+0x27) [0x5618d7391a15]
[ 60851.422] (EE)
[ 60851.422] (EE) Segmentation fault at address 0x0
Proper backtrace:
#9 0x00007f95d5a3f1b0 in <signal handler called> () at /lib64/libc.so.6
#10 0x00007f95d546d2a0 in drmmode_connector_check_vrr_capable (connector_id=<optimized out>, drm_fd=14)
at /usr/src/debug/xorg-server-21.1.8/hw/xfree86/drivers/modesetting/drmmode_display.c:3159
#11 drmmode_output_init
(pScrn=pScrn@entry=0x5618d8106d40, drmmode=drmmode@entry=0x5618d8107928, mode_res=mode_res@entry=0x5618da96d0d0, num=num@entry=5, dynamic=dynamic@entry=1, crtcshift=crtcshift@entry=0) at /usr/src/debug/xorg-server-21.1.8/hw/xfree86/drivers/modesetting/drmmode_display.c:3313
#12 0x00007f95d5473d00 in drmmode_update_kms_state (drmmode=0x5618d8107928)
at /usr/src/debug/xorg-server-21.1.8/hw/xfree86/drivers/modesetting/drmmode_display.c:4067
#13 0x00005618d7526192 in ospoll_wait (ospoll=0x5618d80e3980, timeout=<optimized out>) at ../../os/ospoll.c:657
#14 0x00005618d751d4f9 in WaitForSomething (are_ready=<optimized out>) at ../../os/WaitFor.c:208
#15 0x00005618d7390eb8 in Dispatch () at ../../dix/dispatch.c:492
#16 dix_main (envp=<optimized out>, argv=0x7ffd5e809588, argc=<optimized out>) at ../../dix/main.c:276
#17 main (argc=<optimized out>, argv=0x7ffd5e809588, envp=<optimized out>) at ../../dix/stubmain.c:34
(gdb) f 10
#10 0x00007f95d546d2a0 in drmmode_connector_check_vrr_capable (connector_id=<optimized out>, drm_fd=14)
at /usr/src/debug/xorg-server-21.1.8/hw/xfree86/drivers/modesetting/drmmode_display.c:3159
(gdb) f 10
#10 0x00007f95d546d2a0 in drmmode_connector_check_vrr_capable (connector_id=<optimized out>, drm_fd=14)
at /usr/src/debug/xorg-server-21.1.8/hw/xfree86/drivers/modesetting/drmmode_display.c:3159
3159 for (i = 0; !found && i < props->count_props; ++i) {
(gdb) l
3156 props = drmModeObjectGetProperties(drm_fd, connector_id,
3157 DRM_MODE_OBJECT_CONNECTOR);
3158
3159 for (i = 0; !found && i < props->count_props; ++i) {
3160 drmModePropertyPtr drm_prop = drmModeGetProperty(drm_fd, props->props[i]);
(gdb) p props
$1 = (drmModeObjectPropertiesPtr) 0x0
(gdb) up
#11 drmmode_output_init (pScrn=pScrn@entry=0x5618d8106d40, drmmode=drmmode@entry=0x5618d8107928, mode_res=mode_res@entry=0x5618da96d0d0, num=num@entry=5,
dynamic=dynamic@entry=1, crtcshift=crtcshift@entry=0) at /usr/src/debug/xorg-server-21.1.8/hw/xfree86/drivers/modesetting/drmmode_display.c:3313
(gdb) l
3312 ms->is_connector_vrr_capable |=
3313 drmmode_connector_check_vrr_capable(drmmode->fd,
3314 drmmode_output->output_id);
(gdb) p *ms
$6 = {fd = 14, fd_passed = 0, Chipset = 0, pEnt = 0x5618d8107bb0, noAccel = 0, CloseScreen = 0x5618d74305c0 <xf86CursorCloseScreen>,
CreateWindow = 0x5618d74e6380 <fbCreateWindow>, SaveGeneration = 4294967295, createScreenResources = 0x5618d7508ac0 <miCreateScreenResources>,
BlockHandler = 0x7f95d5433b60 <_glamor_block_handler>, SpriteFuncs = 0x5618d75b7c80 <miSpritePointerFuncs>, driver = 0x0, drmmode = {fd = 14, fb_id = 361,
mode_fb = 0x0, cpp = 4, kbpp = 32, scrn = 0x5618d8106d40, gbm = 0x5618d8122aa0, uevent_monitor = 0x5618d89befd0, uevent_handler = 0x5618d8bc4760,
event_context = {version = 0, vblank_handler = 0x0, page_flip_handler = 0x0, page_flip_handler2 = 0x0, sequence_handler = 0x0}, front_bo = {width = 3840,
height = 2400, dumb = 0x0, used_modifiers = 0, gbm = 0x5618da7807a0}, sw_cursor = 0, Options = 0x5618d811fd30, glamor = 1, shadow_enable = 0,
shadow_enable2 = 0, pageflip = 1, force_24_32 = 0, shadow_fb = 0x0, shadow_fb2 = 0x0, pixmapPrivateKeyRec = {offset = 152, size = 64, initialized = 1,
allocated = 0, type = PRIVATE_PIXMAP, next = 0x0}, spritePrivateKeyRec = {screenKey = {offset = 192, size = 0, initialized = 1, allocated = 0,
type = PRIVATE_SCREEN, next = 0x5618d75f0ac0 <miPointerScreenKeyRec>}}, vrrPrivateKeyRec = {offset = 0, size = 0, initialized = 0, allocated = 0,
type = PRIVATE_XSELINUX, next = 0x0}, sprites_visible = 0, reverse_prime_offload_mode = 0, is_secondary = 0, fbcon_pixmap = 0x0, dri2_flipping = 0,
present_flipping = 1, flip_bo_import_failed = 0, can_async_flip = 1, async_flip_secondaries = 0, dri2_enable = 1, present_enable = 1, vrr_prop_id = 24,
use_ctm = 0}, event_context = {version = 4, vblank_handler = 0x7f95d5469c00 <ms_drm_handler>, page_flip_handler = 0x7f95d5469c00 <ms_drm_handler>,
page_flip_handler2 = 0x0, sequence_handler = 0x7f95d5469c30 <ms_drm_sequence_handler_64bit>}, atomic_modeset_capable = 1, atomic_modeset = 0,
pending_modeset = 0, damage = 0x5618d8bc47f0, dirty_enabled = 1, cursor_width = 256, cursor_height = 256, has_queue_sequence = 1, tried_queue_sequence = 1,
kms_has_modifiers = 1, vrr_support = 0, flip_window = 0x5618d9323230, is_connector_vrr_capable = 0, connector_prop_id = 0, shadow = {Setup = 0x0, Add = 0x0,
Remove = 0x0, Update32to24 = 0x0, UpdatePacked = 0x0}, glamor = {back_pixmap_from_fd = 0x7f95d54317f0 <glamor_back_pixmap_from_fd>,
block_handler = 0x7f95d5433ae0 <glamor_block_handler>, clear_pixmap = 0x7f95d5433d40 <glamor_clear_pixmap>,
egl_create_textured_pixmap = 0x7f95d5431950 <glamor_egl_create_textured_pixmap>,
egl_create_textured_pixmap_from_gbm_bo = 0x7f95d54315a0 <glamor_egl_create_textured_pixmap_from_gbm_bo>,
egl_exchange_buffers = 0x7f95d5438c70 <glamor_egl_exchange_buffers>, egl_get_gbm_device = 0x7f95d542fe30 <glamor_egl_get_gbm_device>,
egl_init = 0x7f95d542feb0 <glamor_egl_init>, finish = 0x7f95d5435970 <glamor_finish>, gbm_bo_from_pixmap = 0x7f95d54391e0 <glamor_gbm_bo_from_pixmap>,
init = 0x7f95d5434690 <glamor_init>, name_from_pixmap = 0x7f95d54397a0 <glamor_name_from_pixmap>,
set_drawable_modifiers_func = 0x7f95d54358b0 <glamor_set_drawable_modifiers_func>,
shareable_fd_from_pixmap = 0x7f95d5439660 <glamor_shareable_fd_from_pixmap>,
supports_pixmap_import_export = 0x7f95d5435860 <glamor_supports_pixmap_import_export>, xv_init = 0x7f95d54303e0 <glamor_xv_init>,
egl_get_driver_name = 0x7f95d542fe60 <glamor_egl_get_driver_name>}}
(gdb) p name
$7 = "DP-3-1\000\000\b\000\000\000\025\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000@\000"