(timeout in ms vs. XSyncValueSubtract) Frozen client, found cause, need advise for fix

Mihail Konev k.mvc at ya.ru
Tue Feb 21 19:28:19 UTC 2017


On Tue, Feb 21, 2017 at 05:48:19PM +0100, walter harms wrote:
> > 
> 	
> XSyncValueSubtract is doing as expected,
> XSyncValue is the simulation of 64bitvalues on 32bit.
> see this in hex:
>  100000001
> -000000002
>  0FFFFFFFF = 4294967295 in .lo
> 

Kind of - it errorneously returns

 1 0000 0001
-0 0000 0002
 1 ffff ffff

Test source attached.

I.e.
  XSyncValueSubtract should handle the .lo becoming <0,
  and it checks only for .lo_after_subtract < .lo,
  which would only be aplicable to uint.

E.g. there is a typo in XSyncValue.lo definition - it should be uint
instead.
Also in ServertimeBlockHandler, "timeout" is unsigned,
while it is get from signed .lo and used as signed arg to
AdjustWaitForTimeout.

Perhaps also:
  AdjustWaitForTimeout should not be used if overflow != 0
  Because something is wrong then as (pnext_time < Now) ?

Mihail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-c
Size: 2302 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20170222/2d20a498/attachment.bin>


More information about the xorg-devel mailing list