So updating the compiler from 2.4.0 to 2.6.0 and also not compiling with any debug information seems to have fixed the issue. Weird.