Hi guys,

This is a xserver issue where timers-list gets corrupted because of race 
condition.
nVidia X-driver uses timer to update scanout surface after regular interval, 
this timer gets removed from timers list because of this timers-list corruption 
and desktop gets freezed. This is only happening with touch pad because touch 
pad driver is also heavily using timers, which is easily triggering this race 
condition.

xserver goes through following race condition -

        WaitForSomething()
        |
        ---->  // timers -> synaptics-1 -> nvidia-2 -> null
               while (timers && (int) (timers->expires - now) <= 0)
                   // prototype - DoTimer(OsTimerPtr timer, CARD32 now, 
OsTimerPtr *prev)
                   DoTimer(timers, now, &timers)
                   |
                   |
                   ----> OsBlockSignals();  .... SIGIO OS Signal comes just 
before blocking it,
                                                               ....  
synaptics-1 handler gets called.
                                                              // synaptics-1 
gets served and scheduled again;
                                                              // timers -> 
nvidia-2 -> synaptics-1 -> null
                                                              ....
                             *prev = timer->next;
                              timer->next = NULL;   // timers -> null
                              // timers list gets corrupted here and nvidia-2 
gets removed from list.

Attaching patch to fix this issue, its working for me.


** Patch added: "0001-os-Fix-timer-race-conditions.patch"
   
https://bugs.launchpad.net/ubuntu/+source/nvidia-prime/+bug/1220426/+attachment/4259702/+files/0001-os-Fix-timer-race-conditions.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1220426

Title:
  [nvidia-prime]Freeze while using touchpad

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-319/+bug/1220426/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to