Closed nirosys closed 1 year ago
Build checks failed due a couple issues. One where gtest isn't linking, which doesn't reproduce on my system. Another is cmake acting like it hasn't known what C++17 is since 3.8.. continuing to dig.
The unit test crash that is occurring with the amazonlinux:1 gcc72 build isn't reliably reproducible locally. The most recent commit should address the memleak that was identified by the ubuntu clang build, but I'm not sure if it is related. Will continue digging if not.
Ok. I've reproduced the crash that GHA is seeing, and it's pretty awesome. /s
All of my attempts to reproduce the issue failed. I combed through the package versions, and made sure the docker digest SHA reported by GitHub matched the image I was using locally. Everything lined up but for some reason the issue would not reproduce. Until I piped the output of act, into tee
so I could grep through the output to make sure there wasn't any pointers in the haystack of warnings ion-c produces. As soon as the job ran with this new pipe, it crashed with the same error GHA produces.
I was also able to reproduce the issue by simply redirecting the output of the unit tests into a file, which made it possible to easily run it under gdb. I had known from the output of the GHA crash that the issue was triggering in the test_ion_decimal.cpp tests, specifically WriteAllValues
, but had no reason to see an issue. Debugging without the redirect showed the values within the function to be sane, and no error occurred during the free.
With the redirect, I'm guessing some things have shifted on the stack, and the uninitialized ion_decimal
defined within the WriteAllValues test ends up lining up with data that makes the ION_DECIMAL
's type
field contain the value for ION_DECIMAL_TYPE_NUMBER
. This results in the only code path that tries to free the decimal's value.num_value
buffer, which is also initialized with random stack data and cannot be free'd.
Putting this into review. There may be an issue with ion-test-drivers, I'm still looking into that, but this PR should be good to start moving forward.
Thank you! I'm going to push up a new commit with the commented code, and typos, fixed, and output added. Then get I'll this merged. Then PR the regression workflow, and follow up with the code changes discussed above. Unless anyone has an argument against that.
Issue #, if available:
Description of changes:
Changes to the Build
Google Test
This PR changes the googletest usage a little. This was primarily to support google-benchmark's googletest dependency, but resulted in further adjustments to supply users with the ability to:
gtest_main
target is available, and the ion-c build will disable its own import.IONC_BUILD_TEST
flagoff
in order to stop the ion-c build from building ion-c unit tests.Build Type: Profiling
This PR's primary purpose is to add a new CLI to allow for benchmarking for performance baselining, analysis, and improvement quantification. In order to produce builds where we have optimized builds, but still have enough debug information to generate flame graphs, and use profilers effectively a new build type was added to do just that. Rather than building with
-DCMAKE_BUILD_TYPE=Release
, a user can now use-DCMAKE_BUILD_TYPE=Profiling
and cmake will produce a build that has debug information and optimization passes.Addition of IonCBench
The primary purpose of this PR is to add the ion-c benchmark CLI. In order to build this tool the user can set the CMake variable
IONC_BENCHMARKING_ENABLED
toON
. This is done by default when using theProfiling
build type. The tool is intended to provide a similar set of features to the other benchmark CLIs found for ion-java, and ion-python.Currently, the tool allows the user to provide their own data, and perform both full deserialization and full serialization of that data using ion-c (in text mode, or binary), MsgPack (MsgPack-C), JSON (yyjson, and json-c), and CBOR (libcbor).
This PR is the first iteration of the ion-bench tool, and provides functionality for measuring CPU time, and other CPU metrics such as instruction counts (as long as it is built with libpfm). The tool currently supports a single benchmark run per invocation. Each benchmark run requires an input dataset, a specified supported implementation, and the requested benchmark to run. Currently the tool supports two benchmarks:
In both benchmarks timing does not include the IO to get the input dataset into memory.
The expectation is that more benchmarks will be added, along with more format implementations, in order to compare runtime, memory usage, and data size, between ion and other data formats.
Usage
The tool has a
--help
which has a list of all of the arguments that can be used:By default, output will be presented in a tabular format.
Since the tool leans very heavily on google-benchmark, all google-benchmark arguments are also supported:
Changes Since Original Post
image
defines the container, or VM Image (runs-on), that the job uses, andtoolchain
defines whether to use gcc, or clang (currently).Fixed an uninitialized data issue in one of the ion_decimal unit tests.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.