Since openSUSE has switched to gcc5 with new libstdc++ ABI veracrypt doesn't work after compilation.
Because of the ABI change I need to recompile a dynamic linked veracrypt.
But when trying to mount a truecrypt file volume I get a message window, telling me only about "Invalid characters encountered."
I've tried to debug it and it seems to be fuse-related. So maybe not a compiler/libstdc++ problem, but a incompatibility with new fuse version 2.9.4?!
It would be helpful, if the message would tell more about the exact exception cause.
So, please have a look at.
Comments: I have received an update about this issue from Kyle Marek who developed a fix for the same issue for CipherShed. It turns out that this was not a GCC5 issue after all but rather a bug in foreach loop inherited from TrueCrypt which appears only with GCC5.
Here is his analysis:
> Stepping through TrueCrypt code in a debugger revealed that TrueCrypt's "foreach" implementation is prone to reconstructing std::string. The implications of this are that the C string copying that's done in the original loop copies the char pointers of the std::string copy, which becomes unreliable as soon as the loop iteration completes (what happens to the memory afterwards is unpredictable). What makes your fix work is that your manual std::string construction that's done within the loop copies the buffer of the std::string copy while it's still valid. Notice that your second loop is not a foreach-loop, but a nice for-loop. I think if you replaced it with yet another foreach loop, you would recreate the issue.
> GCC5 wasn't broken, and GCC5 didn't break the TrueCrypt code. It's just always been broken and it was mere coincidence that the foreach loop worked "successfully".
.
Here is the commit Kyle made for CipherShed: https://github.com/CipherShed/CipherShed/commit/71ca808157731eb329496ef15e2282efa4aed9f8
It looks like we will have to check all occurrences of this foreach look in the code in order to detect potential issues.