Fix a string lifetime bug in perfetto support code
This is a speculative fix for the test failures in https://crbug.com/923166#c40 based on the stack in the logcat and code inspection. AndroidSystemProducer stores a raw const char* pointer passed in from many layers up the stack. In particular, the SetSystemProducerSocketAndChecksAsync function used in tests passes in producer_string.c_str() where producer_string is a std::string that was bound into a callback somewhere. This is a UAF and I suspect it is what's tripping the libc++ debugging assertion. Bug: 923166 Change-Id: Id9153009c34ef942a2d9a4b21c760c0394258f54 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1924235 Auto-Submit: David Benjamin <davidben@chromium.org> Reviewed-by:Stephen Nusko <nuskos@chromium.org> Reviewed-by:
Eric Seckler <eseckler@chromium.org> Commit-Queue: Eric Seckler <eseckler@chromium.org> Cr-Commit-Position: refs/heads/master@{#719870}
Showing
Please register or sign in to comment