Johannes,

Unsigned longs are 4 bytes. Unsigned long longs are 8 bytes. One byte equals 8 bits.

Bob Stewart


Get Outlook for Android


From: Johannes Kliemann <kliemann@...543...>
Sent: Sunday, February 18, 2018 6:01:36 AM
To: Genode OS Framework Mailing List
Subject: 32 bit overflow in timer
 
Hi all,

I noticed a 32 bit overflow in the Timer::Connection sleep functions and
triggers.
Calling usleep or trigger_once with an hour (3 600 000 000 us) works but
calling it with two hours (7 200 000 000 us) causes something to
overflow and stop the timer after 2 905 032 704 us which equals 7 200
000 000 & (2^32 - 1).

As far as I have checked this these functions use the unsigned long
which is indeed 64 bit but I think at some point only 32 bit are used.

Is this intended behaviour?
If so I think it would make sense to give out a warning at least.

Regards,
Johannes

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
genode-main mailing list
genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main