Skip to content

[feat] Add memory safety reporter script - #4962

Open
gulyasgergely902 wants to merge 1 commit into
Ericsson:masterfrom
gulyasgergely902:add-memory-safety-report-script
Open

[feat] Add memory safety reporter script#4962
gulyasgergely902 wants to merge 1 commit into
Ericsson:masterfrom
gulyasgergely902:add-memory-safety-report-script

Conversation

@gulyasgergely902

Copy link
Copy Markdown
Collaborator

This change adds the new memory safety reporter script which collects all configs which were used for a given analysis.

@gulyasgergely902 gulyasgergely902 added this to the release 6.29.0 milestone Jul 14, 2026
@gulyasgergely902 gulyasgergely902 added the tools 🛠️ Meta-tag for all the additional tools supplied with CodeChecker: plist2html, tu_collector, etc. label Jul 14, 2026
@gulyasgergely902
gulyasgergely902 requested a review from dkrupp July 14, 2026 10:06
@gulyasgergely902
gulyasgergely902 force-pushed the add-memory-safety-report-script branch from b26bda3 to 2d690d6 Compare July 16, 2026 09:08
Comment thread scripts/memory_safety_reporter.py Outdated
@gulyasgergely902
gulyasgergely902 force-pushed the add-memory-safety-report-script branch 2 times, most recently from 21feff0 to 1e403e1 Compare July 21, 2026 10:07
@gulyasgergely902
gulyasgergely902 requested a review from bruntib July 21, 2026 10:08

@barnabasdomozi barnabasdomozi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you add a test case which uses this script?
In the future, flags for these CodeChecker commands could change and then this script could be broken by accident.

Comment thread tools/memory-safety-reporter/memory_safety_reporter.py
Comment thread tools/memory-safety-reporter/memory_safety_reporter.py
Comment thread tools/memory-safety-reporter/memory_safety_reporter.py
Comment thread scripts/memory_safety_reporter.py Outdated
@gulyasgergely902
gulyasgergely902 force-pushed the add-memory-safety-report-script branch 3 times, most recently from 10f70cb to b4cd671 Compare July 22, 2026 08:11

@barnabasdomozi barnabasdomozi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As mentioned in my other comment, please add a simple test case which is executed in the GitHub CI.

@gulyasgergely902
gulyasgergely902 force-pushed the add-memory-safety-report-script branch 11 times, most recently from 089d751 to d8d91bb Compare July 30, 2026 12:49

@barnabasdomozi barnabasdomozi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think creating a whole python package with setup.py and Makefile is unnecessary for this simple script. And I also think it's unnecessary to add Makefile targets to upload this to the PyPi registry.

Moreover, when building CodeChecker with
make venv and then make package, this new memory-safety-reporter command is not available for some reason.

As a simpler solution, I think it would suffice to add #!/usr/bin/env python3 to the top of the file, and then it could be executed as memory-safety-reporter.
An alternative would be to add this script as a CodeChecker subcommand, e.g. CodeChecker memory-safety-converter. I think this would make more sense and it would worth a discussion with the team.

As for the test cases, the tools/memory-safety-reporter/tests/functional/cmdline/test_files/ directory should be generated by the test case and not commited to this repository. Ideally, the test case should not include binary files like tools/memory-safety-reporter/tests/functional/cmdline/test_files/test-report/failed/xmltest.cpp_clangsa_382c4897e0fb3b0c4fe94ece86cee8ca.plist_CTU_compile_error.zip and should also not include development machine absolute paths like /local/test_projects/tinyxml2/xmltest.cpp.

@gulyasgergely902

gulyasgergely902 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

After a short meeting agreed to:

  • Use a simpler solution instead of the module approach since the script will not be imported by others.
  • Simplify the tests to use a simpler recreation of a report directory.

@gulyasgergely902
gulyasgergely902 force-pushed the add-memory-safety-report-script branch from d8d91bb to 21e667b Compare August 7, 2026 13:17
This change adds the new memory safety reporter script which collects
all configs which were used for a given analysis.
@gulyasgergely902
gulyasgergely902 force-pushed the add-memory-safety-report-script branch from 21e667b to ab7b7e3 Compare August 7, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools 🛠️ Meta-tag for all the additional tools supplied with CodeChecker: plist2html, tu_collector, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants