Skip to content

Commit ee49591

Browse files
committed
Intentional errors
1 parent 85d51e3 commit ee49591

File tree

6 files changed

+46
-88
lines changed

6 files changed

+46
-88
lines changed

.github/workflows/analysis_workflow.yml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,5 @@
11
name: Build with analysis tools
2-
on:
3-
workflow_dispatch:
4-
inputs:
5-
run_all_benchmarks:
6-
type: boolean
7-
default: false
8-
dev_image_tag:
9-
description: Tag of the ArcticDB development image to use for benchmark and code coverage flows
10-
type: string
11-
default: latest
12-
suite_to_run:
13-
description: Run LMDB suite or REAL storage (or both - ALL)
14-
type: choice
15-
options:
16-
- 'LMDB'
17-
- 'REAL'
18-
- 'ALL'
19-
default: 'LMDB'
20-
suite_overwrite:
21-
description: Specify regular expression for specific tests to be executed
22-
type: string
23-
default: ''
24-
25-
26-
schedule: # Schedule the job to run at 12 a.m. daily
27-
- cron: '0 0 * * *'
28-
29-
pull_request_target:
30-
paths-ignore:
31-
- "**/*.md"
32-
2+
on: workflow_call
333
jobs:
344

355
get_commits_to_benchmark:

.github/workflows/build.yml

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,5 @@
11
name: Build and Test
2-
on:
3-
push:
4-
# On push only local storage tests get executed
5-
tags: ["v**"]
6-
branches: ["master"]
7-
pull_request:
8-
# On pull requests only local storage tests get executed
9-
branches: ["**"]
10-
schedule:
11-
# IMPORTANT: For scheduled job we execute AWS_S3
12-
- cron: '0 6 * * 1,4' # Mon and Thu at 6 am
13-
workflow_dispatch:
14-
inputs:
15-
persistent_storage:
16-
description: Run the persistent storage tests?
17-
type: choice
18-
options:
19-
- 'no'
20-
- 'AWS_S3'
21-
- 'GCPXML'
22-
default: 'no'
23-
24-
pypi_publish:
25-
type: boolean
26-
publish_env:
27-
description: Environment to publish to
28-
type: environment
29-
cmake_preset_type:
30-
description: Override CMAKE preset type
31-
type: choice
32-
options: ["-", debug, release]
33-
dev_image_tag:
34-
description: Tag of the ArcticDB development image to use for the Linux C++ tests build
35-
type: string
36-
default: arcticdb-dev-clang:latest
37-
pytest_args:
38-
description: Rewrite what tests will run
39-
type: string
40-
default: ""
2+
on: workflow_call
413
run-name: Building ${{github.ref_name}} on ${{github.event_name}} by ${{github.actor}}
424
concurrency:
435
group: ${{github.ref}}

.github/workflows/build_with_conda.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
11
name: Build with conda
2-
on:
3-
push:
4-
branches:
5-
- master
6-
# For Pull-Requests, this runs the CI on merge commit
7-
# of HEAD with the target branch instead on HEAD, allowing
8-
# testing against potential new states which might have
9-
# been introduced in the target branch last commits.
10-
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
11-
pull_request:
12-
13-
workflow_dispatch:
14-
inputs:
15-
run_on_arm_mac:
16-
description: 'Run on arm macos'
17-
type: boolean
18-
required: false
19-
default: false
2+
on: workflow_call
203

214
jobs:
225

.github/workflows/static_analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
workflow_dispatch:
55
schedule:
66
- cron: "0 3 * * *"
7+
pull_request:
78

89
jobs:
910
polaris-scan:

cpp/arcticdb/version/local_versioned_engine.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,30 @@ VersionedItem LocalVersionedEngine::write_versioned_dataframe_internal(
723723
bool allow_sparse,
724724
bool validate_index
725725
) {
726+
727+
// =======================================================
728+
// INTENTIONAL ERROR
729+
std::vector<int> v(1000);
730+
for (int i = 0; i < 1000; i++) {
731+
v[i] = i;
732+
}
733+
std::vector v1 = std::move(v);
734+
for (size_t i = 0; i < v.size(); ++i) {
735+
std::cout<<v[i];
736+
v[i] = i;
737+
}
738+
739+
std::vector v2 = std::move(v1);
740+
for (auto i : v1) {
741+
std::cout<<i;
742+
}
743+
744+
volatile int* i = new int(0);
745+
delete i;
746+
volatile int a = *i;
747+
std::cout<<a<<" "<<*i<<std::endl;
748+
//========================================================
749+
726750
ARCTICDB_SAMPLE(WriteVersionedDataFrame, 0)
727751
py::gil_scoped_release release_gil;
728752
ARCTICDB_RUNTIME_DEBUG(log::version(), "Command: write_versioned_dataframe");

cpp/arcticdb/version/version_core.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,24 @@ VersionedItem compact_incomplete_impl(
19021902
ReadOptions{},
19031903
read_incomplete_flags
19041904
);
1905+
1906+
// =======================================================
1907+
// INTENTIONAL ERROR
1908+
std::vector v = {1, 2, 3, 4};
1909+
std::vector v1 = std::move(v);
1910+
for (auto i : v) {
1911+
std::cout<<i;
1912+
}
1913+
for (auto i : v1) {
1914+
std::cout<<i;
1915+
}
1916+
1917+
int* i = new int(0);
1918+
delete i;
1919+
std::cout<<*i<<std::endl;
1920+
//========================================================
1921+
1922+
19051923
user_input::check<ErrorCode::E_NO_STAGED_SEGMENTS>(
19061924
has_incomplete_segments,
19071925
"Finalizing staged data is not allowed with empty staging area"

0 commit comments

Comments
 (0)