Skip to content

tracing: Keep copy of output path in InstructionCounter#1554

Merged
chfast merged 1 commit into
masterfrom
opcode.count-path
May 28, 2026
Merged

tracing: Keep copy of output path in InstructionCounter#1554
chfast merged 1 commit into
masterfrom
opcode.count-path

Conversation

@chfast
Copy link
Copy Markdown
Member

@chfast chfast commented May 28, 2026

Previously used string_view for output path causes lifetime issues for users: the tracer outputs to file during destruction.

Previously used string_view for output path causes lifetime issues
for users: the tracer outputs to file during destruction.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a lifetime hazard in InstructionCounter tracing by storing an owned copy of the output file path, ensuring the tracer can safely write its results during destruction.

Changes:

  • Replace std::string_view output path storage with an owning std::string.
  • Simplify std::ofstream construction to use the stored path directly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/evmone/tracing.cpp
std::stack<bytes_view> m_codes;
std::array<unsigned, 256> m_counters{};
std::string_view m_out_file_path;
std::string m_out_file_path;
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.97%. Comparing base (dae13b2) to head (981a00a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1554   +/-   ##
=======================================
  Coverage   96.97%   96.97%           
=======================================
  Files         163      163           
  Lines       14455    14455           
  Branches     3383     3383           
=======================================
  Hits        14018    14018           
  Misses        307      307           
  Partials      130      130           
Flag Coverage Δ
eest-develop 91.93% <ø> (ø)
eest-develop-gmp 26.49% <0.00%> (ø)
eest-legacy 17.55% <0.00%> (ø)
eest-libsecp256k1 28.13% <0.00%> (ø)
eest-stable 91.86% <ø> (ø)
evmone-unittests 92.64% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 96.01% <100.00%> (ø)
tooling 86.71% <ø> (ø)
tests 99.79% <ø> (ø)
Files with missing lines Coverage Δ
lib/evmone/tracing.cpp 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chfast chfast merged commit 5d3c673 into master May 28, 2026
24 checks passed
@chfast chfast deleted the opcode.count-path branch May 28, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants