Here we go.
We pre-link all libraries to the executable. Also, we have had two global objects with the same name in two different shared libraries. When closing the program, somehow the kernel thinks that both exist and tries to deallocate both despite the fact that one of them never was allocated. No idea why it confuses these things, but simply giving the different names solves this.