Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify static instrumentation rules #121

Open
purplepig4657 opened this issue Aug 20, 2024 · 0 comments
Open

Simplify static instrumentation rules #121

purplepig4657 opened this issue Aug 20, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@purplepig4657
Copy link
Collaborator

purplepig4657 commented Aug 20, 2024

Redundant rules

Currently, we have several redundant static instrumentation rules: __plsan_lazy_check and __plsan_check_returned_or_stored_value.

This instrumentation handles situations where the reference count of a memory block reaches zero but is soon restored to one.

Although there are no pointers to the memory block, the situation can be regarded as if an invisible pointer points to the memory block (e.g., the returned value is not stored in a specific pointer immediately after the function returns, but it is still reachable.)

Thus, the __plsan_lazy_check and __plsan_check_returned_or_stored_value functions handle this situation.

However, we can eliminate the need for these functions.

Simplification

  • Whenever the reference count reaches to zero, a leak report stored. (leak reports are basically overwrited)
  • And then, at the end of program, it checks reference counts of all memory blocks, which reference counts are still zero.
@purplepig4657 purplepig4657 added the enhancement New feature or request label Aug 20, 2024
@purplepig4657 purplepig4657 self-assigned this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant