smeso

Technical

Memory ordering and atomic operations synchronization

in Technical, c, cpp, rust, atomic, concurrency, memory, memory-ordering, memory-model, memory-barrier, low-latency, optimization

Every time I need to play with atomic variables and I try to be clever and optimize them as much as possible I need to re-learn what the various memory ordering options do. It doesn't help that memory ordering is easily one of the most complex topics I ever worked with. For this reason I decided to finally write down what I (think) I know about memory ordering, making it easier for the future me …

Read the rest of the post

ClickHouse: don't roll your own crypto

in Technical, clickhouse, security, cryptography, rng, vulnerability, cpp

ClickHouse is a column-oriented database management system that is designed for high-performance analytics. It is known for its speed and efficiency in processing large volumes of data, making it a popular choice for companies looking to analyze massive datasets in real-time.

(the above text was written by some AI, because I couldn't be bothered to think of anything, but I promise I'll write the rest of the post myself, maybe)

Working as a CH contributor …

Read the rest of the post

MIPS stacktrace: an unexpected journey

in Technical, mips, embedded, glibc, gcc, stacktrace, C, assembly, backtrace, libgcc

Automatically receiving a stacktrace when your C program crashes isn't rocket science. But this time it was more difficult than I expected. This is a short recollection of the things I found out few years ago. This post assumes that the reader has some basic knowledge about functions' calling conventions, CPU registers, and assembly.

Some context

A C program running on Linux was randomly crashing on one specific embedded device deployed on the other side …

Read the rest of the post