* Posts by Paul Crawford

5665 publicly visible posts • joined 15 Mar 2007

Y2K quick-fix crick? 1920s come roaring back after mystery blip at UK's vehicle licensing agency

Paul Crawford Silver badge

Re: 2038

What seems to be missing here is the original topic - trying to fix 2038 in existing 32-bit Linux programs.

The only proper fix (i.e. works as before with signed time_t and works beyond 2038) is to go 64-bit for time_t at least (other integers can be still be 32-bit if you are targeting 32-bit MCUs etc). But that needs a re-compile of the OS and the applications (Perl interpreter in your case). And beyond that it also requires anything that maps time_t in to some structure to accommodate that. Fine for internal memory structures that are re-defined on compile to use 64-bit time_t but no use for code that has time in files, shared memory, etc, so a re-compile for 64-bit is not going to work that easily unless the program already has a debugged 64-bit version.

My point was to fix / fudge existing compiled 32-bit code the least-worst option is to make the Linux system libraries treat time_t as unsigned so it runs 1970 to 2106. Yes it breaks pre-1970 date conversion (but that was never defined as working anyway) but there are no better alternatives. Changing the epoch (even dynamically via environment variable per program, etc) will also risk breaking code that has pre-compiled time-points based on 1970, etc. If your machine is running day-to-day, and not working for very old dates, going unsigned for the internal conversion will work well enough. But there will always be something that breaks if you change it, is that any worse than everything breaking post-2038?

Paul Crawford Silver badge

Re: 2038

That is kind of pedantic as -1 and 0xFFFFFFFF are the same bit-pattern in two's compliment representation for 32-bit variables.

That is all a compiled program cares about, is the library-returned value equal to this test-case value?

Paul Crawford Silver badge

Re: 2038

Maybe, but currently most 32-bit Linux time code breaks on negative value

time_t was never intended for date manipulation (though it ended up that way). Some 32-bit time_t libraries I have tested do work for negative time_t, others are broken (probably as a sanity-check as that is not a supported operation). In most cases what matters for code is getting the current time correctly, and interpreting file time stamps, etc.

If you need to work pre 1970 and post 2038 there is no simple 32-bit integer solution possible and then you have to make 64-bit changes, recompile, test, etc..

Paul Crawford Silver badge

Re: 2038

Bad idea for 32-bit applications in case they store data in fixed size arrays or file-based structure that are assuming 32-bits. For new code the fix is simple - go 64-bit, but for trying to run legacy code beyond 2038 its not as simple a change.

Paul Crawford Silver badge

Re: 2038

You rarely count time backwards, and very unlikely for that to be around the epoch of the time scheme. I'm not suggesting making signed integers unsigned, just the treatment of 32-bit time_t

Paul Crawford Silver badge

Re: 2038

How many Linux systems, or indeed embedded systems are written in those languages?

More to the point, all of the system libraries for Linux (the subject of this thread) are written in C so any fix need only work for that.

Paul Crawford Silver badge

Re: 2038

Just to add you can easily include time_t in to the same simple test program. But on typical 64-bit Linux box that is going to fail (as time_t is 64-bit and not the 32-bit unsigned used for this demo) so you need to add 32-bit support for testing it as a 32-bit program. For example:

sudo apt-get install gcc-multilib g++-multilib

Then compile for 32-bit machine with:

gcc -Wall -m32 itest.c -o itest

Paul Crawford Silver badge

Re: 2038

Really?

I have done so in C quite happily for 32-bit code in DOS, Windows (compilers 6.0 and 2018), Linux (32 and 64-bit), and in the past Solaris. And it all works.

Try this:

#include <stdint.h>

#include <stdio.h>

int main()

{

uint32_t uu;

int32_t ii = -1;

uu = (unsigned)ii;

if(ii == uu) printf("test 1 OK\n");

if(uu == (unsigned)-1) printf("test 2 OK\n");

return 0;

}

$ gcc -Wall itest.c -o itest

./itest

test 1 OK

test 2 OK

Paul Crawford Silver badge

Re: 2038

No it would not!

Try it - write a 32-bit program, cast -1 to unsigned and then compare it to -1 and do the same with time_t. You will find they are the same.

The only catch is if someone has tested a time_t data type along the lines of if(t < 0) instead of if(t == -1) for error handling.

Paul Crawford Silver badge

Re: 2038

The simplest 'fix' for 32-bit is to treat the integer as unsigned (but possibly -1 as special error case), that buys you another 68 years. For code that uses dynamic libraries then a fix there ought to fix the program, assuming some coded did not do anything too dumb in re-implementing library time code.

However, it won't do anything for software on embedded systems as you say, or even legacy 32-bit code that was statically linked and you can't recompile.

Privacy activists beg Google to ban un-removable bloatware from Android

Paul Crawford Silver badge

Well they have the stick of withdrawing Google's "essential" core code if they don't play. After all, that is the reason that an Android fork has had so little backing because (as MS found out the expensive way) no one buys the OS - they buy the phone for the apps that run on it.

It's a no to ZFS in the Linux kernel from me, says Torvalds, points finger of blame at Oracle licensing

Paul Crawford Silver badge

Re: Torvalds declared: "Don't use ZFS. It's that simple."

Torvalds comment seem to miss a key point: you don't usually chose ZFS for performance but for (1) data integrity, and (2) low-overhead snapshots (another data integrity plus if faced with user mistakes or user-level ransom-ware).

BtrFS promises similar, but to my limited knowledge is not nearly as good as ZFS for now (also ironically it was started by Oracle to have a ZFS alternative).

Tea tipplers are more likely to live longer, healthier lives than you triple venti pumpkin-syrup soy-milk latte-swilling fiends

Paul Crawford Silver badge

Amount?

"three or more cups of the warm nectar per week"

Per week? I was thinking more per hour!

Google and IBM square off in Schrodinger’s catfight over quantum supremacy

Paul Crawford Silver badge

Re: Harder is better.

Definitely holding it right

Windows 7 and Server 2008 end of support: What will change on 14 January?

Paul Crawford Silver badge
Big Brother

Re: You are putting your company, its staff, and data at risk

MS don't see the irony in adding telemetry by default to Win10 and they saying the earlier systems now put your data at risk.

Paul Crawford Silver badge

Depending on what you do* simply running Win7 in a VM on something else is a reasonable approach.

You can do web/email on the 'something else' that is patched and the VM never has hardware changes or similar to worry about activation. Also many advanced malware sees the OS in a VM and avoids running to thwart analysis, so you you get some small extra benefit on top of the ease of backing up the whole VM as you please.

[*] Probably not gaming or other very heavy graphics applications.

Paul Crawford Silver badge

Microsoft - If you continue to run Windows 7 in your organisation after next week you are putting your company, its staff, and data at risk because there simply won't be any more security patches made available

Customer - You mean that after two decades you still have not fixed the bugs?

GSMA report: Sorry, handset makers, 5G is not going to save the smartphone market

Paul Crawford Silver badge

Even when I have a 'good' 4G signal in the city I often get rubbish performance. I doubt that fixing that needs 5G and its not important enough to me to spend much money on it either way.

5G signals won't make men infertile, sighs UK ad watchdog as it bans bonkers scary poster

Paul Crawford Silver badge
Coat

No, they were just holding it wrong.

Mine is the one with a bottle of hand lotion in the pocket =>

Xerox grabs $24bn from banking titans to fund hostile takeover of HP Ink

Paul Crawford Silver badge

And probably another Autonomy-style trial when folk realise a foolish take-over has not made everyone massively richer?

European Space Agency launches planet-hunting Cheops while Rocket Lab starts on a third launchpad

Paul Crawford Silver badge

Re: "using green hydrogen peroxide oxidiser and kerosene"

HTP (high test peroxide) and kerosene is green compared to the other long-life liquid rocket fuel of nitrogen tetroxide and unsymmetrical dimethylhydrazine (UDMH) as favoured by, for example, the Indians who basically use a reliable modified ICBM to launch stuff.

Yes, liquid oxygen (LOX) is nicer as a oxidiser, but you can't really use it (or other cryogenic fuels) in the UK very well as you only have a short window to fuel the rocket and launch, so you need fairly dependable weather. ALL such oxidisers are bad in large amounts, but nothing compared to some stuff that was contemplated in the distant past (just google for chlorine triflouride if you feel brave).

It's cool for Brit snoops to break the law, says secretive spy court. Just hold on while we pull off some legal jujitsu to let MI5 off the hook...

Paul Crawford Silver badge

Interesting judgment.

Going to be even more interesting post-Brexit when the EU has to decide on the UK's acceptability in terms of privacy protection for data sharing.

'Supporting Internet Explorer is hell': Web developers identify top needs – new survey

Paul Crawford Silver badge
FAIL

Re: Interesting that the communty here seems almost unified for once

Yes, the Farnell site (and CPC, Newark, as they are all the same organisation) is quite crap in this respect and also I found a couple of months ago that using uBlock was breaking the site's search options. WTF did they do? Have every search going back to Google?

Reported it and got the usual lame "have you cleared your cookies/cache?" sort of shit.

Google tightens the screw on 'less secure apps', will block most access from June 2020

Paul Crawford Silver badge

Re: Gmail must die.

Yahoo still do POP3 access - slightly unreliably of course!

MS (outlook) also provide 'free' and POP3 access but no (obvious) means to bypass the web interface to check for spam (same issue as google)

I use A&A email service for a small fee (couple of quid per month) and they offer IMAP and POP3 and you can set up a filter in the web interface to force spam-detected stuff in back to the inbox so you always see it in your email client. https://support.aa.net.uk/Category:Email

If not UK-based you might want to look at other small-fee email providers like fastmail, etc.

Log us out: Private equity snaffles Lastpass owner LogMeIn

Paul Crawford Silver badge
Black Helicopters

Re: Ouch

Lets be realistic here. If you are a "person of interest" to any of the 3 (or 4) letter agencies they probably have a whole lot of other ways to get your info without identifying and brute-forcing your password manager:

- Formally demand it of any web service you use (probably works for more than half of them, see PRISM)

- Exploit back doors in to their systems to get it informally (smaller non-PRISM entities)

- Exploit back doors to breach your system

- Send round some goons with rubber hoses for some "advanced cryptography lessons"

Paul Crawford Silver badge

Re: Ouch

"Why on earth are you storing such things in the cloud ?"

If the file is at all competently encrypted then is should not matter how you sync devices as you still need a master password and, as long as the cloud provider lacks that, you are safe.

Post Office faces potential criminal probe over Fujitsu IT system's accounting failures

Paul Crawford Silver badge

And made all the more disgraceful by the fact they have dragged this out for 20 years.

Those in charge should face prosecution for malice, no doubts.

Why is the printer spouting nonsense... and who on earth tried to wire this plug?

Paul Crawford Silver badge

Re: Not on the wall socket

Very much this =>

The problems reported in this thread are almost certainly down to incompetents running tests that are inappropriate for the class of equipment. We had our technician do the PAT testing on all equipment, including very expensive lab test gear using one of the fairly basic Seaward testers without any problems.

And as other commentards have alluded to, the test interval "depends". On stuff like servers, fixed PCs that no one can trip on the cables, etc, then when new* and at 3 year intervals is probably fine. For equipment subject to moving but benign environments like kettles, laptop power supplies, etc, then yearly makes sense. For stuff with a high risk of damage or more serious risk if they fail like frequently used extension leads, building site power tools, etc, then 3 months might be more appropriate. Also as already mentioned the inspection for damage or an incorrect fuse rating is critical!

https://www.hse.gov.uk/pubns/priced/hsg107.pdf

[*] I don't trust suppliers (more so if folk bring in their own or 2nd hand stuff) and you also then have a PAT database that doubles up as an asset register, etc.

Paul Crawford Silver badge

Re: Not on the wall socket

It is EXACTLY this sort of fault that PAT testing was introduced to deal with! Along with stress-induced opens to the earth wire, another potentially nasty problem with cables and extensions leads.

You can check for mixed wires with a multimeter, or plug it in and used one of the cheap (£10 or so?) plug testers that warns of swapped or missing connections. But if you have a lot of kit, small tech company, etc, then it probably makes sense to buy a proper tester like the Seaward PrimeTest 100 (£350-ish) and look after all your stuff with regular testing (it will do insulation / leakage tests on the appliances as well as cable cross and lead resistance on IEC leads and extensions leads, etc). For a bit more (£450-ish inc VAT) their '250' model will also test RCCB trip times, etc.

Oi, Queenslander who downloaded 26.8TB in June alone – we see you

Paul Crawford Silver badge
Gimp

Re: Eew!

Is "brotherly bonding" one of these speciality men-in-leather videos I hear about?

BOFH: I'd like introduce you to a groovy little web log I call 'That's Boss'

Paul Crawford Silver badge

Re: Gotta say

You have a point and there is always the Samaritans (https://www.samaritans.org/) ready to listen hence another commentard's reference to the free number 116 123

The background to them is, of course, tragic as well and something that ought to be rammed down the throats of any politician, etc, who wants to control access to valid sexual information. From the Wikipedia page:

Samaritans was founded in 1953 by Chad Varah, a vicar in the Church of England Diocese of London. His inspiration came from an experience he had had some years earlier as a young curate in the Diocese of Lincoln. He had taken a funeral for a girl of fourteen who had killed herself because she feared she had contracted an STD. In reality, she was menstruating.

Most who joke here are doing what is common, dealing with the horrors of real life through humour and not actually meaning any harm to those with mental health issues.

Take Sajid Javid's comments on IR35 UK contractor rules with a bucket of salt, warns tax guru

Paul Crawford Silver badge

They wont. If they win the election they will do exactly the same as they have for the past 9 years - i.e. screw over everyone but their big-money mates.

Mozilla locks nosy Avast, AVG extensions out of Firefox store amid row over web privacy

Paul Crawford Silver badge

I just had to search for Bad Dragon and lo! It also makes hentai / alien tentacle dildos! You have been warned...

Register Lecture: Can portable atomic clocks end UK dependence on GNSS?

Paul Crawford Silver badge

Re: end UK dependance on GPS?

You don't need a local accurate clock: with 3 satellites you do, but with 4 you can solve for position and time. All that this would do is eliminate the need for one degree of the solution, but you really want more than the minimum anyway because (a) some might close together leading to the "geometric dilution of precision" and poorer fix accuracy and (b) with N+1 you can tell if one satellite is flaky, and with N+2 you can tell which one it is.

So really all that you get from an accurate local clock is a benefit if you are using GPS for time sync (important for mobile phones, DTV, etc) as you can run for longer between synchronisation times. What you don't get is navigation without some form of triangulation (even if star tracking...)

EFF warns of 'one-way mirror' of web surveillance by tech giants – led by Google

Paul Crawford Silver badge

Re: "The problem is complex"

Another solution that might appeal to governments is a "tracker tax" so none of this EU-style "do you consent to cookies/blah-blah-bla?" pop-up crap, but every aspect of tracking is taxed and, of course, companies must fully declare their income or face criminal charges.

We've found it... the last shred of human decency in an IT director – all for a poxy Unix engineer

Paul Crawford Silver badge
Facepalm

Re: The senior manager wearing a mob cap and apron

Same at my previous university. They decided to "save money" by not having cleaners empting the office bins. So staff had to do this sort of thing to centrally located places in each building. So, as you say, a couple of hours per week for a near-minimum-wage person being replaced by at least the same time (if not more due to them not being organised, as fit, etc) of folk on 3-10 times the salary doing that work.

Paul Crawford Silver badge

Re: right to look for a procedural problem

Very much so!

I have made similar simple mistakes (although not costing anywhere near as much) and the real point is to find out "how do we stop this happening again?". Having a different reviewer helps a lot (as you read what you think you wrote, etc) but also looking in to the choice of component, etc, to try and make things unambiguous. For example, I always try to use SOT-23 (3-pin case) style diodes even though they take up a bit more board space so they can't go in reversed during assembly, etc.

Go champion retires after losing to AI, Richard Nixon deepfake gives a different kind of Moon-landing speech...

Paul Crawford Silver badge

No, Deep Fake is worrying when any fsktard with 30 seconds spare can generate them.

A bit like drones in that respect, old school RC planes and helicopters took skill and experience to master, new drones can be used by any moron (and some are).

In Rust We Trust: Stob gets behind the latest language craze

Paul Crawford Silver badge

Spaceship operator <=>

I had to look that one up, and then found to my surprise it is more or less the same sort of thing as the old (and discouraged) FORTRAN "arithmetic IF" construct.

Why do folk add stuff like this to the language? An optimising compiler can sort out many if() style constructs, and if it really matters to get greater speed on a high-overhead test you can code it by a simple intermediate variable to be tested twice (and probably optimised away...)

Paul Crawford Silver badge

Re: Do...While

"Why would you ever use a Do/While? The standard While performs all the same requirements at the cost of one parameter check for the first iteration."

For exactly that reason, you know you need to execute the code block at least once, but don't know for sure how many times beyond that. Sure it might be a trivial thing to test that extra time if your condition is a simple one, but if the exit test is a big overhead call you might just choose to use do/while().

We are absolutely, definitively, completely and utterly out of IPv4 addresses, warns RIPE

Paul Crawford Silver badge

Re: Nope, never saw this coming

"This typically means that your laptop or phone behind your home router gets a different IP every day, the first part of the address stays the same, the second part varies. How big the size of the static part is compared to the variable part varies per ISP. If they give you a measly /64 a different section will change than if they give you a /56 or a /48."

Given the HUGE size of IPv6 don't you think it is trivial to just bin addresses in such sized blocks? After all it is only YOU who is populating the allocated block. Yes, it might be harder to track people in your home individually (just as for IPv4 NAT) but your home use is simple to track and not per-home swapping to worry about.

RISC-V business: Tech foundation moving to Switzerland because of geopolitical concerns

Paul Crawford Silver badge

Re: Kudos!

I will add my appreciation to that...

'Horndog hackers' have a Wales of a time slinging smut from UK gov Twitter account

Paul Crawford Silver badge
Coat

Re: Hacked - OMG

Oh that is a baaaaad joke!

Thanks, mine has the mint sauce flavoured lub in the pocket =>

Take a Big Blue cheque and go: IBM settles 281 UK age discrim cases

Paul Crawford Silver badge

Re: IBM rejected any attempt to characterise those changes as age discrimination

Chronologically defeated, judging by the outcome today.

Paul Crawford Silver badge

Re: confidential terms

I would imagine in a capitalist market what matters is the output, and that sometimes comes from hours of input, but as often as not comes from less hours of experienced input (not making old mistakes, etc).

Paul Crawford Silver badge
Joke

Re: bright graduates picking other employers instead of bringing their smarts under Big Blue's roof

"...I walk into a church and see a rum kit..."

Communion wine not good enough these days, eh?

PSA: You are now in the timeline where Facebook and pals are torn a new one by, er, Borat star Sacha Baron Cohen

Paul Crawford Silver badge
Facepalm

It truly is a sad reflection on the modern world when a comedian in a mankini is speaking greater truth than out elected leaders or masters of industry. I weep for our future :(

BOFH: Trying to go after IT's budget again?

Paul Crawford Silver badge

Re: I'm going to quote this!

Which bank? The sperm one?

Bon sang! French hospital contracts 6,000 PC-locking ransomware infection

Paul Crawford Silver badge

Re: DAMN YOU DIGITAL TRANSFORMATION!!!!

Whenever you hear the word "transformation" in any management speak you should expect the worst. It is a by-word for pain and often for little on no gain.

Almost certainly the issue for our French cousins is much like the NHS and others: where critical systems are not well (if at all) segregated from those with email/web/USB access for various reasons. Not sending on proper network planning, firewall settings and disaster containment/recovery are likely to be the big factors. Yes, it is also often a Windows-only issue, but a lot of essential software or very high value hardware (MRI scanners, etc) needs that and so you have to deal with it but limiting what happens when either a zero-day exploit is used or (more likely) someone makes a dumb mistake.

Judge shoots down Trump admin's efforts to allow folks to post shoddy 3D printer gun blueprints online

Paul Crawford Silver badge

Re: But then you'll forget why you bought it

Not very often.

The OP's point is there are different way to end oneself, but guns are a very, VERY, effective first attempt...