DisplayLink / evdi

Extensible Virtual Display Interface
MIT License
689 stars 179 forks source link

Crash when unloading the module #382

Open nbdd0121 opened 1 year ago

nbdd0121 commented 1 year ago

I have a script that requires stopping the DisplayLink manager and unloading the EVDI module (to prepare them for VM passthrough), and can encountered kernel faults quite consistently with this command (run as root):

systemctl stop display-manager
systemctl stop displaylink-driver
rmmod evdi
Kernel Log/Stacktrace ```dmesg [ 496.060819] general protection fault, probably for non-canonical address 0xed3b19745d61b1b: 0000 [#1] SMP NOPTI [ 496.060983] CPU: 16 PID: 15305 Comm: rmmod Tainted: P OE 5.15.0-52-generic #58-Ubuntu [ 496.061303] RIP: 0010:evdi_painter_dpms_notify+0x20/0xf0 [evdi] [ 496.061406] Code: 2e 0f 1f 84 00 00 00 00 00 90 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 41 54 49 89 fc 53 4c 8b 6f 30 4d 85 ed 0f 84 97 00 00 00 <45> 0f b6 75 00 89 f3 41 80 fe 01 0f 87 91 2d 00 00 41 83 e6 01 74 [ 496.061698] RSP: 0018:ffffb2257066fa80 EFLAGS: 00010206 [ 496.061784] RAX: 000000000000000e RBX: ffff9ea586293200 RCX: ffff9ea586293200 [ 496.061899] RDX: ffff9ea48c94e980 RSI: 0000000000000003 RDI: ffff9ea4adee5ae0 [ 496.062011] RBP: ffffb2257066faa0 R08: ffff9ea498c68240 R09: 0000000000000000 [ 496.062124] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9ea4adee5ae0 [ 496.062237] R13: 0ed3b19745d61b1b R14: 0000000000000000 R15: ffffffffc063c480 [ 496.062349] FS: 00007f6f6ff2cc40(0000) GS:ffff9ec33ee00000(0000) knlGS:0000000000000000 [ 496.062478] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 496.062569] CR2: 000055dafaa41178 CR3: 000000019f360000 CR4: 0000000000750ee0 [ 496.062682] PKRU: 55555554 [ 496.062728] Call Trace: [ 496.062769] [ 496.062805] evdi_crtc_atomic_flush+0x8c/0x130 [evdi] [ 496.062887] drm_atomic_helper_commit_planes+0x20d/0x290 [drm_kms_helper] [ 496.063001] ? disable_outputs+0x1f1/0x300 [drm_kms_helper] [ 496.063095] drm_atomic_helper_commit_tail+0x47/0x90 [drm_kms_helper] [ 496.063204] commit_tail+0x10c/0x170 [drm_kms_helper] [ 496.063289] ? drm_atomic_helper_swap_state+0x20f/0x370 [drm_kms_helper] [ 496.063401] drm_atomic_helper_commit+0x12b/0x150 [drm_kms_helper] [ 496.063505] drm_atomic_commit+0x4a/0x60 [drm] [ 496.063587] drm_atomic_helper_disable_all+0x194/0x1b0 [drm_kms_helper] [ 496.063699] drm_atomic_helper_shutdown+0x72/0x120 [drm_kms_helper] [ 496.063802] evdi_drm_device_remove+0x1b/0x30 [evdi] [ 496.063884] evdi_platform_device_remove+0x28/0x40 [evdi] [ 496.063972] platform_remove+0x24/0x50 [ 496.064035] __device_release_driver+0x1ab/0x2a0 [ 496.064111] device_release_driver+0x29/0x40 [ 496.064182] bus_remove_device+0xde/0x150 [ 496.064246] device_del+0x19c/0x400 [ 496.064304] ? vprintk_default+0x1d/0x30 [ 496.064369] platform_device_del.part.0+0x18/0x90 [ 496.064445] platform_device_unregister+0x20/0x40 [ 496.064521] evdi_platform_dev_destroy+0xe/0x30 [evdi] [ 496.064605] evdi_platform_remove_all_devices+0x56/0xd0 [evdi] [ 496.064700] evdi_exit+0x31/0x667 [evdi] [ 496.064766] __do_sys_delete_module.constprop.0+0x187/0x290 [ 496.064859] ? __rseq_handle_notify_resume+0x2d/0xc0 [ 496.064941] __x64_sys_delete_module+0x12/0x20 [ 496.065013] do_syscall_64+0x5c/0xc0 [ 496.065073] ? syscall_exit_to_user_mode+0x27/0x50 [ 496.065156] ? __x64_sys_close+0x11/0x50 [ 496.065228] ? do_syscall_64+0x69/0xc0 [ 496.068955] ? ksys_read+0x67/0xf0 [ 496.072343] ? exit_to_user_mode_prepare+0x37/0xb0 [ 496.074286] ? syscall_exit_to_user_mode+0x27/0x50 [ 496.076156] ? __x64_sys_read+0x19/0x20 [ 496.077953] ? do_syscall_64+0x69/0xc0 [ 496.079681] entry_SYSCALL_64_after_hwframe+0x61/0xcb [ 496.081399] RIP: 0033:0x7f6f70054c9b [ 496.083053] Code: 73 01 c3 48 8b 0d 95 21 0f 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 65 21 0f 00 f7 d8 64 89 01 48 [ 496.086746] RSP: 002b:00007ffc52621648 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0 [ 496.088556] RAX: ffffffffffffffda RBX: 000055dafaa36780 RCX: 00007f6f70054c9b [ 496.090399] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055dafaa367e8 [ 496.092202] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 [ 496.093991] R10: 00007f6f700ecac0 R11: 0000000000000206 R12: 00007ffc526218a0 [ 496.095746] R13: 000055dafaa362a0 R14: 00007ffc52622f6e R15: 000055dafaa36780 [ 496.097509] ```
LinuxCuba commented 1 year ago

Exactly the same thing happens to me, but using Plasma KDE, kernel 6.0.3 in Ubuntu LTS 22.04. The build succeeds, the module is installed and crash desktop environment.