Shock horror an actual post about liblfds.

I’ve been working on the test application.

With the additon of position independent data structure variants, I need to be able to spawn processes and use shared memory, for testing.

I have a number of platforms to think about, to form an abstraction layer over;

1. Windows
2. Linux
3. Android
4. Embedded

There’s also kernel mode to think about, but kernels don’t have processes as such, and so they don’t have shared memory as such. I do in principle want to test user-mode and kernel-mode code executing concurrently on the same data structure instance, but then I’ll need to really actually make something work in the kernel for both Windows and Linux. I’m familiar with Windows kernel programming, so I could do that (install a driver, then the test app communicates with it), but I’m not familiar with Linux kernel programming (I’ve a kbuild build of liblfds, but it’s not *used* in anything; I have no idea if it’s a valid build) so these aren’t on the cards right now.

Shared memory is pretty much identical across Windows and Linux so that’s no problem.

No clue how it works on Android – Googling shows up various Java APIs – hopefully Linux under the covers.

Embedded platforms don’t have processes, well, they have one process, *the* process, so no shared memory.

Where embedded doesn’t offer processes or shared memory, the test app needs to run differently on different platforms, or, rather, depending on what’s available in the platform abstraction layer; position independent tests only happen if there’s support for shared memory and processes.

A weaker form of position independent testing is available just by running them in the same address space, over multiple threads, so that might be something which happens if processes/shared are not available.

Then we come to processes.

Process are completely different between Linux and Windows.

Linux uses fork(). You call fork, and then you have two processes, and they each get a different return value from fork.

Windows uses CreateProcess, which takes a *pathname to an executable*, and spawns a new process running that executable. Parent and child by default have rights to access each others memory, child can inherit handles, etc.

These two things really are *not* the same.

Consider my use case; I want to spawn one process per logical core, have it open up a block of shared memory, and then, when everyone is ready (I’ll spinlock on a value in the shared memory) run a particular test.

One problem to begin with is that the design of libtest is based around threads; a “test” is a function which inits a threadset, and that spawns threads which are given a function pointer to the test code. This needs now to be a processset, not a threadset; this wouldn’t be too bad under Linux – but under Windows, to make a process, I have to give a *pathname* to an executable! and that means, if I want just one test binary (and I do), I need to invoke the test binary *with command line arguments such that it knows what to do and will participate in the test which should now be run*.

This is nuts. Invoking new processes should not involve work on the command line parser.

I can get around a bit I suppose by having just one special command line argument, which tells the test programme to open up shared memory and get its instructions from there.

Utter stupendous total facepalm

Opened a new bank account.

Paid in some cash..

Tried to use the card for the first time, to make a purchase.

Bank blocks the transaction, false positive fraud detection.

The bank account I’ve just closed did the same thing.

The other bank account I tried to use didn’t work – I think the retailer blocks their cards.

Logged into the new bank account to send them a message.

“You cannot log in now, as we’re shut down for four hours when the clocks go forward.”

Utter total stupendous facepalm.

There is a crying need for MORE COMPETITION IN BANKING.

Companies are like software

Kernel programming was profoundly educational as it taught me on an emotional level that all software is broken until you test it (and even then, of course, it only means it passes the tests).

Companies in real-life are similar to software. They are all completely broken.

In short : companies will always choose the worst possible course of action.

I have been trying to order a pair of bike wheels.

I found the pair I want, found a company selling them.

Tried to order.

Three times.

Order failed each time – but I did have three sets of pending charges on my account, so the order was going through.

Contacted the bank, contacted the retailer.

Retailer replies first – it’s your bank, not us. We never decline payments. I ask them if it could be their payment provider? no. It’s your bank.

Bank replies second – it’s not us. We’re not blocking or declining anything. I ask them if they can talk to the retailer. No.

I talk to the retailer again. I ask for the same guy – no, not available. I explain what the bank had said to me. Reply? “it’s not us”. Followed by – “trying clearing your cookies and cache”.

It didn’t go anywhere after that. I gave up, because there was nothing else that could be done.

So I’m not ordering from them, because I can’t.

I am 100% sure the retailer will do nothing at all in response to this event. It’s bad for them and it’s bad for their customers – it’s the worst possible choice. It’s what they’ll do. It’s what *all* companies do.

I know this, but I still haven’t quite internalized it on an emotional level. If I had, I would have saved 30 minutes of pure tedium filling in stupid forms and having pointless conversations with people incapable of helping.

Forum blues

Back to square one for a forum.

Esotalk is really nice – but the recaptcha plugin has disappeared from github, and no forum is viable without a registration captcha.

Flarum is the successor to Esotalk, but last time I tried it, maybe six months ago, I couldn’t get it working. It’s not production ready, even for open source values of production.

Have to remove the forum tab from the site for now.


So I’m trying to buy a pair of shoes.

I have a Mastercard.

I was able to buy the shoes on the Selfridges site, but Harrods decline.

(I cancelled the Selfridges order because their postage options are crazy.)

I phone Harrods to place the order on the telephone.

I repeat – for the millionth time – the addresses and card details.

Card declined.

I log into my on-line bank to see what might be there.

Harrods have three lots of 400 GBP reserved (pending) on my account.

I presume they’ll come back in a day or so.

The very pleasent lady on the phone proposes putting me through to the shop floor to order directly.

Shop floor tells me I can only place an order if I have a Harrods Loyalty Card, or I’m calling from a land line.

I tell him I understand, and ask him to put me back through to Customer Satisfaction (or whatever their name is), as she asked to talk to me again if the order could not go through.

He tells me he cannot, as the phones on the shop floor do not provide this functionality.

So we say goodbye and we hang up because that’s all we can do.

So, no order, 1200 taken off my account for a day or two, and I lost touch with the woman who knew what was going on.