Shutting down servers

I used to have a server with five operating systems, running in VMs, merrily humming away compiling whatever I coded. I say “used to have” because I shut it down a few weeks ago. Now, I have those same operating systems, as well as a large number of others, running on systems I don’t need to worry about.
Continue reading

Posted in Continuous Integration, Software Development, Software Engineering | Tagged , | Comments Off on Shutting down servers

Checked output iterator

While writing about security — which takes a great deal of my time lately, which is one of the reasons I haven’t updated my blog as often as I usually would — I came to the conclusion that, while I recommend using STL algorithms, iterators and containers for safety purposes that doesn’t solve the problem when the standard algorithms don’t check the validity of their output ranges.
Continue reading

Posted in Uncategorized | Tagged , | Comments Off on Checked output iterator

Schoenmaker, blijf bij je leest (Cobbler, stick to your last)

This is an old Dutch saying, which probably has its origins in a village with a particularly opinionated cobbler.

I am not one to stick to my last — but if I were a cobbler, I don’t think I’d be that cobbler: I like to know what I’m doing.
Continue reading

Posted in Opinions | Comments Off on Schoenmaker, blijf bij je leest (Cobbler, stick to your last)

Interesting modifications to the Lamport queue, part II

In the previous installment, on this subject, I described a few modifications to the Lamport queue introduced by Nhat Minh Le et al. to relax operations on shared state as much as possible, while maintaining correctness.

In this article, I will discuss the further optimizations to reduce the number of operations on shared state, thus eliminating the need for memory barriers completely in many cases.
Continue reading

Posted in Algorithms, C & C++, Interesting stuff | Tagged , | Comments Off on Interesting modifications to the Lamport queue, part II

Interesting modifications to the Lamport queue

While researching lock-free queue algorithms, I came across a few articles that made some interesting modifications to the Lamport queue. One made it more efficient by exploiting C11’s new memory model, while another made it more efficient by using cache locality. As I found the first one to be more interesting, and the refinements more useful for general multi-threaded programming, I thought I’d explain that one in a bit more detail.
Continue reading

Posted in Algorithms, C & C++, C++ for the self-taught, Interesting stuff | Tagged , | Comments Off on Interesting modifications to the Lamport queue

Progress in DNP3 security

In July last year, I discussed why Adam Crain and Chris Sistrunk fuzzed DNP3 stacks in devices from various vendors, finding many issues along the way (see project Robus). This time, I’ll provide a bit of an overview of what has happened since.
Continue reading

Posted in DNP3, Smart Grid | Tagged | Comments Off on Progress in DNP3 security

CIS: “Protecting” code in stead of data

The Windows API contains a synchronization primitive that is a mutual exclusion device, but is also a colossal misnomer. I mean, of course, the CRITICAL_SECTION.

Continue reading

Posted in Common Issues with Synchronization | Tagged , | Comments Off on CIS: “Protecting” code in stead of data

CIS: Lock Leaks

The two most popular threading APIs, the Windows API and pthreads, both have the same basic way of locking and unlocking a mutex — that is, with two separate functions. This leaves the code prone to lock leak: the thread that acquired a lock doesn’t release it because an error occurred.

Continue reading

Posted in Common Issues with Synchronization | Tagged , | Comments Off on CIS: Lock Leaks

CIS: Unexpected Coupling

One of the most common problems with synchronization occurs when things need each other that you didn’t expect to need each other.
Continue reading

Posted in Common Issues with Synchronization | Tagged | Comments Off on CIS: Unexpected Coupling

Git demystification

There are a few misconceptions I hear about Git that I find should be cleared up a bit, so here goes:
Continue reading

Posted in Opinions | Tagged | Comments Off on Git demystification