Bug with entering Alarms in 1900, possibly showing a feature of the Territory module
James Lampard (51) 120 posts |
From watching what’s added to CVS, I see that a change has been made to Alarm, possibly because it has a problem with alarms in 1900 http://www.riscosopen.org/viewer/view/castle/RiscOS/Sources/Apps/Alarm/bas/!RunImage%2Cffb The author claims he can’t reproduce this bug, so I thought I’d have a go, and I quickly succeeded. To cause the bug: Open the “Set alarm” window. Set the year to 1900, month to January, Day to 1. Then set hour to 0, press tab and you get the error “Bad time values” and Alarm bombs out. I had to think about this for a while before realising what was causing the error; it’s because of British Summer Time. A BST time of 0:00 on 1 Jan 1900 is in fact a UTC time of 23:00 on 31 Dec 1899 The odd thing is that the territory manager returns this as error 0. I’m guessing that it’s only in Basic that this has the special meaning of a fatal error. (In RO6.06 it’s also error 0). Was this for development and did they just forget to allocate an error number? In Alarm’s case it has the unfortunate effect of skipping the error handler and giving the user no option of continuing. |
Ben Avison (25) 445 posts |
It was me that couldn’t reproduce the bug – uploading a change to the repository on behalf of the author of the change, Detlef Thielsch. Detlef has since given me more details on the bug – it only happens if you’re in a positive timezone (so it affects him in Germany but not me in the UK). Strangely, it seems to be affected by timezone and not by DST setting (since the UK is currently on UTC +1 hour, you’d think it would be treated the same, but it isn’t). The bug affects any time in 1900, not just the first hour of it. I’m guessing something is evaluating the RISC OS internal time (centiseconds since 1900-01-01 00:00 UTC) that corresponds to 1900-01-01 00:00 local time as part of an intermediate calculation. It’s not clear where the problem is, whether it’s Alarm, the Territory Manager or some other part of the OS. Feel free to investigate! |
James Lampard (51) 120 posts |
The CVS log said “Change suggested by” rather than “Changes by” which confused me as to the actual authorship.
What’s the error message? By the way, well done on getting the UK and German templates THE WRONG WAY ROUND! ;) |
Ben Avison (25) 445 posts |
That’s because he provided the fix in prose form. Normally we’d prefer changes to be submitted as diffs or replacement files (processing source submissions is a tedious and time-consuming task at the best of times) but since he was a new contributor, I wanted to encourage him and so didn’t complain.
“Bad time values”. You can probably reproduce it with any version of Alarm –
D’oh! Thanks for pointing that out. Now fixed. |
Steve Revill (20) 1361 posts |
In case you’ve not spotted it, the template switch is fixed in cvs now. I’ll try a rebuild of all the pre-built stuff today and see where I get to. |