Snapshot mutable ProtoLog arguments before sending them to the background thread

Before this CL, the args where passed as they were to the background thread. This means that if they were modified after the call to the log function, then there might be a race condition and even crashes due to concurrent accesses.

This CL fixes that by copying the values by calling toString() on every object before passing them to the background thread.

Test: atest TracingTests
Bug: 420430923
Flag: EXEMPT bug fix
Change-Id: Ide20527b4b1406ffb0979fb35aab861a98260297
2 files changed