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

[DO NOT MERGE] Errors in project (Coverity) #2114

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
pull_request:

jobs:
polaris-scan:
Expand Down Expand Up @@ -71,3 +72,11 @@
polaris_reports_sarif_groupSCAIssues: true
polaris_upload_sarif_report: true
polaris_prComment_severities: "high,critical,medium,low"

- name: Upload .bridge artifact
uses: actions/upload-artifact@v4
with:
name: Bridge Logs
path: ${{github.workspace}}/.bridge
if-no-files-found: error
include-hidden-files: true
10 changes: 10 additions & 0 deletions cpp/arcticdb/codec/encode_v1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ namespace arcticdb {
[[nodiscard]] Segment encode_v1(SegmentInMemory&& s, const arcticdb::proto::encoding::VariantCodec &codec_opts) {
ARCTICDB_SAMPLE(EncodeSegment, 0)
auto in_mem_seg = std::move(s);

// INTENTIONAL
std::vector<int> arr(3);
s.end_row();
std::cout<<s.num_blocks()<< " " <<s.num_blocks()<<'\n';
auto a = s.clone();
s.clear();
std::cout<<arr.data()[4];


SegmentHeader segment_header{EncodingVersion::V1};
segment_header.set_compacted(in_mem_seg.compacted());

Expand Down
10 changes: 10 additions & 0 deletions cpp/arcticdb/version/local_versioned_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,16 @@ VersionedItem LocalVersionedEngine::compact_incomplete_dynamic(
const CompactIncompleteOptions& options) {
log::version().debug("Compacting incomplete symbol {}", stream_id);

std::vector<int> use_after_move = {1, 2, 3};
std::vector<int> moved = std::move(use_after_move);
for (auto i : use_after_move) {
std::cout<<i<<std::endl;
}

int* use_after_free = new int(0);
delete use_after_free;
std::cout<<*use_after_free<<std::endl;

auto update_info = get_latest_undeleted_version_and_next_version_id(store(), version_map(), stream_id);
auto pipeline_context = std::make_shared<PipelineContext>();
pipeline_context->stream_id_ = stream_id;
Expand Down
10 changes: 10 additions & 0 deletions cpp/arcticdb/version/version_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1744,6 +1744,16 @@ VersionedItem compact_incomplete_impl(
std::optional<SegmentInMemory> last_indexed;
std::optional<SortedValue> previous_sorted_value;

std::vector<int> use_after_move = {1, 2, 3};
std::vector<int> moved = std::move(use_after_move);
for (auto i : use_after_move) {
std::cout<<i<<std::endl;
}

int* use_after_free = new int(0);
delete use_after_free;
std::cout<<*use_after_free<<std::endl;

if(options.append_ && update_info.previous_index_key_.has_value()) {
read_indexed_keys_to_pipeline(store, pipeline_context, *(update_info.previous_index_key_), read_query, read_options);
if (!write_options.dynamic_schema) {
Expand Down
Loading