Okay, I've determined reasons:
1) printf() didn't show real place even after fflush()
2) one of libraries was compiled with -O1, but part of its class code is located in public inline method and was compiled with -O4 as a part of another library => apparently those two weren't compatible, which caused infinite loop in parsing of binary stream...