Feeds

* Posts by Steve 105

4 posts • joined 18 Jul 2009

Boffins debate killing leap seconds to help sysadmins

Steve 105

Re: Stopped clocks

ntpd will make small adjustments by skewing the wall time clock and large adjustments by stepping it.

Following a leap second the system learns from NTP that its clock is suddenly a second fast, then gradually brings it back into synch with the external time. Instead of stopping for a second, or repeating a second, it will in effect stop/repeat a few milliseconds at a time for a while.

I suppose it's possible that this behaviour can be changed, and/or is different by default on some distros. Since I don't actually care I've never verified. I have much worse problems than leap seconds keeping accurate time on the linux boxes I manage, the principle one being VMs whose clock is tied to the host, and whose host clock is incorrect.

0
0
Steve 105

Unix time

@ A Non e-mouse: Unix time is the count of non-leap seconds since 1st Jan 1970. That is to say, it is not continuous. Strictly speaking it pauses for the duration of a leap second, practically of course on almost all systems it ploughs on regardless and gets corrected afterwards by NTP.

That said, we do have a continuous time parameter in common use in consumer devices. GPS time is the count of seconds since 6th January 1980.

The "big" difference that this change would make is that devices with GPS but no internet will be able to use GPS time to compute the "user friendly" time. They can't do that at the moment because leap seconds aren't predictable, so without an internet connection (or some other means of update) you can't tell how many have happened since 1980 (currently 16).

I don't own any clocks more accurate than 1 second in 2 years, and I think for the average person GPS is their best chance of having one. That said, IMO 2013 is a bit of a weird year to start worrying about non-connected devices. In terms of capability this measure seems to cover the very narrow gap that starts when GPS becomes easy, and ends when connecting to the internet becomes easy. In terms of cost, I don't know how much leap seconds do cost, but for most uses their effect is negligible compared with the inaccuracy of your on-board time-keeping device. Removing them from the equation doesn't really help because you still need *some* external source of accurate time.

1
0

Redundancy costs dent BT profits

Steve 105
FAIL

"Chief executive Ian Livingstone"?

The BT guy is Ian Livingston. Ian Livingstone is the Games Workshop / Eidos guy.

0
0

Clever attack exploits fully-patched Linux kernel

Steve 105

Optimisation

Surely the reason for the optimisation is (among other things) code like this:

inline char foo(char *p) { if (p == 0) return 0; else return *p; }

char bar(char *p) { *p = 2; return foo(p); }

int main() { char c = 0; return bar(&c); }

If foo gets inlined into bar, the compiler can spot that the null pointer check in the inlined code is unnecessary and remove it. This is a most excellent optimisation (granted, in this example foo and bar do so little work that other optimisations may render it unnecessary).

As far as the C standard is concerned, this optimisation doesn't have to assume that a null pointer dereference would halt the program. The dereference of a pointer which may or may not have been null means that the implementation can thereafter assume it wasn't null. If it was null the behaviour of the rest of the program is undefined anyway, so the tiny detail of the assumption being false doesn't make it invalid. If dereferencing null is valid and is supposed to have predictable behaviour, then you're into non-standard C, so you have to read the compiler docs. GCC's behaviour appears to be (a) standards compliant and (b) documented, so should come as no great surprise to the programmer.

For my example code, the optimisation certainly should not result in a compiler warning or error. There's nothing wrong with either function foo or function bar. It's just that one of them takes the (perfectly reasonable) approach of checking its input, and the other one takes the (also perfectly reasonably) approach of requiring that its callers not pass in null pointers. Standard functions exist taking both approaches - compare for example time() and strlen().

0
0