On Linux, Pipes, Fork and passing file descriptors to other process.

I found a lonely and weird corner case of Linux IO, file descriptors, Linux processes and, fork calls. Figuring out the problem took me a solid half a day, so I believe is worth writing about it, so others can benefit as well. The discussion will use golang because it is the language in which the original bug was written, but it should apply to every other language. The setting of the problem is rather simple, one producer process needs to send data to a consumer process. The producer is a long-running daemon, while the consumer is created on the spot by the producer itself using something like fork/exec. The producer needs to receive an answer from the consumer as soon as the consumer finish with the input. It was chosen to use Linux pipes to implement the Inter-Process Communication. The algorithm was the following. Create a pipe to send…

Continue Reading On Linux, Pipes, Fork and passing file descriptors to other process.

Use SimpleSQL from Netlify

SimpleSQL provides a REST API to create databases and manipulate them. We try to aswer the question: What if a database was as simple as a file to manage? SimpleSQL…

Use SimpleSQL from Github pages

SimpleSQL is an HTTP API that allow complete control over a SQLite database. Underneath SimpleSQL is based on RediSQL to manage all the different databases, connections, backups, replication, etc. One…

Invariants as interface

An invariant is a condition that holds true no matter what during the execution of a phase of a computer program. For instance, in a classical for loop, for (i…

Software is a FOCUS intensive industry.

Industries are usually characterized as labor-intensive or as capital-intensive. Labor-intensive industries requires a lot of human input in order to produce their output. A classical examples is the industry of…

Tracking the trackers. The beginning.

This project wants to explore how the web is tracked by whom. As the most tech savvy readers know, when we visit a web page, several things happen in the…

Rust and glibc version.

Rust is an amazing language, with amazing community and tooling. However, sometimes, you can end up in complex situation where the standard tools are not sufficient anymore, in those case…