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

Upgrade github/codeql dependency to 2.16.6 #742

Merged
merged 25 commits into from
Oct 23, 2024
Merged

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Oct 8, 2024

This PR upgrades the CodeQL CLI version to 2.16.6.

CodeQL dependency upgrade checklist:

  • Confirm the code has been correctly reformatted according to the new CodeQL CLI.
  • Identify any CodeQL compiler warnings and errors, and update queries as required.
  • Validate that the github/codeql test cases succeed.
  • Address any CodeQL test failures in the github/codeql-coding-standards repository.
  • Validate performance vs pre-upgrade, using /test-performance

MathiasVP and others added 22 commits December 14, 2023 17:18
…dicates

We are planning to change the charpred of `Function` in the CodeQL C++ library,
which means the code changed here will no longer compile. By switching to the
extensionals, the code will keep compiling.

DIL before:
```
noinline
`ConstantExprs::isFunction/1#600714be`(
  /* Element::Element */ interned unique entity el
)
{
  exists(interned dontcare string _, interned dontcare int _1 |
    functions(el, _, _1)
  ) or
  exists(interned dontcare int _ | exprparents(el, _, el))
}

noopt
`ConstantExprs::callHasNoTarget/1#e6e8caa4`(
  /* @funbindexpr */ interned unique entity fc
)
{
  exists(/* Function::Function */ interned entity f |
    funbind(fc, f) and not(`ConstantExprs::isFunction/1#600714be`(f))
  )
}
```

DIL after:
```
noinline
`ConstantExprs::isFunction/1#600714be`(/* @element */ interned unique entity el)
{
  exists(interned dontcare string _, interned dontcare int _1 |
    functions(el, _, _1)
  ) or
  exists(interned dontcare int _ | exprparents(el, _, el))
}

noopt
`ConstantExprs::callHasNoTarget/1#e6e8caa4`(
  /* @funbindexpr */ interned unique entity fc
)
{
  exists(/* @function */ interned entity f |
    funbind(fc, f) and not(`ConstantExprs::isFunction/1#600714be`(f))
  )
}
```
Use database extensionals instead of their wrapper classes in two predicates
Resolve name clash with CodeQL defined `UserDefinedLiteral`
The CodeQL test framework assumes that all code will become part to the same
nameless link target, which means that the duplicate declarations of `test3`
and `test4` are ODR violations. Moreover, newer versions of the C/C++ frontend
used in the C/C++ extractor will implement CWG 2387, which means that the
instantiations of `number_two` will also cause ODR violations.

Fix the above by renaming `test3` and `test4` in `test`b.cpp` and making
the `number_two` variable templates `static`.
Fix ODR violations in AUTOSAR A2-10-5 test
Update test after frontend update
In the upgrade to 2.16.6 GuardCondition has been modified to use
the IR instead of the AST mode it used before. One of the
consequences of this change is that GuardConditions no longer exist
for uninstantiated templates (because the IR does not apply for
uninstantiated templates).

Instead of using GuardCondition we can use the same logic for
deducing infeasible paths for uninstantiated templates as for non
template code. This avoids the dependency on GuardCondition, and
provides consistency with the rest of the query, while shortening
the query.
@lcartey
Copy link
Collaborator

lcartey commented Oct 9, 2024

/test-performance

Copy link
Author

github-actions bot commented Oct 9, 2024

🏁 Beep Boop! Performance testing for this PR has been initiated. Please check back later for results. Note that the query package generation step must complete before testing will start so it might be a minute.

💡 If you do not hear back from me please check my status! I will report even if I fail!

🏁 Beep Boop! Performance testing complete! See below for performance of the last 3 runs vs your PR. Times are based on predicate performance. You can find full graphs and stats in the PR that was created for this test in the release engineering repo.


Release                            : v2.34.0
Platform                           : x86-linux
Language                           : c
Total_Serialized_Execution_Time_Ms : 4098937
Mean_Predicate_Execution_Time_Ms   : 106.57939624015184
Median_Predicate_Execution_Time_Ms : 1.0
Standard_Deviation_Ms              : 1464.097414813044
Total_Serialized_Execution_Time_s  : 4098.937
Mean_Query_Execution_Time_s        : 0.1065793962401518
Median_Predicate_Execution_Time_s  : 0.001
Percentile95_Ms                    : 277.0
Number_of_Predicates               : 38459

Release                            : v2.34.0
Platform                           : x86-linux
Language                           : cpp
Total_Serialized_Execution_Time_Ms : 5198524
Mean_Predicate_Execution_Time_Ms   : 121.29929766432556
Median_Predicate_Execution_Time_Ms : 2.0
Standard_Deviation_Ms              : 1174.6968732305847
Total_Serialized_Execution_Time_s  : 5198.524
Mean_Query_Execution_Time_s        : 0.1212992976643255
Median_Predicate_Execution_Time_s  : 0.002
Percentile95_Ms                    : 286.0
Number_of_Predicates               : 42857

Release                            : v2.34.0
Platform                           : x86-windows
Language                           : c
Total_Serialized_Execution_Time_Ms : 5866068
Mean_Predicate_Execution_Time_Ms   : 151.38630674339984
Median_Predicate_Execution_Time_Ms : 3.0
Standard_Deviation_Ms              : 1677.95489209711
Total_Serialized_Execution_Time_s  : 5866.068
Mean_Query_Execution_Time_s        : 0.1513863067433998
Median_Predicate_Execution_Time_s  : 0.003
Percentile95_Ms                    : 491.59999999999854
Number_of_Predicates               : 38749

Release                            : v2.34.0
Platform                           : x86-windows
Language                           : cpp
Total_Serialized_Execution_Time_Ms : 6830193
Mean_Predicate_Execution_Time_Ms   : 157.16406267976714
Median_Predicate_Execution_Time_Ms : 3.0
Standard_Deviation_Ms              : 1319.4192752145375
Total_Serialized_Execution_Time_s  : 6830.193
Mean_Query_Execution_Time_s        : 0.1571640626797671
Median_Predicate_Execution_Time_s  : 0.003
Percentile95_Ms                    : 442.09999999999854
Number_of_Predicates               : 43459

Release                            : v2.35.0
Platform                           : x86-linux
Language                           : c
Total_Serialized_Execution_Time_Ms : 4397696
Mean_Predicate_Execution_Time_Ms   : 114.38333289983612
Median_Predicate_Execution_Time_Ms : 1.0
Standard_Deviation_Ms              : 2125.1712718811877
Total_Serialized_Execution_Time_s  : 4397.696
Mean_Query_Execution_Time_s        : 0.1143833328998361
Median_Predicate_Execution_Time_s  : 0.001
Percentile95_Ms                    : 274.0
Number_of_Predicates               : 38447

Release                            : v2.35.0
Platform                           : x86-linux
Language                           : cpp
Total_Serialized_Execution_Time_Ms : 5283229
Mean_Predicate_Execution_Time_Ms   : 123.28150740870376
Median_Predicate_Execution_Time_Ms : 2.0
Standard_Deviation_Ms              : 1186.327155939601
Total_Serialized_Execution_Time_s  : 5283.229
Mean_Query_Execution_Time_s        : 0.1232815074087037
Median_Predicate_Execution_Time_s  : 0.002
Percentile95_Ms                    : 290.0
Number_of_Predicates               : 42855

Release                            : v2.35.0
Platform                           : x86-windows
Language                           : c
Total_Serialized_Execution_Time_Ms : 6332025
Mean_Predicate_Execution_Time_Ms   : 164.07185240846786
Median_Predicate_Execution_Time_Ms : 3.0
Standard_Deviation_Ms              : 2309.541856304362
Total_Serialized_Execution_Time_s  : 6332.025
Mean_Query_Execution_Time_s        : 0.1640718524084678
Median_Predicate_Execution_Time_s  : 0.003
Percentile95_Ms                    : 489.0
Number_of_Predicates               : 38593

Release                            : v2.35.0
Platform                           : x86-windows
Language                           : cpp
Total_Serialized_Execution_Time_Ms : 7299920
Mean_Predicate_Execution_Time_Ms   : 168.56601856555673
Median_Predicate_Execution_Time_Ms : 4.0
Standard_Deviation_Ms              : 1341.6973819978125
Total_Serialized_Execution_Time_s  : 7299.92
Mean_Query_Execution_Time_s        : 0.1685660185655567
Median_Predicate_Execution_Time_s  : 0.004
Percentile95_Ms                    : 472.75
Number_of_Predicates               : 43306

Release                            : 742
Platform                           : x86-linux
Language                           : cpp
Total_Serialized_Execution_Time_Ms : 3674240
Mean_Predicate_Execution_Time_Ms   : 82.01611643117033
Median_Predicate_Execution_Time_Ms : 2.0
Standard_Deviation_Ms              : 638.2355116896208
Total_Serialized_Execution_Time_s  : 3674.24
Mean_Query_Execution_Time_s        : 0.0820161164311703
Median_Predicate_Execution_Time_s  : 0.002
Percentile95_Ms                    : 228.0
Number_of_Predicates               : 44799

Release                            : 742
Platform                           : x86-linux
Language                           : c
Total_Serialized_Execution_Time_Ms : 25737160
Mean_Predicate_Execution_Time_Ms   : 594.1721303906178
Median_Predicate_Execution_Time_Ms : 1.0
Standard_Deviation_Ms              : 33779.00238795052
Total_Serialized_Execution_Time_s  : 25737.16
Mean_Query_Execution_Time_s        : 0.5941721303906178
Median_Predicate_Execution_Time_s  : 0.001
Percentile95_Ms                    : 635.0
Number_of_Predicates               : 43316

🏁 Below are the slowest predicates for the last 2 releases vs this PR.


Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : cpp
Suite             : autosar-default
Predicate         : m##DataFlowUtil#7572fbec::localFlowStep#2Plus#bf
Execution_Time_Ms : 94140

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : c
Suite             : misra-default
Predicate         : _Expr#ef463c5d::Expr::getValueText#0#dispred#bf#antijoin_rhs
Execution_Time_Ms : 38733

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : c
Suite             : misra-default
Predicate         : #select#cpe#123#fff
Execution_Time_Ms : 323756

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : c
Suite             : misra-default
Predicate         : RepeatedInitializationOfAggregateObjectElement#76b22bdc::hasMultipleInitializerExprsForSameIndexInternal#4#ffff_3012#join_rhs
Execution_Time_Ms : 53392

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : c
Suite             : misra-default
Predicate         : OutOfBounds#e16b6a86::OOB::libraryFunctionNameParamTableSimpleString#5#cpe#1236#ffff
Execution_Time_Ms : 44851

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : c
Suite             : cert-default
Predicate         : _#Element#496c7fc2::Element::getEnclosingElement#0#dispredPlus#bf_Access#8878f617::Access::getTarget__#antijoin_rhs
Execution_Time_Ms : 246593

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : c
Suite             : misra-default
Predicate         : OutOfBounds#e16b6a86::OOB::libraryFunctionNameParamTableSimpleString#5#cpe#1236#ffff
Execution_Time_Ms : 57542

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : CheckedException#b9f43435::CheckedException#f
Execution_Time_Ms : 65883

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : Dependency#b0c9183e::dependsOnTransitive#2#ff
Execution_Time_Ms : 112189

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : HardwareOrProtocolInterface#1798ff2a::HardwareOrProtocolInterfaceClass#class#f
Execution_Time_Ms : 50536

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : cpp
Suite             : autosar-default
Predicate         : HardwareOrProtocolInterface#1798ff2a::HardwareOrProtocolInterfaceClass#class#f
Execution_Time_Ms : 64512

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : cpp
Suite             : autosar-default
Predicate         : CheckedException#b9f43435::CheckedException#f
Execution_Time_Ms : 50789

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : cpp
Suite             : autosar-default
Predicate         : Dependency#b0c9183e::dependsOnTransitive#2#ff
Execution_Time_Ms : 134155

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : c
Suite             : misra-default
Predicate         : _@element#f_Declarations5#fba18028::Declarations5Package::identifiersDeclaredInTheSameScopeNotDistin__#antijoin_rhs
Execution_Time_Ms : 39378

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : c
Suite             : misra-default
Predicate         : _@element#f_Declarations1#f6cea675::Declarations1Package::externalIdentifiersNotDistinctQuery#0#f_De__#antijoin_rhs
Execution_Time_Ms : 39346

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : __@element#b_Deviations#ac004ef9::DeviationRecord::getACodeIdentifierComment#0#dispred#ff_10#join_rh__#shared
Execution_Time_Ms : 48054

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : c
Suite             : cert-default
Predicate         : _#Element#496c7fc2::Element::getEnclosingElement#0#dispredPlus#bf_Access#8878f617::Access::getTarget__#antijoin_rhs
Execution_Time_Ms : 231075

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : c
Suite             : misra-default
Predicate         : #select#cpe#123#fff
Execution_Time_Ms : 306483

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : m##DataFlowUtil#7572fbec::localFlowStep#2Plus#bf
Execution_Time_Ms : 85692

Release           : v2.35.0
Run               : 2024-09-25_17-49-33
Platform          : x86-windows
Language          : cpp
Suite             : autosar-default
Predicate         : CheckedException#b9f43435::CheckedException#f
Execution_Time_Ms : 51164

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : c
Suite             : cert-default
Predicate         : _Function::FunctionDeclarationEntry.getNumberOfParameters/0#dispred#cba16fc0#bf_m#IncompatibleFuncti__#antijoin_rhs
Execution_Time_Ms : 1569463

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : c
Suite             : cert-default
Predicate         : m#IncompatibleFunctionDeclarations::checkMatchingFunction/2#6c0ba516#bb
Execution_Time_Ms : 2472199

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : c
Suite             : cert-default
Predicate         : IncompatibleFunctionDeclarations::checkMatchingFunction/2#6c0ba516#bb
Execution_Time_Ms : 3926509

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : CharacterOutsideTheLanguageStandardBasicSourceCharacterSetUsedInTheSourceCode::getUniversalCharacterName/1#36dbaa42
Execution_Time_Ms : 35359

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : HardwareOrProtocolInterface::HardwareOrProtocolInterfaceClass#class#7f026171
Execution_Time_Ms : 26154

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : CheckedException::CheckedException#b0aa5ec8
Execution_Time_Ms : 31204

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : c
Suite             : cert-default
Predicate         : _@element_Declarations2::Declarations2Package::excessLengthNamesIdentifiersNotDistinctQuery/0#debac0__#antijoin_rhs
Execution_Time_Ms : 617569

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : c
Suite             : cert-default
Predicate         : _fun_decls_fun_decls_30#join_rhs_param_decl_bind_201#join_rhs#shared
Execution_Time_Ms : 4945710

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : ___@element#b_Deviations::DeviationRecord.getACodeIdentifierComment/0#dispred#10d8760b_10#join_rhs_D__#shared
Execution_Time_Ms : 27393

Release           : 742
Run               : 2024-10-09_22-35-36
Platform          : x86-linux
Language          : cpp
Suite             : autosar-default
Predicate         : QualifiedName::getUserTypeNameWithoutArgs/1#8cfc98e9
Execution_Time_Ms : 27781

@lcartey
Copy link
Collaborator

lcartey commented Oct 10, 2024

@knewbury01 I've requested you to review this upgrade, as I made some substantial changes to the InfeasiblePath.ql query you recently modified. Please take a careful look at the changes in d0540e4, in addition to reviewing the overall PR.

The motivation was to eliminate the use of GuardCondition in this query, because between 2.15.5 and 2.16.6 it was rewritten to use the IR. However, the IR is not produced for uninstantiated templates. Fortunately, the query already has an equivalent consideration of when "guard" may produce an infeasible path, so I switched the query to using the non-template mechanisms for uninstantiated templates, but continuing to exclude template instantiations to avoid double reporting.

@lcartey lcartey added this to the 2.37.0 milestone Oct 22, 2024
Copy link
Contributor

@knewbury01 knewbury01 left a comment

Choose a reason for hiding this comment

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

only one small request, otherwise looks good to me

change_notes/2024-10-08-upgrade-to-2.16.6.md Show resolved Hide resolved
@lcartey
Copy link
Collaborator

lcartey commented Oct 22, 2024

@knewbury01 ready for re-review

Copy link
Contributor

@knewbury01 knewbury01 left a comment

Choose a reason for hiding this comment

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

looks good to me now! thanks for that testcase addition!

@knewbury01 knewbury01 added this pull request to the merge queue Oct 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 23, 2024
@lcartey lcartey added this pull request to the merge queue Oct 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 23, 2024
@knewbury01 knewbury01 added this pull request to the merge queue Oct 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 23, 2024
@lcartey lcartey added this pull request to the merge queue Oct 23, 2024
Merged via the queue into main with commit 18a3f35 Oct 23, 2024
29 checks passed
@lcartey lcartey deleted the codeql/upgrade-to-2.16.6 branch October 23, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants