The cause of this bug is now found. The bug is present in vanilla glibc too. The followig report describes the bug in the tracker for glibc, and has a patch: http://sourceware.org/bugzilla/show_bug.cgi?id=12788 Kudos to Bram who has dived the source and wrote the patch.