Racy string input from userspace can yield to unreadable traces
The attached program yield to unreadable traces when tracing system calls.
We need to fix this by ensuring that we allow input strings to change underneath between the length computation and copy into the buffers. It needs to be done with padding rather than zeroing any extra space, because otherwise Babeltrace will expect the following field right after the first null terminating character.
Babeltrace error example:
[error] Event id 26212 is outside range.
[error] Reading event failed.
Error printing trace.