Bug 1011570

Summary: Xorg crashed after unplug displaylink monitor
Product: [openSUSE] openSUSE Distribution Reporter: Joey Lee <jlee>
Component: X.OrgAssignee: Michal Srb <msrb>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <xorg-maintainer-bugs>
Severity: Normal    
Priority: P5 - None CC: jlee, msrb, mstaudt, oneukum
Version: Leap 42.2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Joey Lee 2016-11-22 10:31:24 UTC
I used a Lenovo USB 2.0 Port Replicator that it has displaylink to connect a Dell monitor:
   https://support.lenovo.com/us/zh/documents/migr-76983

On openSUSE 42.2, it works to show desktop on external monitor with DVI. But, unplugging displaylink device causes xorg crash.

Even using xrandr to turn off the DVI on displaylink device first, xorg still crash after unplug displaylink.

This issue doesn't happen on SLE12-SP2, openSUSE 42.1 and openSUSE 13.1.
Comment 1 Michal Srb 2016-11-22 12:29:51 UTC
Please provide X server log and the crash backtrace or ideally core dump.

(In reply to Joey Lee from comment #0)
> This issue doesn't happen on SLE12-SP2, openSUSE 42.1 and openSUSE 13.1.

Were you actively using the displaylink for additional outputs in those distributions? If not, it is possible it would still crash in there, but didn't just because it wasn't auto-configured as it is in 42.2.
Comment 2 Michal Srb 2016-11-22 12:51:49 UTC
I can reproduce it with my device. Looking into it...
Comment 3 Michal Srb 2016-11-22 13:42:25 UTC
The problem is that modesettings' FreeRec function zeroes pScrn->driverPrivate and then calls function that tries to use it. It was fixed upstream in commit a41a171bcbae9aeafac2865faa904f15d9b59925, I'll backport it.
Comment 4 Max Staudt 2016-11-22 14:04:02 UTC
I have reproduced this. Taking the bug.
Comment 5 Max Staudt 2016-11-22 14:05:18 UTC
Ooops, Michal is already looking into it.

This is a dupe of boo#981268. Michal, can you mark this once you've ported U_modesetting-set-driverPrivate-to-NULL-after-closing-fd.patch over to Leap 42.2?
Comment 6 Stefan Dirsch 2016-11-22 14:17:16 UTC
Indeed this is a duplicate, for which the fix even landed in sle12-sp2 but for some reason not in Leap 42.2. :-(
Comment 7 Michal Srb 2016-11-22 14:21:48 UTC
Submitted to openSUSE 42.2:
https://build.opensuse.org/request/show/441403

Closing as duplicate of 981268.

*** This bug has been marked as a duplicate of bug 981268 ***
Comment 8 Joey Lee 2016-11-23 04:07:57 UTC
(In reply to Michal Srb from comment #7)
> Submitted to openSUSE 42.2:
> https://build.opensuse.org/request/show/441403
> 
> Closing as duplicate of 981268.
> 
> *** This bug has been marked as a duplicate of bug 981268 ***

The patch works to me! Thanks for your help!
Comment 9 Swamp Workflow Management 2016-11-30 10:06:53 UTC
openSUSE-RU-2016:2951-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 1011570
CVE References: 
Sources used:
openSUSE Leap 42.2 (src):    xorg-x11-server-7.6_1.18.3-4.1