Steevee28 wrote: 
> That's interesting. My findings were completely different. See, e.g.:
> https://github.com/Logitech/squeezeplay/blob/49f41e48311ade3a4a879b4b27283036363724b5/src/squeezeplay/src/ui/jive_framework.c#L1305
> and following.
> or see these lines of code in jive/ui/Timer.lua:
> https://github.com/ralph-irving/jivelite/blob/a1307c523a7f70e28ecde3a1e238132b23323a77/share/jive/jive/ui/Timer.lua#L161
> https://github.com/ralph-irving/jivelite/blob/a1307c523a7f70e28ecde3a1e238132b23323a77/share/jive/jive/ui/Timer.lua#L177
> https://github.com/ralph-irving/jivelite/blob/a1307c523a7f70e28ecde3a1e238132b23323a77/share/jive/jive/ui/Timer.lua#L183
> 
I read that somewhat different, because the values of xxx.expires are
created elsewhere from jive_jiffies incremented with some
max_process_time value. The sole purpose of those lines you mentioned is
thus to identify timeouts.

> 
> oh, and that's a funny one (although very probably irrelevant):
> https://github.com/ralph-irving/jivelite/blob/a1307c523a7f70e28ecde3a1e238132b23323a77/src/system.c#L100
> 
Interesting comment, as it clearly shows that the programmer was aware
of the limit, but didn't consider it to be critical nor realized that
LUA would cast the value to a signed int.

> 
> Note: the easiest way to test the changes may be to modify the code of
> jive_jiffies(), so that it returns a timer value close to (int32_t)
> wrapping right from the start, so we don't need to wait for 24 days, see
> https://github.com/Logitech/squeezeplay/blob/49f41e48311ade3a4a879b4b27283036363724b5/src/squeezeplay_baby/src/common.h#L67
Yes, but that also requires compiling to the correct (ancient) support
libraries, although maybe you could get away with static linking on a
newer development platform. Of course once you do that you can also fix
jive_jiffies() to perform the roll-over itself at some `safe` time. 

Another option for testing in this case would be to upgrade LUA to 5.4+
and replace all instances of `lua_Number` (signed) to `lua_Integer`
(unsigned), which should either shift the restart to after 49 days or
possibly continue indefinitely.


------------------------------------------------------------------------
gordonb3's Profile: http://forums.slimdevices.com/member.php?userid=71050
View this thread: http://forums.slimdevices.com/showthread.php?t=111650

_______________________________________________
Radio mailing list
Radio@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/radio

Reply via email to