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

Revert "C++: Do not generate IR for functions with multiple entry points" #17948

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

calumgrant
Copy link
Contributor

Reverts #17694

I'm reverting this due to https://github.com/github/codeql-c-team/issues/2482. The problem is that it seems that TRAP caching does pull in a few duplicate functions, which is arguably a bug but will take a bit more time to investigate. In the meantime, since #17694 can cause results wobble, I think it would be safest to revert.

@jketema kindly do double-check that this PR is indeed the root cause of these new alert deltas.

@calumgrant calumgrant requested a review from a team as a code owner November 11, 2024 08:14
@github-actions github-actions bot added the C++ label Nov 11, 2024
@calumgrant calumgrant added the no-change-note-required This PR does not need a change note label Nov 11, 2024
@jketema
Copy link
Contributor

jketema commented Nov 11, 2024

Is this a stable regression, or is it actually wobbling from night to night?

@calumgrant
Copy link
Contributor Author

Is this a stable regression, or is it actually wobbling from night to night?

It's now a "stable regression" - in that the alerts consistently change between cache-read and cache write.

@jketema
Copy link
Contributor

jketema commented Nov 11, 2024

Then the proper solution is to silence the errors in DCA, not reverting changes in the CodeQL repo.

@geoffw0
Copy link
Contributor

geoffw0 commented Nov 11, 2024

Feel free to DM me if you'd like help making changes to the DCA rules for CPP. I've done it quite a few times recently.

@calumgrant
Copy link
Contributor Author

Feel free to DM me if you'd like help making changes to the DCA rules for CPP. I've done it quite a few times recently.

I don't think these differences should be silenced. What it shows is that we get fewer alerts if the TRAP cache is used, which is definitely not what we want! My main point is that it will take a while to dig into why this is happening and it may not be easy to fix. The "wobble" is that we'll get different alerts on main vs PR branches, which could cause a few problems. It's a "stable wobble" if that makes sense.

My current guess FWIW is that it's something to do with the interaction of linker awareness and TRAP caching.

@jketema
Copy link
Contributor

jketema commented Nov 11, 2024

I don't think these differences should be silenced. What it shows is that we get fewer alerts if the TRAP cache is used, which is definitely not what we want! My main point is that it will take a while to dig into why this is happening and it may not be easy to fix. The "wobble" is that we'll get different alerts on main vs PR branches, which could cause a few problems. It's a "stable wobble" if that makes sense.

This sound like a much deeper problem with TRAP caching than anything related to the PR you're now trying to revert, and it that case both silencing and reverting are both the incorrect solution.

@calumgrant
Copy link
Contributor Author

This sound like a much deeper problem with TRAP caching than anything related to the PR you're now trying to revert, and it that case both silencing and reverting are both the incorrect solution.

This isn't a permanent revert, it's a temporary revert whilst we investigate the root cause.

@jketema
Copy link
Contributor

jketema commented Nov 11, 2024

This isn't a permanent revert, it's a temporary revert whilst we investigate the root cause.

What do we gain by reverting this?

@calumgrant
Copy link
Contributor Author

This isn't a permanent revert, it's a temporary revert whilst we investigate the root cause.

What do we gain by reverting this?

We'll regain the lost alerts and main won't be broken.

@jketema
Copy link
Contributor

jketema commented Nov 11, 2024

We'll regain the lost alerts and main won't be broken.

Why will main no longer be broken? From the information you have provided it very much seems that this was a preexisting problem, that was now accidentally exposed because we changed something in a QL library?

Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

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

I had a chat with Anders. What I hadn't realized is that this might give flip-flopping results between PRs and main when trap caching is used. So from that perspective it indeed seems best for revert. One comment though.

@calumgrant calumgrant force-pushed the revert-17694-multiple-entry-point branch from 73e63e1 to 2f032ec Compare November 11, 2024 13:07
@jketema
Copy link
Contributor

jketema commented Nov 11, 2024

Could we also run some DCA on this, to make sure that does not have any odd interactions with changes that were made after this change originally went in? Ideally both a normal experiment and a trap caching one.

@jketema
Copy link
Contributor

jketema commented Nov 12, 2024

@calumgrant I'm missing a trap-caching DCA experiment that shows that this addresses the problem you observed.

@calumgrant calumgrant merged commit 67684d1 into main Nov 13, 2024
14 checks passed
@calumgrant calumgrant deleted the revert-17694-multiple-entry-point branch November 13, 2024 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants