For some strange reason I completely fail to understand, there are people out there trying to gain root access of the machine where this blog is hosted. The most common type of attach is a dictionary attack to my SSH server, which can be easily detected by just taking a look to /var/log/auth.log where all … Read more Fun with SSH (and possibly other types of) attacks
Library interposition is a cool way to intercept calls to library functions. I use this quite often to trace, for instance, how much data an application is sending in and out of a GPU. However, writing the code to interpose to libraries is painful, because you need to mimic the exact signature of the function … Read more C++11 and Library Interposition
Yesterday I read the news that an update to Android 4.1 was being released by Samsung, so I wanted to give it a try. I cannot get OTA (Over The Air) updates since I hacked my cell phone to be able to use it abroad, so the only option left was to update through Kies … Read more Samsung Galaxy SII on VirtualBox
Multi-threading is mandatory in some applications rich in data parallelism. In this codes, we need to spawn a number of threads, so each of them produces a chunk of output data from a chunk of the input data. The code to spawn the host threads is quite “boring”, because you typically need to take care … Read more A Primitive Thread Array Class in C++11
Resource Acquisition is Initialization (RAII) is a very useful design pattern that couples quite well with Lock-Free Reference Counting. I typically use lock-free reference counting for objects stored in shared containers, such as hash tables accessible from multiple threads. This shared containers implement a getter method that increments the object reference count before returning it. … Read more RAII and Lock-Free Reference Counting
Is the expected value of a random variable equal to the average of a bunch of trials? Most people (including myself) assume so, but I just wanted to double-check I was not doing any stupid assumption. Let’s outline how are the expected value and the average (arithmetic mean) are related.
I am getting sort of interested in the ARM architecture because it might have a relatively large potential for computer architecture research. The first advantage of the ARM architecture is its RISC-like ISA, so ARM instructions are not likely to be converted to micro-ops before being executed. The second interesting issue of ARM processors is … Read more Building an ARM Cross-compiler in Debian GNU/Linux
Often time, when developing multi-threaded applications, we found the following pattern: a central repository of objects, say a map, whose items are concurrently accessed, created, and destroyed by several execution threads. The key to correctly implement this pattern is to realize that objects within the map must not be destroyed while other thread is using … Read more Lock-Free Reference Counting
In a previous post I discussed how to implement Design by Contract in C++. After some time using DbC, we realized that keeping class names such as ClassImpl and ClassTest is quite annoying when coding new methods.
Few things provide at the same time so much fun and despair as playing with memory in Linux (and UNIX in general). Many times I have wondered how to map the same physical memory at two different virtual memory addresses within the same application. Let’s see how to do it in any POSIX-compliant system.