Fixed SIGSEGV
This commit is contained in:
1 parent
f03882d3f4
commit
5b0019d50d
50 files changed
+1565
-821
No files matched your search
@@ -109,10 +109,10 @@ $(document).ready(function(){initNavTree('md_tests_2README.html',''); initResiza
|
||||
<div class="line"> DBC_CORE_BUILD_DIR=/absolute/path/to/build/core</div>
|
||||
<div class="line">make</div>
|
||||
<div class="line">make check</div>
|
||||
</div><!-- fragment --><p><code>parser_tests.pri</code> and <code>decoder_tests.pri</code> include the original test sources; <code>tests.pro</code> also includes <code><a class="el" href="dbc__coverage__test_8cpp_source.html">dbc_coverage_test.cpp</a></code>, <code><a class="el" href="dbc__lifetime__test_8cpp_source.html">dbc_lifetime_test.cpp</a></code>, <code><a class="el" href="dbc__validation__test_8cpp_source.html">dbc_validation_test.cpp</a></code>, and <code><a class="el" href="dbc__pipeline__test_8cpp_source.html">dbc_pipeline_test.cpp</a></code>. <code>../core/core.pri</code> supplies the library include path and linkage.</p>
|
||||
</div><!-- fragment --><p><code>parser_tests.pri</code> includes <code><a class="el" href="dbc__parser__test_8cpp_source.html">dbc_parser_test.cpp</a></code> and <code><a class="el" href="dbc__statement__test_8cpp_source.html">dbc_statement_test.cpp</a></code>; <code>decoder_tests.pri</code> includes the decoder test source; <code>tests.pro</code> also includes <code><a class="el" href="dbc__coverage__test_8cpp_source.html">dbc_coverage_test.cpp</a></code>, <code><a class="el" href="dbc__lifetime__test_8cpp_source.html">dbc_lifetime_test.cpp</a></code>, <code><a class="el" href="dbc__validation__test_8cpp_source.html">dbc_validation_test.cpp</a></code>, and <code><a class="el" href="dbc__pipeline__test_8cpp_source.html">dbc_pipeline_test.cpp</a></code>. <code>../core/core.pri</code> supplies the library include path and linkage.</p>
|
||||
<h1><a class="anchor" id="autotoc_md161"></a>
|
||||
Local regression checks</h1>
|
||||
<p><code>run_core_ci.sh</code> builds the core archive, runs all six QtTest suites and the qmake tree target with <code>make check</code>, then compiles and runs the standalone C++17 tree/builder test without Qt. A failed command returns a nonzero status. The <code>sanitize</code> mode applies ASan/UBSan flags to core, tests, and the standalone executable, with leak detection enabled by default and sanitizer errors fatal. The optional adapter is not built. No automatic CI workflow is configured.</p>
|
||||
<p><code>run_core_ci.sh</code> builds the core archive, runs all seven QtTest suites and the qmake tree target with <code>make check</code>, then compiles and runs the standalone C++17 tree/builder test without Qt. A failed command returns a nonzero status. The <code>sanitize</code> mode applies ASan/UBSan flags to core, tests, and the standalone executable, with leak detection enabled by default and sanitizer errors fatal. The optional adapter is not built. No automatic CI workflow is configured.</p>
|
||||
<p>From the repository root, with Qt 6.8.2 available:</p>
|
||||
<div class="fragment"><div class="line">bash tests/run_core_ci.sh release</div>
|
||||
<div class="line">bash tests/run_core_ci.sh sanitize</div>
|
||||
@@ -160,15 +160,20 @@ Attribute coverage</h1>
|
||||
<p>Parser slots <code>attributes</code>, <code>invalidAttributes</code>, and <code>attributeWarnings</code> cover all five scopes and types, deferred definitions/defaults/targets, explicit values overriding defaults, repeated assignments, escaped strings, typed range/scope errors, duplicate definitions/defaults, unknown attributes and missing targets. They check source diagnostics and the throwing API, distinct standard/extended targets, frame cycle times and enum labels, unsupported formats and ID conflicts, unchanged J1939 opt-in, and runtime/tree propagation. Existing unsupported-statement checks now use relation forms, which remain unsupported, instead of supported attribute forms.</p>
|
||||
<p>Attribute changes were verified with <code>qmake6 ../dbc.pro</code>, <code>make -j4</code>, and <code>make check</code> in <code>build/</code>: all six QtTest suites and the qmake tree target passed. The standalone C++17 tree test also passed. The existing named comma-decimal C locale test skipped because the locale is not installed.</p>
|
||||
<h1><a class="anchor" id="autotoc_md170"></a>
|
||||
Long value descriptions and multiplex ranges</h1>
|
||||
<p><code><a class="el" href="dbc__statement__test_8cpp_source.html">dbc_statement_test.cpp</a></code> adds a separate <code>StatementParserTest</code> suite to the existing parser qmake source list and the main test runner. Both parser APIs are checked with 50,000-character descriptions (including quotes, backslashes, semicolons, and spaces), 10,000 <code>VAL_</code> pairs, 10,000 multiplex ranges, and long numeric bounds and whitespace. Valid metadata must survive parsing without truncation, support value-description lookup after decoding, and activate or skip multiplex branches correctly. Statements may precede or follow definitions.</p>
|
||||
<p>Malformed long statements cover incomplete quotes/escapes, invalid escapes, missing separators and semicolons, duplicate keys, numeric overflow, empty and reversed ranges, trailing text, and unresolved long names. The diagnostic API must return an empty database with the correct category, path, and source line; the throwing API must report that same location.</p>
|
||||
<p>Verified with Qt 6.8.2 in separate Release and ASan/UBSan builds with <code>CONFIG+=dbc_qt</code>: each passed 2,449 core QtTest checks (including 29 checks in the new suite), seven model checks, and the qmake tree test. One named-locale case skipped because the locale is unavailable. Sanitizer errors were fatal; local leak checking used <code>detect_leaks=0</code> because of the documented ptrace restriction.</p>
|
||||
<h1><a class="anchor" id="autotoc_md171"></a>
|
||||
Unsupported signal value types</h1>
|
||||
<p><code>unsupportedSignalValueTypes</code> verifies that both parser APIs reject <code>SIG_VALTYPE_</code> declarations with <code>UnsupportedSignalType</code>, the original file path and physical line, and an empty database. Cases include float32/float64, declarations before signal definitions, extended IDs, tabs/CRLF, no final newline, type 0, unknown types, and malformed declarations. Prior warnings are retained; <code>SIG_VALTYPE_</code> symbols inside <code>NS_</code> lists remain quiet.</p>
|
||||
<p>The pipeline suite checks the IEEE 754 bytes for float32 and float64 <code>1.0</code>. Adding a type declaration must prevent publication of an integer definition, so building from the error result cannot produce a valid decoded signal. The same payloads still decode to exact integers when defined only by supported <code>SG_</code> statements. New cases are included in the existing qmake targets.</p>
|
||||
<p>Verified with Qt 6.8.2 in separate Release and ASan/UBSan builds with <code>CONFIG+=dbc_qt</code>: each passed 2,420 core QtTest checks, seven model checks, and the qmake tree test. One named-locale case skipped because its locale is unavailable. ASan/UBSan used fatal errors and <code>detect_leaks=0</code> because of the previously documented ptrace restriction. The separately built demo was checked with float32 and float64 declarations (exit 2, source-located error, no decode output), a supported integer definition (exit 0), and an unknown extension (exit 0 with a visible warning).</p>
|
||||
<h1><a class="anchor" id="autotoc_md171"></a>
|
||||
<h1><a class="anchor" id="autotoc_md172"></a>
|
||||
Long signal definitions</h1>
|
||||
<p><code>longSignalDefinitions</code> reproduces the former stack overflow with a 50,000-character unit string. Both parser APIs are exercised with long units, signal names, receivers, decimal numbers, and a list of 10,001 receivers. Valid input must parse without truncating units; malformed input (including missing quotes, delimiters, receiver separators, numeric suffixes, overflow, and trailing receiver commas) must return an empty database and an <code>InvalidStatement</code> diagnostic at the signal's source line, or throw a source-located error through <code>ParseFile()</code>. These cases run as part of the existing parser target and sanitizer builds.</p>
|
||||
<p>Verified with Qt 6.8.2 in separate Release and ASan/UBSan builds, both with <code>CONFIG+=dbc_qt</code>: <code>make check</code> passed 2,409 core QtTest checks, seven model checks, and the qmake tree test in each build. The named comma-decimal C locale test skipped because the required locale is not installed. The sanitizer run used <code>ASAN_OPTIONS=detect_leaks=0:halt_on_error=1</code> and <code>UBSAN_OPTIONS=halt_on_error=1</code>; address and undefined-behavior checks passed, while leak checking was disabled because of the environment's previously documented ptrace restriction.</p>
|
||||
<h1><a class="anchor" id="autotoc_md172"></a>
|
||||
<h1><a class="anchor" id="autotoc_md173"></a>
|
||||
Extended validation</h1>
|
||||
<p><code>attributeNumbers</code> checks signed 64-bit limits, leading plus signs, decimal HEX values, FLOAT fractions/exponents, and default overrides under a comma-decimal C++ locale. Node/environment defaults remain on definitions without becoming database attributes. <code>invalidAttributeNumbers</code> supplies 39 data rows, each checked in both definition bounds, a default, and an explicit assignment. The throwing and diagnostic APIs must reject malformed signs, trailing text, hexadecimal notation, non-finite values, overflow, and underflow with the correct error line. Additional malformed-attribute cases cover token separators, scope/type names, reversed FLOAT bounds, value types/ranges, and invalid CAN references.</p>
|
||||
<p>Run AddressSanitizer and UndefinedBehaviorSanitizer in a separate directory:</p>
|
||||
|
||||
Reference in new issue
Block a user