Repository navigation
starboard: Modularize and unify symbolizer tools - #12585
Merged
jellefoks merged 5 commits intoSep 30, 2026
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
|
Member
Author
OverviewUnifies Cobalt's symbolization tools by decomposing Key Changes
|
jellefoks
force-pushed
the
feature/modular-unified-symbolizer
branch
from
September 11, 2026 18:20
f1798ef to
a860cfd
Compare
jellefoks
force-pushed
the
feature/modular-unified-symbolizer
branch
from
September 11, 2026 23:38
93f73b9 to
a4cbf0a
Compare
jellefoks
force-pushed
the
feature/modular-unified-symbolizer
branch
from
September 14, 2026 16:21
a4cbf0a to
b8edb5e
Compare
jellefoks
force-pushed
the
feature/modular-unified-symbolizer
branch
from
September 15, 2026 01:18
b8edb5e to
efc59e3
Compare
jellefoks
force-pushed
the
feature/modular-unified-symbolizer
branch
from
September 17, 2026 02:54
8356805 to
f314169
Compare
jellefoks
force-pushed
the
feature/modular-unified-symbolizer
branch
from
September 18, 2026 17:20
1064ec9 to
5836168
Compare
jellefoks
requested review from
andrewsavage1,
hlwarriner and
niranjanyardi
September 18, 2026 22:32
jellefoks
force-pushed
the
feature/modular-unified-symbolizer
branch
from
September 26, 2026 05:57
5836168 to
1b168b7
Compare
- Decompose starboard/tools/symbolize/ into a modular package:
- runner.py: Persistent SymbolizerRunner managing llvm-symbolizer with
multi-binary dispatch, deadlock prevention (stderr=DEVNULL), and LRU cache.
- formats.py: FormatHandler registry supporting ASan, Android tombstone,
Cobalt stack dumps, GDB, and raw addresses with prefix and inlines preservation.
- detector.py: StreamingSessionTracker for dynamic Load start= tracking
and three-tier address mode resolution.
- json_processor.py: Decoupled test runner JSON summary processor with
fast O(1) stack trace pre-filtering.
- symbolize.py: High-level coordinator and CLI entry point.
- Convert tools/valgrind/asan/asan_symbolize.py into a thin wrapper delegating
to starboard.tools.symbolize.
- Expand test suite in starboard/tools/symbolize/symbolize_test.py to 39 unit/integration/benchmark
tests (< 2.0s for 1,000+ frames).
- Add baseline unit tests in tools/valgrind/asan/asan_symbolize_test.py (17 tests).
- Wire asan_symbolize_test.py into .github/actions/symbolize_test/action.yaml.
- Add comprehensive documentation in starboard/tools/symbolize/README.md.
Bug: 524687034
Bug: 560199756
- Address type fragility in symbolize.py by safely accepting integer and string values for base_address. - Switch from parse_known_args() to parse_args() in symbolize.py to catch unrecognized CLI flags. - Remove redundant shebang lines from library modules (detector.py, formats.py, json_processor.py, runner.py). - Make FormatHandler an explicit abstract base class inheriting from abc.ABC with @abc.abstractmethod. - Use str.partition() for path prefix stripping in formats.py. - Define AddressMode enum for latched resolution modes in detector.py. - Narrow exception handling in json_processor.py and runner.py to specific exception types. - Expose AddressMode, symbolize_stream, and symbolize_string in starboard.tools.symbolize.__all__. - Remove redundant (object) inheritance and Python 2 unicode literals in asan_symbolize.py. - Add unit test verifying integer base_address handling in symbolize_test.py.
- Extract library basename in AndroidFormatHandler to track originating binaries. - Avoid querying default library for frames from unrelated external libraries (e.g. system libc) to prevent false-positive symbol collisions. - Support reading stack traces from sys.stdin when --filename is omitted. - Add unit tests for mixed-library stack traces and stdin CLI execution.
Add _RE_COBALT_INVERTED regex to CobaltFormatHandler to support both raw '<unknown> [0x<addr>]' frames and previously-symbolized '0x<addr> [<symbol>]' frames, making Cobalt stack trace symbolization idempotent and compatible with RDK and post-processed crash logs.
- Address PR review findings: 1. Fix dead code and refine address mode logic in StreamingSessionTracker.resolve_offset(). 2. Propagate strip_prefixes parameter through FormatHandler.format(). 3. Require 'in' keyword in GDB frame regex to avoid false positives. 4. Support demangled C++ symbol signatures with spaces in CobaltFormatHandler. 5. Use atomic temporary file replacement and early exit in process_test_summary_json(). 6. Standardize inlined frames with '(inlined)' suffix across formats. - Add comprehensive regression tests for findings 1-6 in symbolize_test.py. - Add detailed explanations of relative vs absolute address mode, multi-frame probing rationale, and entry keyword heuristics in detector.py. - Add format examples for all FooFormatHandler classes and _RE_* regex constants, and document FrameMatch attributes in formats.py. - Document LLVM symbolizer stdin/stdout protocol, input query formatting, and output parsing with examples in runner.py. - Document the __all__ export list and public module interface in symbolize.py. - Restore and adapt descriptive code comments across asan_symbolize.py. - Inline test fixtures in asan_symbolize_test.py and symbolize_test.py, and remove the testdata/ directories to make tests completely self-contained.
jellefoks
force-pushed
the
feature/modular-unified-symbolizer
branch
from
September 30, 2026 05:24
1b168b7 to
b552bcc
Compare
arjungm
approved these changes
Sep 30, 2026
arjungm
left a comment
Contributor
There was a problem hiding this comment.
LGTM, this is a wonderful qol addition
briantting
pushed a commit
that referenced
this pull request
Sep 30, 2026
Refer to original PR: #12585 starboard: Modularize and unify symbolizer tools Refactor the symbolization toolset by decomposing logic into a high- performance modular package. This introduces a centralized runner for llvm-symbolizer with persistent subprocesses and caching, a registry for diverse log formats, and dynamic address detection. Convert asan_symbolize.py into a thin wrapper to maintain backward compatibility while leveraging the new core. This architecture improves maintainability and provides a unified interface for parsing Android logcats, Cobalt stack dumps, and GDB outputs. Bug: 524687034 Bug: 560199756 TAG=agy CONV=8b5d7c17-137f-4cec-9795-2e00ef8ddffc (cherry picked from commit 6d33298)
briantting
pushed a commit
that referenced
this pull request
Oct 16, 2026
Refer to original PR: #12585 starboard: Modularize and unify symbolizer tools Refactor the symbolization toolset by decomposing logic into a high- performance modular package. This introduces a centralized runner for llvm-symbolizer with persistent subprocesses and caching, a registry for diverse log formats, and dynamic address detection. Convert asan_symbolize.py into a thin wrapper to maintain backward compatibility while leveraging the new core. This architecture improves maintainability and provides a unified interface for parsing Android logcats, Cobalt stack dumps, and GDB outputs. Bug: 524687034 Bug: 560199756 TAG=agy CONV=8b5d7c17-137f-4cec-9795-2e00ef8ddffc (cherry picked from commit 6d33298)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
starboard: Modularize and unify symbolizer tools
Refactor the symbolization toolset by decomposing logic into a high-
performance modular package. This introduces a centralized runner for
llvm-symbolizer with persistent subprocesses and caching, a registry
for diverse log formats, and dynamic address detection.
Convert asan_symbolize.py into a thin wrapper to maintain backward
compatibility while leveraging the new core. This architecture
improves maintainability and provides a unified interface for parsing
Android logcats, Cobalt stack dumps, and GDB outputs.
Bug: 524687034
Bug: 560199756
TAG=agy
CONV=8b5d7c17-137f-4cec-9795-2e00ef8ddffc