(In reply to comment #26) > Created attachment 101338 [details] > GDB log with "avoid dangling..." patch > > /dev/dri/card0 on fd #4 closed, > /dev/dri/card0 on fd #5 remained open. So... for some *unknown* reason, the thing decides to create two screens. Fine. Now we have this thing which reuses screens for the same device... makes sense. But after it tries to close one of the screens, it also closes the fd that it used to create the screen with. Reasonable enough. However that fd is the one that's being used by the device. Perhaps it should be dup'ing the fd and doing all the ioctl's on that, so that this sort of thing doesn't happen. Maarten, thoughts?