Skip to content

C++: Compute isInCycle only for raw IR #2511

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

Merged
merged 2 commits into from
Dec 12, 2019
Merged

Conversation

jbj
Copy link
Contributor

@jbj jbj commented Dec 10, 2019

On wireshark/wireshark, isInCycle ran into a low-memory loop on the aliased_ssa stage. It shouldn't be necessary to detect cycles after the raw stage, so this commit moves cycle detection into the Construction modules and makes it a no-op in SSAConstruction.qll.

Testing to do:

  • Can the IR now be computed on Wireshark?
  • Is the original problem with cycles (C++ IR: guard against cycles in operand graph #1567) still mitigated on Linux?
  • Does all this affect the 1.23 evaluator? I've been doing my tests with whatever evaluator version was sitting on my disk.

On wireshark/wireshark, `isInCycle` ran into a low-memory loop on the
`aliased_ssa` stage. It shouldn't be necessary to detect cycles after
the `raw` stage, so this commit moves cycle detection into the
`Construction` modules and makes it a no-op in `SSAConstruction.qll`.
@jbj jbj added the C++ label Dec 10, 2019
@jbj jbj added this to the 1.23 milestone Dec 10, 2019
@jbj jbj requested review from a team as code owners December 10, 2019 15:35
Copy link

@dbartol dbartol left a comment

Choose a reason for hiding this comment

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

I did a quick review on my phone, and this looks good. I'll leave it to @geoffw0 to merge once the other boxes are ticked.

Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

LGTM. We've discussed this quite a lot on Slack, in summary:

  • we're all happy with the actual changes to code
  • several of us have done some ad-hoc testing today
  • the issue that the cycle-finding is intended to solve no longer occurs where it did before, nor is there a test case for it; it isn't clear whether or not it's needed any more
  • in any case the second and third layers of cycle finding (which this PR removes) were never needed in practice
  • the csharp IR is not in use so that side of this PR isn't a big concern

@geoffw0 geoffw0 merged commit 73446ea into github:rc/1.23 Dec 12, 2019
@jbj
Copy link
Contributor Author

jbj commented Dec 13, 2019

I finally found hardware and parameters that let me evaluate the IR on the giant Linux snapshot from https://semmle.com/large-oss-projects. There were no cycles, so it looks like the cycle detection isn't needed on recent-ish databases. That means this PR should certainly be safe, and maybe we can go even further and remove the cycle detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants