perfetto: Attempt to address crashes in TETLES::UpdateDuration
We're seeing crashes within AddTraceEvent called from UpdateDuration when attempting to access the trace event's category pointer. The category pointer is nullptr in this case, which leads me to believe that UpdateDuration may attempt to access an uninitialized TraceEvent from the complete_event_stack_. One piece of code that looks suspicious to me is the update of current_stack_depth_ in UpdateDuration in case the handle's event_index and current_stack_depth_ mismatch for some reason. Provided the DCHECK holds, it still shouldn't cause an invalid TraceEvent to be accessed in later invocations of UpdateDuration, but this is an attempt to make the update a little safer nevertheless. Bug: 983307 Change-Id: I6c6e4dc02bdde5e5e324c65ffb6e5cfe1028c6dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1741919 Auto-Submit: Eric Seckler <eseckler@chromium.org> Reviewed-by:Sami Kyöstilä <skyostil@chromium.org> Commit-Queue: Eric Seckler <eseckler@chromium.org> Cr-Commit-Position: refs/heads/master@{#685526}
Showing
Please register or sign in to comment