Category: Programming
-
Small E-mail Servers
I’ve run a small e-mail server at airs.com for many years, providing POP and forwarding services for friends and family. In the early days of the net several people found it useful to have a fixed e-mail address which they could forward to their ISP. Later on commercial services appeared, like pobox.com, and these days…
-
Signed or Unsigned
C has always permitted comparisons between any integer type, and C++ follows its lead. Comparing signed types to signed types is straightforward: you sign extend the smaller type. Likewise, when comparing unsigned types to unsigned types, you zero extend. When comparing signed and unsigned types, the rules are less clear. The C standard specifies a…
-
Thread Sanitizer
I recently ran the gold linker under Thread Sanitizer. It’s a nice plugin for Valgrind which looks for race conditions in multi-threaded programs. To describe it briefly, it builds Happens-Before relationships based on mutex operations and warns when it notices a write and a read/write to the same memory location without a Happens-Before relationship. This…
-
Go Linkage Names
All Go code lives in a package. Every Go source file starts with a package declaration which names the package that it lives in. A package name is a simple identifier; besides appearing in a package clause, package names are also used when referring to names imported from another package. That poses the problem of…
-
Protected Symbols
Now for something really controversial: what’s wrong with protected symbols? In an ELF shared library, an ordinary global symbol may be overridden if a symbol of the same name is defined in the executable or in a shared library which appears earlier in the runtime search path. This is called symbol interposition. It is often…