Skip to content

Implement C Memory2 package #265

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 15 commits into from
Mar 28, 2023
Merged

Implement C Memory2 package #265

merged 15 commits into from
Mar 28, 2023

Conversation

nicolaswill
Copy link
Contributor

Description

This pull request implements the C Memory2 package.

Change request type

  • Release or process automation (GitHub workflows, internal scripts)
  • Internal documentation
  • External documentation
  • Query files (.ql, .qll, .qls or unit tests)
  • External scripts (analysis report or other code shipped as part of a release)

Rules with added or modified queries

  • No rules added
  • Queries have been added for the following rules:
    • ARR36-C (closes github/coding-standards-team#748)
    • EXP43-C (closes github/coding-standards-team#749)
    • MEM31-C (closes github/coding-standards-team#750)
    • MEM33-C (closes github/coding-standards-team#751)
    • MEM34-C (closes github/coding-standards-team#752)
    • MEM36-C (closes github/coding-standards-team#754)
    • RULE-22-1 (closes github/coding-standards-team#760)
    • RULE-22-2 (closes github/coding-standards-team#761)
  • Queries have been modified for the following rules:
    • FIO42-C (minor bug-fix and creation of shared implementation)

Release change checklist

A change note (development_handbook.md#change-notes) is required for any pull request which modifies:

  • The structure or layout of the release artifacts.
  • The evaluation performance (memory, execution time) of an existing query.
  • The results of an existing query in any circumstance.

If you are only adding new rule queries, a change note is not required.

Author: Is a change note required?

  • Yes
  • No

🚨🚨🚨
Reviewer: Confirm that format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.

  • Confirmed

Reviewer: Confirm that either a change note is not required or the change note is required and has been added.

  • Confirmed

Query development review checklist

For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:

Author

  • Have all the relevant rule package description files been checked in?
  • Have you verified that the metadata properties of each new query is set appropriately?
  • Do all the unit tests contain both "COMPLIANT" and "NON_COMPLIANT" cases?
  • Are the alert messages properly formatted and consistent with the style guide?
  • Have you run the queries on OpenPilot and verified that the performance and results are acceptable?
    As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
  • Does the query have an appropriate level of in-query comments/documentation?
  • Have you considered/identified possible edge cases?
  • Does the query not reinvent features in the standard library?
  • Can the query be simplified further (not golfed!)

Reviewer

  • Have all the relevant rule package description files been checked in?
  • Have you verified that the metadata properties of each new query is set appropriately?
  • Do all the unit tests contain both "COMPLIANT" and "NON_COMPLIANT" cases?
  • Are the alert messages properly formatted and consistent with the style guide?
  • Have you run the queries on OpenPilot and verified that the performance and results are acceptable?
    As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
  • Does the query have an appropriate level of in-query comments/documentation?
  • Have you considered/identified possible edge cases?
  • Does the query not reinvent features in the standard library?
  • Can the query be simplified further (not golfed!)

@nicolaswill nicolaswill self-assigned this Mar 23, 2023
@github github deleted a comment from github-actions bot Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from github-actions bot Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from github-actions bot Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@github github deleted a comment from jsinglet Mar 23, 2023
@jsinglet
Copy link
Contributor

🤖 Beep Boop! gcc/cpp/X86_64 Matrix Testing for this PR has been completed. See below for the results!


PACKAGE              : Representation
TEST_PASS            : False
SUITE                : CERT-C++
QUERY                : MemcpyUsedToAccessObjectRepresentation
COMPILE_PASS         : False
TEST_DIFFERENCE      : 
RULE                 : EXP62-CPP
COMPILE_ERROR_OUTPUT : [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp: In function 'void f2()':
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: error: 'memcpy' is not a member of 'std'
                       [2023-03-23 02:20:40] [build-stderr]    std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 02:20:40] [build-stderr]         ^~~~~~
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: note: suggested alternative: 'decay'
                       [2023-03-23 02:20:40] [build-stderr]    std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 02:20:40] [build-stderr]         ^~~~~~
                       [2023-03-23 02:20:40] [build-stderr]         decay
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp: In function 'void f4()':
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:39:8: error: 'memset' is not a member of 'std'
                       [2023-03-23 02:20:40] [build-stderr]    std::memset(s3, 0, sizeof(S3)); // NON_COMPLIANT
                       [2023-03-23 02:20:40] [build-stderr]         ^~~~~~
                       [2023-03-23 02:20:41] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, g++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp])
                       

PACKAGE              : Representation
TEST_PASS            : False
SUITE                : CERT-C++
QUERY                : MemsetUsedToAccessObjectRepresentation
COMPILE_PASS         : False
TEST_DIFFERENCE      : 
RULE                 : EXP62-CPP
COMPILE_ERROR_OUTPUT : [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp: In function 'void f2()':
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: error: 'memcpy' is not a member of 'std'
                       [2023-03-23 02:20:40] [build-stderr]    std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 02:20:40] [build-stderr]         ^~~~~~
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: note: suggested alternative: 'decay'
                       [2023-03-23 02:20:40] [build-stderr]    std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 02:20:40] [build-stderr]         ^~~~~~
                       [2023-03-23 02:20:40] [build-stderr]         decay
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp: In function 'void f4()':
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:39:8: error: 'memset' is not a member of 'std'
                       [2023-03-23 02:20:40] [build-stderr]    std::memset(s3, 0, sizeof(S3)); // NON_COMPLIANT
                       [2023-03-23 02:20:40] [build-stderr]         ^~~~~~
                       [2023-03-23 02:20:41] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, g++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp])
                       

PACKAGE              : Representation
TEST_PASS            : False
SUITE                : CERT-C++
QUERY                : MemcmpUsedToAccessObjectRepresentation
COMPILE_PASS         : False
TEST_DIFFERENCE      : 
RULE                 : EXP62-CPP
COMPILE_ERROR_OUTPUT : [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp: In function 'void f1(const S1&, const S1&)':
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp:23:13: error: 'memcmp' is not a member of 'std'
                       [2023-03-23 02:20:40] [build-stderr]    if (!std::memcmp(&s1, &s2, sizeof(S1))) { // NON_COMPLIANT
                       [2023-03-23 02:20:40] [build-stderr]              ^~~~~~
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp: In function 'void f2(const S2&, const S2&)':
                       [2023-03-23 02:20:40] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp:28:13: error: 'memcmp' is not a member of 'std'
                       [2023-03-23 02:20:40] [build-stderr]    if (!std::memcmp(&s1.buff, &s2.buff, sizeof(S2::buff))) { // COMPLIANT
                       [2023-03-23 02:20:40] [build-stderr]              ^~~~~~
                       [2023-03-23 02:20:41] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, g++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp])
                       

PACKAGE              : Allocations
TEST_PASS            : True
SUITE                : CERT-C++
QUERY                : UsingDefaultOperatorNewForOverAlignedTypes
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : MEM57-CPP
COMPILE_ERROR_OUTPUT : 


@jsinglet
Copy link
Contributor

🤖 Beep Boop! gcc/c/X86_64 Matrix Testing for this PR has been completed. See below for the results!


COMPILE_PASS         : True
RULE                 : MEM33-C
TEST_DIFFERENCE      : 
SUITE                : CERT-C
TEST_PASS            : True
PACKAGE              : Memory2
QUERY                : CopyStructsWithAFlexibleArrayMemberDynamically
COMPILE_ERROR_OUTPUT : 

COMPILE_PASS         : True
RULE                 : MEM33-C
TEST_DIFFERENCE      : 
SUITE                : CERT-C
TEST_PASS            : True
PACKAGE              : Memory2
QUERY                : AllocStructsWithAFlexibleArrayMemberDynamically
COMPILE_ERROR_OUTPUT : 

COMPILE_PASS         : True
RULE                 : MEM36-C
TEST_DIFFERENCE      : 
SUITE                : CERT-C
TEST_PASS            : True
PACKAGE              : Memory2
QUERY                : DoNotModifyAlignmentOfMemoryWithRealloc
COMPILE_ERROR_OUTPUT : 

COMPILE_PASS         : True
RULE                 : RULE-22-1
TEST_DIFFERENCE      : --- expected
                       +++ actual
                       @@ -1,8 +1,6 @@
                        | test.c:7:13:7:17 | call to fopen | The file opened here may not be closed at $@. | test.c:6:31:13:1 | { ... } | this location |
                        | test.c:16:13:16:19 | call to freopen | The file opened here may not be closed at $@. | test.c:15:31:22:1 | { ... } | this location |
                        | test.c:25:13:25:19 | call to freopen | The file opened here may not be closed at $@. | test.c:24:32:31:1 | { ... } | this location |
                       -| test.c:46:13:46:17 | call to fopen | The file opened here may not be closed at $@. | test.c:56:3:56:11 | return ... | this location |
                       -| test.c:85:13:85:17 | call to fopen | The file opened here may not be closed at $@. | test.c:89:3:89:27 | return ... | this location |
                        | test.c:93:13:93:19 | call to freopen | The file opened here may not be closed at $@. | test.c:92:33:104:1 | { ... } | this location |
                        | test.c:107:13:107:17 | call to fopen | The file opened here may not be closed at $@. | test.c:106:30:113:1 | { ... } | this location |
                        | test.c:128:12:128:15 | call to open | The file opened here may not be closed at $@. | test.c:127:30:134:1 | { ... } | this location |
                       [1/1 comp 36s eval 983ms] FAILED(RESULT) /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/c/common/test/rules/closefilehandlewhennolongerneededshared/CloseFileHandleWhenNoLongerNeededShared.ql
                       
SUITE                : MISRA-C-2012
TEST_PASS            : False
PACKAGE              : Memory2
QUERY                : CloseFileHandleWhenNoLongerNeededMisra
COMPILE_ERROR_OUTPUT : 

COMPILE_PASS         : True
RULE                 : RULE-22-1
TEST_DIFFERENCE      : 
SUITE                : MISRA-C-2012
TEST_PASS            : True
PACKAGE              : Memory2
QUERY                : FreeMemoryWhenNoLongerNeededMisra
COMPILE_ERROR_OUTPUT : 

COMPILE_PASS         : True
RULE                 : FIO42-C
TEST_DIFFERENCE      : --- expected
                       +++ actual
                       @@ -1,8 +1,6 @@
                        | test.c:7:13:7:17 | call to fopen | The file opened here may not be closed at $@. | test.c:6:31:13:1 | { ... } | this location |
                        | test.c:16:13:16:19 | call to freopen | The file opened here may not be closed at $@. | test.c:15:31:22:1 | { ... } | this location |
                        | test.c:25:13:25:19 | call to freopen | The file opened here may not be closed at $@. | test.c:24:32:31:1 | { ... } | this location |
                       -| test.c:46:13:46:17 | call to fopen | The file opened here may not be closed at $@. | test.c:56:3:56:11 | return ... | this location |
                       -| test.c:85:13:85:17 | call to fopen | The file opened here may not be closed at $@. | test.c:89:3:89:27 | return ... | this location |
                        | test.c:93:13:93:19 | call to freopen | The file opened here may not be closed at $@. | test.c:92:33:104:1 | { ... } | this location |
                        | test.c:107:13:107:17 | call to fopen | The file opened here may not be closed at $@. | test.c:106:30:113:1 | { ... } | this location |
                        | test.c:128:12:128:15 | call to open | The file opened here may not be closed at $@. | test.c:127:30:134:1 | { ... } | this location |
                       [1/1 eval 932ms] FAILED(RESULT) /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/c/common/test/rules/closefilehandlewhennolongerneededshared/CloseFileHandleWhenNoLongerNeededShared.ql
                       
SUITE                : CERT-C
TEST_PASS            : False
PACKAGE              : IO1
QUERY                : CloseFilesWhenTheyAreNoLongerNeeded
COMPILE_ERROR_OUTPUT : 

COMPILE_PASS         : True
RULE                 : MEM31-C
TEST_DIFFERENCE      : 
SUITE                : CERT-C
TEST_PASS            : True
PACKAGE              : Memory2
QUERY                : FreeMemoryWhenNoLongerNeededCert
COMPILE_ERROR_OUTPUT : 

COMPILE_PASS         : True
RULE                 : EXP42-C
TEST_DIFFERENCE      : 
SUITE                : CERT-C
TEST_PASS            : True
PACKAGE              : Memory2
QUERY                : DoNotComparePaddingData
COMPILE_ERROR_OUTPUT : 

COMPILE_PASS         : True
RULE                 : RULE-22-2
TEST_DIFFERENCE      : 
SUITE                : MISRA-C-2012
TEST_PASS            : True
PACKAGE              : Memory2
QUERY                : OnlyFreeMemoryAllocatedDynamicallyMisra
COMPILE_ERROR_OUTPUT : 

COMPILE_PASS         : True
RULE                 : MEM34-C
TEST_DIFFERENCE      : 
SUITE                : CERT-C
TEST_PASS            : True
PACKAGE              : Memory2
QUERY                : OnlyFreeMemoryAllocatedDynamicallyCert
COMPILE_ERROR_OUTPUT : 


@jsinglet
Copy link
Contributor

🤖 Beep Boop! clang/c/X86_64 Matrix Testing for this PR has been completed. See below for the results!


COMPILE_ERROR_OUTPUT : 
SUITE                : CERT-C
TEST_PASS            : True
COMPILE_PASS         : True
RULE                 : MEM33-C
QUERY                : CopyStructsWithAFlexibleArrayMemberDynamically
PACKAGE              : Memory2
TEST_DIFFERENCE      : 

COMPILE_ERROR_OUTPUT : 
SUITE                : CERT-C
TEST_PASS            : True
COMPILE_PASS         : True
RULE                 : MEM33-C
QUERY                : AllocStructsWithAFlexibleArrayMemberDynamically
PACKAGE              : Memory2
TEST_DIFFERENCE      : 

COMPILE_ERROR_OUTPUT : 
SUITE                : CERT-C
TEST_PASS            : True
COMPILE_PASS         : True
RULE                 : MEM36-C
QUERY                : DoNotModifyAlignmentOfMemoryWithRealloc
PACKAGE              : Memory2
TEST_DIFFERENCE      : 

COMPILE_ERROR_OUTPUT : 
SUITE                : MISRA-C-2012
TEST_PASS            : False
COMPILE_PASS         : True
RULE                 : RULE-22-1
QUERY                : CloseFileHandleWhenNoLongerNeededMisra
PACKAGE              : Memory2
TEST_DIFFERENCE      : --- expected
                       +++ actual
                       @@ -1,8 +1,6 @@
                        | test.c:7:13:7:17 | call to fopen | The file opened here may not be closed at $@. | test.c:6:31:13:1 | { ... } | this location |
                        | test.c:16:13:16:19 | call to freopen | The file opened here may not be closed at $@. | test.c:15:31:22:1 | { ... } | this location |
                        | test.c:25:13:25:19 | call to freopen | The file opened here may not be closed at $@. | test.c:24:32:31:1 | { ... } | this location |
                       -| test.c:46:13:46:17 | call to fopen | The file opened here may not be closed at $@. | test.c:56:3:56:11 | return ... | this location |
                       -| test.c:85:13:85:17 | call to fopen | The file opened here may not be closed at $@. | test.c:89:3:89:27 | return ... | this location |
                        | test.c:93:13:93:19 | call to freopen | The file opened here may not be closed at $@. | test.c:92:33:104:1 | { ... } | this location |
                        | test.c:107:13:107:17 | call to fopen | The file opened here may not be closed at $@. | test.c:106:30:113:1 | { ... } | this location |
                        | test.c:128:12:128:15 | call to open | The file opened here may not be closed at $@. | test.c:127:30:134:1 | { ... } | this location |
                       [1/1 comp 36.3s eval 958ms] FAILED(RESULT) /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/c/common/test/rules/closefilehandlewhennolongerneededshared/CloseFileHandleWhenNoLongerNeededShared.ql
                       

COMPILE_ERROR_OUTPUT : 
SUITE                : MISRA-C-2012
TEST_PASS            : True
COMPILE_PASS         : True
RULE                 : RULE-22-1
QUERY                : FreeMemoryWhenNoLongerNeededMisra
PACKAGE              : Memory2
TEST_DIFFERENCE      : 

COMPILE_ERROR_OUTPUT : 
SUITE                : CERT-C
TEST_PASS            : False
COMPILE_PASS         : True
RULE                 : FIO42-C
QUERY                : CloseFilesWhenTheyAreNoLongerNeeded
PACKAGE              : IO1
TEST_DIFFERENCE      : --- expected
                       +++ actual
                       @@ -1,8 +1,6 @@
                        | test.c:7:13:7:17 | call to fopen | The file opened here may not be closed at $@. | test.c:6:31:13:1 | { ... } | this location |
                        | test.c:16:13:16:19 | call to freopen | The file opened here may not be closed at $@. | test.c:15:31:22:1 | { ... } | this location |
                        | test.c:25:13:25:19 | call to freopen | The file opened here may not be closed at $@. | test.c:24:32:31:1 | { ... } | this location |
                       -| test.c:46:13:46:17 | call to fopen | The file opened here may not be closed at $@. | test.c:56:3:56:11 | return ... | this location |
                       -| test.c:85:13:85:17 | call to fopen | The file opened here may not be closed at $@. | test.c:89:3:89:27 | return ... | this location |
                        | test.c:93:13:93:19 | call to freopen | The file opened here may not be closed at $@. | test.c:92:33:104:1 | { ... } | this location |
                        | test.c:107:13:107:17 | call to fopen | The file opened here may not be closed at $@. | test.c:106:30:113:1 | { ... } | this location |
                        | test.c:128:12:128:15 | call to open | The file opened here may not be closed at $@. | test.c:127:30:134:1 | { ... } | this location |
                       [1/1 eval 840ms] FAILED(RESULT) /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/c/common/test/rules/closefilehandlewhennolongerneededshared/CloseFileHandleWhenNoLongerNeededShared.ql
                       

COMPILE_ERROR_OUTPUT : 
SUITE                : CERT-C
TEST_PASS            : True
COMPILE_PASS         : True
RULE                 : MEM31-C
QUERY                : FreeMemoryWhenNoLongerNeededCert
PACKAGE              : Memory2
TEST_DIFFERENCE      : 

COMPILE_ERROR_OUTPUT : 
SUITE                : CERT-C
TEST_PASS            : True
COMPILE_PASS         : True
RULE                 : EXP42-C
QUERY                : DoNotComparePaddingData
PACKAGE              : Memory2
TEST_DIFFERENCE      : 

COMPILE_ERROR_OUTPUT : 
SUITE                : MISRA-C-2012
TEST_PASS            : True
COMPILE_PASS         : True
RULE                 : RULE-22-2
QUERY                : OnlyFreeMemoryAllocatedDynamicallyMisra
PACKAGE              : Memory2
TEST_DIFFERENCE      : 

COMPILE_ERROR_OUTPUT : 
SUITE                : CERT-C
TEST_PASS            : True
COMPILE_PASS         : True
RULE                 : MEM34-C
QUERY                : OnlyFreeMemoryAllocatedDynamicallyCert
PACKAGE              : Memory2
TEST_DIFFERENCE      : 


@jsinglet
Copy link
Contributor

🤖 Beep Boop! clang/cpp/X86_64 Matrix Testing for this PR has been completed. See below for the results!


COMPILE_PASS         : False
TEST_DIFFERENCE      : 
PACKAGE              : Representation
COMPILE_ERROR_OUTPUT : [2023-03-23 02:21:02] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: error: no member named 'memcpy' in namespace 'std'
                       [2023-03-23 02:21:02] [build-stderr]   std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 02:21:02] [build-stderr]   ~~~~~^
                       [2023-03-23 02:21:02] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:39:8: error: no member named 'memset' in namespace 'std'
                       [2023-03-23 02:21:02] [build-stderr]   std::memset(s3, 0, sizeof(S3)); // NON_COMPLIANT
                       [2023-03-23 02:21:02] [build-stderr]   ~~~~~^
                       [2023-03-23 02:21:02] [build-stderr] 2 errors generated.
                       [2023-03-23 02:21:03] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, clang++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp])
                       
TEST_PASS            : False
QUERY                : MemsetUsedToAccessObjectRepresentation
SUITE                : CERT-C++
RULE                 : EXP62-CPP

COMPILE_PASS         : False
TEST_DIFFERENCE      : 
PACKAGE              : Representation
COMPILE_ERROR_OUTPUT : [2023-03-23 02:21:02] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp:23:13: error: no member named 'memcmp' in namespace 'std'
                       [2023-03-23 02:21:02] [build-stderr]   if (!std::memcmp(&s1, &s2, sizeof(S1))) { // NON_COMPLIANT
                       [2023-03-23 02:21:02] [build-stderr]        ~~~~~^
                       [2023-03-23 02:21:02] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp:28:13: error: no member named 'memcmp' in namespace 'std'
                       [2023-03-23 02:21:02] [build-stderr]   if (!std::memcmp(&s1.buff, &s2.buff, sizeof(S2::buff))) { // COMPLIANT
                       [2023-03-23 02:21:02] [build-stderr]        ~~~~~^
                       [2023-03-23 02:21:02] [build-stderr] 2 errors generated.
                       [2023-03-23 02:21:03] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, clang++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp])
                       
TEST_PASS            : False
QUERY                : MemcmpUsedToAccessObjectRepresentation
SUITE                : CERT-C++
RULE                 : EXP62-CPP

COMPILE_PASS         : False
TEST_DIFFERENCE      : 
PACKAGE              : Representation
COMPILE_ERROR_OUTPUT : [2023-03-23 02:21:02] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: error: no member named 'memcpy' in namespace 'std'
                       [2023-03-23 02:21:02] [build-stderr]   std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 02:21:02] [build-stderr]   ~~~~~^
                       [2023-03-23 02:21:02] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:39:8: error: no member named 'memset' in namespace 'std'
                       [2023-03-23 02:21:02] [build-stderr]   std::memset(s3, 0, sizeof(S3)); // NON_COMPLIANT
                       [2023-03-23 02:21:02] [build-stderr]   ~~~~~^
                       [2023-03-23 02:21:02] [build-stderr] 2 errors generated.
                       [2023-03-23 02:21:03] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, clang++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp])
                       
TEST_PASS            : False
QUERY                : MemcpyUsedToAccessObjectRepresentation
SUITE                : CERT-C++
RULE                 : EXP62-CPP

COMPILE_PASS         : True
TEST_DIFFERENCE      : 
PACKAGE              : Allocations
COMPILE_ERROR_OUTPUT : 
TEST_PASS            : True
QUERY                : UsingDefaultOperatorNewForOverAlignedTypes
SUITE                : CERT-C++
RULE                 : MEM57-CPP


@jsinglet
Copy link
Contributor

🤖 Beep Boop! Matrix Testing for this PR has been completed. If no reports were posted it means this PR does not contain things that need matrix testing!

@github-actions
Copy link

🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results.

💡 If you do not hear back from me please check my status! I will report even if this PR does not contain files eligible for matrix testing.

@nicolaswill nicolaswill requested a review from lcartey March 23, 2023 11:01
@jsinglet
Copy link
Contributor

🤖 Beep Boop! qcc/cpp/AARCH64LE Matrix Testing for this PR won't happen because it is outside of license window!

@jsinglet
Copy link
Contributor

🤖 Beep Boop! qcc/c/AARCH64LE Matrix Testing for this PR won't happen because it is outside of license window!

@jsinglet
Copy link
Contributor

🤖 Beep Boop! clang/c/X86_64 Matrix Testing for this PR has been completed. See below for the results!


SUITE                : CERT-C
RULE                 : MEM33-C
QUERY                : CopyStructsWithAFlexibleArrayMemberDynamically
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : Memory2
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True

SUITE                : CERT-C
RULE                 : MEM33-C
QUERY                : AllocStructsWithAFlexibleArrayMemberDynamically
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : Memory2
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True

SUITE                : CERT-C
RULE                 : MEM36-C
QUERY                : DoNotModifyAlignmentOfMemoryWithRealloc
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : Memory2
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True

SUITE                : MISRA-C-2012
RULE                 : RULE-22-1
QUERY                : CloseFileHandleWhenNoLongerNeededMisra
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : Memory2
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True

SUITE                : MISRA-C-2012
RULE                 : RULE-22-1
QUERY                : FreeMemoryWhenNoLongerNeededMisra
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : Memory2
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True

SUITE                : CERT-C
RULE                 : FIO42-C
QUERY                : CloseFilesWhenTheyAreNoLongerNeeded
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : IO1
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True

SUITE                : CERT-C
RULE                 : MEM31-C
QUERY                : FreeMemoryWhenNoLongerNeededCert
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : Memory2
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True

SUITE                : CERT-C
RULE                 : EXP42-C
QUERY                : DoNotComparePaddingData
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : Memory2
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True

SUITE                : MISRA-C-2012
RULE                 : RULE-22-2
QUERY                : OnlyFreeMemoryAllocatedDynamicallyMisra
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : Memory2
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True

SUITE                : CERT-C
RULE                 : MEM34-C
QUERY                : OnlyFreeMemoryAllocatedDynamicallyCert
TEST_DIFFERENCE      : 
TEST_PASS            : True
PACKAGE              : Memory2
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True


@jsinglet
Copy link
Contributor

🤖 Beep Boop! gcc/cpp/X86_64 Matrix Testing for this PR has been completed. See below for the results!


PACKAGE              : Representation
COMPILE_PASS         : False
RULE                 : EXP62-CPP
TEST_PASS            : False
SUITE                : CERT-C++
QUERY                : MemcmpUsedToAccessObjectRepresentation
TEST_DIFFERENCE      : 
COMPILE_ERROR_OUTPUT : [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp: In function 'void f1(const S1&, const S1&)':
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp:23:13: error: 'memcmp' is not a member of 'std'
                       [2023-03-23 11:07:13] [build-stderr]    if (!std::memcmp(&s1, &s2, sizeof(S1))) { // NON_COMPLIANT
                       [2023-03-23 11:07:13] [build-stderr]              ^~~~~~
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp: In function 'void f2(const S2&, const S2&)':
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp:28:13: error: 'memcmp' is not a member of 'std'
                       [2023-03-23 11:07:13] [build-stderr]    if (!std::memcmp(&s1.buff, &s2.buff, sizeof(S2::buff))) { // COMPLIANT
                       [2023-03-23 11:07:13] [build-stderr]              ^~~~~~
                       [2023-03-23 11:07:14] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, g++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp])
                       

PACKAGE              : Representation
COMPILE_PASS         : False
RULE                 : EXP62-CPP
TEST_PASS            : False
SUITE                : CERT-C++
QUERY                : MemsetUsedToAccessObjectRepresentation
TEST_DIFFERENCE      : 
COMPILE_ERROR_OUTPUT : [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp: In function 'void f2()':
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: error: 'memcpy' is not a member of 'std'
                       [2023-03-23 11:07:13] [build-stderr]    std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 11:07:13] [build-stderr]         ^~~~~~
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: note: suggested alternative: 'decay'
                       [2023-03-23 11:07:13] [build-stderr]    std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 11:07:13] [build-stderr]         ^~~~~~
                       [2023-03-23 11:07:13] [build-stderr]         decay
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp: In function 'void f4()':
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:39:8: error: 'memset' is not a member of 'std'
                       [2023-03-23 11:07:13] [build-stderr]    std::memset(s3, 0, sizeof(S3)); // NON_COMPLIANT
                       [2023-03-23 11:07:13] [build-stderr]         ^~~~~~
                       [2023-03-23 11:07:14] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, g++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp])
                       

PACKAGE              : Representation
COMPILE_PASS         : False
RULE                 : EXP62-CPP
TEST_PASS            : False
SUITE                : CERT-C++
QUERY                : MemcpyUsedToAccessObjectRepresentation
TEST_DIFFERENCE      : 
COMPILE_ERROR_OUTPUT : [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp: In function 'void f2()':
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: error: 'memcpy' is not a member of 'std'
                       [2023-03-23 11:07:13] [build-stderr]    std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 11:07:13] [build-stderr]         ^~~~~~
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: note: suggested alternative: 'decay'
                       [2023-03-23 11:07:13] [build-stderr]    std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 11:07:13] [build-stderr]         ^~~~~~
                       [2023-03-23 11:07:13] [build-stderr]         decay
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp: In function 'void f4()':
                       [2023-03-23 11:07:13] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:39:8: error: 'memset' is not a member of 'std'
                       [2023-03-23 11:07:13] [build-stderr]    std::memset(s3, 0, sizeof(S3)); // NON_COMPLIANT
                       [2023-03-23 11:07:13] [build-stderr]         ^~~~~~
                       [2023-03-23 11:07:14] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, g++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp])
                       

PACKAGE              : Allocations
COMPILE_PASS         : True
RULE                 : MEM57-CPP
TEST_PASS            : True
SUITE                : CERT-C++
QUERY                : UsingDefaultOperatorNewForOverAlignedTypes
TEST_DIFFERENCE      : 
COMPILE_ERROR_OUTPUT : 


@jsinglet
Copy link
Contributor

🤖 Beep Boop! clang/cpp/X86_64 Matrix Testing for this PR has been completed. See below for the results!


RULE                 : EXP62-CPP
TEST_DIFFERENCE      : 
COMPILE_ERROR_OUTPUT : [2023-03-23 11:07:21] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp:23:13: error: no member named 'memcmp' in namespace 'std'
                       [2023-03-23 11:07:21] [build-stderr]   if (!std::memcmp(&s1, &s2, sizeof(S1))) { // NON_COMPLIANT
                       [2023-03-23 11:07:21] [build-stderr]        ~~~~~^
                       [2023-03-23 11:07:21] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp:28:13: error: no member named 'memcmp' in namespace 'std'
                       [2023-03-23 11:07:21] [build-stderr]   if (!std::memcmp(&s1.buff, &s2.buff, sizeof(S2::buff))) { // COMPLIANT
                       [2023-03-23 11:07:21] [build-stderr]        ~~~~~^
                       [2023-03-23 11:07:21] [build-stderr] 2 errors generated.
                       [2023-03-23 11:07:22] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, clang++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/common/test/rules/memcmpusedtocomparepaddingdata/test.cpp])
                       
COMPILE_PASS         : False
SUITE                : CERT-C++
QUERY                : MemcmpUsedToAccessObjectRepresentation
PACKAGE              : Representation
TEST_PASS            : False

RULE                 : EXP62-CPP
TEST_DIFFERENCE      : 
COMPILE_ERROR_OUTPUT : [2023-03-23 11:07:21] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: error: no member named 'memcpy' in namespace 'std'
                       [2023-03-23 11:07:21] [build-stderr]   std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 11:07:21] [build-stderr]   ~~~~~^
                       [2023-03-23 11:07:21] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:39:8: error: no member named 'memset' in namespace 'std'
                       [2023-03-23 11:07:21] [build-stderr]   std::memset(s3, 0, sizeof(S3)); // NON_COMPLIANT
                       [2023-03-23 11:07:21] [build-stderr]   ~~~~~^
                       [2023-03-23 11:07:21] [build-stderr] 2 errors generated.
                       [2023-03-23 11:07:22] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, clang++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp])
                       
COMPILE_PASS         : False
SUITE                : CERT-C++
QUERY                : MemcpyUsedToAccessObjectRepresentation
PACKAGE              : Representation
TEST_PASS            : False

RULE                 : EXP62-CPP
TEST_DIFFERENCE      : 
COMPILE_ERROR_OUTPUT : [2023-03-23 11:07:21] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:12:8: error: no member named 'memcpy' in namespace 'std'
                       [2023-03-23 11:07:21] [build-stderr]   std::memcpy(s1, 0, sizeof(S1)); // NON_COMPLIANT
                       [2023-03-23 11:07:21] [build-stderr]   ~~~~~^
                       [2023-03-23 11:07:21] [build-stderr] /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp:39:8: error: no member named 'memset' in namespace 'std'
                       [2023-03-23 11:07:21] [build-stderr]   std::memset(s3, 0, sizeof(S3)); // NON_COMPLIANT
                       [2023-03-23 11:07:21] [build-stderr]   ~~~~~^
                       [2023-03-23 11:07:21] [build-stderr] 2 errors generated.
                       [2023-03-23 11:07:22] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql/tools/linux64/preload_tracer, clang++, -std=c++14, -fsyntax-only, /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/cpp/cert/test/rules/EXP62-CPP/test.cpp])
                       
COMPILE_PASS         : False
SUITE                : CERT-C++
QUERY                : MemsetUsedToAccessObjectRepresentation
PACKAGE              : Representation
TEST_PASS            : False

RULE                 : MEM57-CPP
TEST_DIFFERENCE      : 
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
SUITE                : CERT-C++
QUERY                : UsingDefaultOperatorNewForOverAlignedTypes
PACKAGE              : Allocations
TEST_PASS            : True


@jsinglet
Copy link
Contributor

🤖 Beep Boop! gcc/c/X86_64 Matrix Testing for this PR has been completed. See below for the results!


COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : MEM33-C
SUITE                : CERT-C
QUERY                : CopyStructsWithAFlexibleArrayMemberDynamically
PACKAGE              : Memory2
TEST_PASS            : True

COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : MEM33-C
SUITE                : CERT-C
QUERY                : AllocStructsWithAFlexibleArrayMemberDynamically
PACKAGE              : Memory2
TEST_PASS            : True

COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : MEM36-C
SUITE                : CERT-C
QUERY                : DoNotModifyAlignmentOfMemoryWithRealloc
PACKAGE              : Memory2
TEST_PASS            : True

COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : RULE-22-1
SUITE                : MISRA-C-2012
QUERY                : CloseFileHandleWhenNoLongerNeededMisra
PACKAGE              : Memory2
TEST_PASS            : True

COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : RULE-22-1
SUITE                : MISRA-C-2012
QUERY                : FreeMemoryWhenNoLongerNeededMisra
PACKAGE              : Memory2
TEST_PASS            : True

COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : FIO42-C
SUITE                : CERT-C
QUERY                : CloseFilesWhenTheyAreNoLongerNeeded
PACKAGE              : IO1
TEST_PASS            : True

COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : MEM31-C
SUITE                : CERT-C
QUERY                : FreeMemoryWhenNoLongerNeededCert
PACKAGE              : Memory2
TEST_PASS            : True

COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : EXP42-C
SUITE                : CERT-C
QUERY                : DoNotComparePaddingData
PACKAGE              : Memory2
TEST_PASS            : True

COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : RULE-22-2
SUITE                : MISRA-C-2012
QUERY                : OnlyFreeMemoryAllocatedDynamicallyMisra
PACKAGE              : Memory2
TEST_PASS            : True

COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
TEST_DIFFERENCE      : 
RULE                 : MEM34-C
SUITE                : CERT-C
QUERY                : OnlyFreeMemoryAllocatedDynamicallyCert
PACKAGE              : Memory2
TEST_PASS            : True


@jsinglet
Copy link
Contributor

🤖 Beep Boop! Matrix Testing for this PR has been completed. If no reports were posted it means this PR does not contain things that need matrix testing!

@nicolaswill
Copy link
Contributor Author

/test-performance

@github-actions
Copy link

🏁 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!

@jsinglet
Copy link
Contributor

🏁 Beep Boop! One or things failed during performance testing. Please check the release engineering repo for details.

Copy link
Collaborator

@lcartey lcartey left a comment

Choose a reason for hiding this comment

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

Good job! I've made a few comments and suggestions around identifying different types of allocations and free expressions, but otherwise looks good.

Nikita Kraiouchkine added 4 commits March 28, 2023 19:52
The query implementation is now a path-problem and only outputs results for flow from address-of expressions and global variable accesses that do not have allocation expressions assigned to them.
@nicolaswill nicolaswill requested a review from lcartey March 28, 2023 18:23
@lcartey lcartey added this pull request to the merge queue Mar 28, 2023
Merged via the queue into github:main with commit db66281 Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants