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

singleton instances, unclear memory ownership #2

Closed
dtzWill opened this issue May 11, 2016 · 1 comment
Closed

singleton instances, unclear memory ownership #2

dtzWill opened this issue May 11, 2016 · 1 comment
Labels

Comments

@dtzWill
Copy link
Contributor

dtzWill commented May 11, 2016

  • Data-structures not created by not destroyed
    • unable to run same analysis on different modules (in sequence) due to persisting datastructures (like SymbolInfo).
  • Singletons are expected to be initialized for current module/analysis
    • can't analyze modules in parallel.
  • Unclear ownership/sharing patterns, especially regarding PAG and SymbolInfo.
  • Non-static instances using singletons fail in unexpected ways if singletons already existed for another reason.
    • complicates use of analysis in a PassManager

The current code is remarkably close to being free of these singletons but requires some careful work to remove them while preserving the overall architecture. I tried locally but it was a bit of a mess O:).

Is this something you could look at?

@yuleisui
Copy link
Collaborator

Hi Will,

Thanks for pointing out.

  1. Singleton
    Yes, SymbolInfo and PAG serves as the foundations for many other graph representations. Given the whole program bc files linked by Gold Plugin, SVF allows only one PAG instance instead of repeatedly building PAG (accidentally by the user) for interprocedural analysis .
  2. Same analysis on different modules in sequence
    We assume SVF accepts only one modules at a time.
  3. Analyze modules in parallel
    No, we can't analyze modules in parallel due to this design.

Yes, we will have a look at it but make sure one to one mapping from module to PAG. If a user creates multiple PAGs for a single module, the results carried from one analysis to another may be incomplete, of course adding unnecessary overhead.

@nix7965 nix7965 mentioned this issue Mar 20, 2019
yuleisui pushed a commit that referenced this issue Jul 1, 2020
mbarbar added a commit to mbarbar/svf-public that referenced this issue Jul 4, 2021
N0rthPhantom added a commit to N0rthPhantom/SVF that referenced this issue Aug 28, 2022
# This is the 1st commit message:

SVFModule refactor: add private members

# This is the commit message SVF-tools#2:

SVFModule refactor: add private members
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants