Repository navigation
Close out #33: reduce_one() sanitizer crash, UBSan function-type reports, R-hub workflow - #34
Merged
Merged
Conversation
… workflow The reduce_one() crash R-hub's clang-asan/clang-ubsan checks hit in babelmixr2 (#33) is the shared first-path race fixed in #32; reproduced on 1.3.1-13 and clean on 1.3.1-14 under clang ASan/UBSan, both with the concurrent test and with rxode2's parallel CSE. - build_paths(): call new_VecZNode() before vec_add(); the n++ and the call were unsequenced, so gcc never used path1 and the concurrent test could only catch the race on clang. - lex.c/write_tables.c: hash/cmp callbacks take void* to match hash_fn_t/cmp_fn_t, silencing clang -fsanitize=function in mkdparse(). - .github/workflows/rhub.yaml: R-hub workflow with NOT_CRAN=true and a downstream rxode2 parallel CSE smoke test (.github/rhub/).
Clears the 4 CodeFactor undesirable-operator issues on #34.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33.
Is #33 fixed?
Yes, by #32 (the first reduction path moved off a process-wide static onto
reduce_one()'s stack). Verified locally with clang ASan+UBSan:dparse()test, 16 threadsparse.c:1397:57 … 0xbebebebebebebebethen SEGV (the issue's signature).rxOptExprC, 1–8 threads)Only clang builds ever used the shared vector. In
vec_add(paths, new_VecZNode(paths, ...))then++and the call were unsequenced, and gcc took a freshmalloc()ed path. That is why only R-hub's clang containers crashed.Changes
src/parse.c:build_paths()callsnew_VecZNode()beforevec_add(), so every compiler takes the same path. With only this change applied to the old static-path1code, the existing concurrent test now crashes it under gcc too.src/lex.c,src/write_tables.c: the hash/cmp callbacks takevoid *to matchhash_fn_t/cmp_fn_texactly. Clang's-fsanitize=functionreported "call to function through pointer to incorrect function type" frommkdparse(), which would fail R-hub's UBSan step..github/workflows/rhub.yaml(new, based on the r-hub v1 template):NOT_CRAN=trueso the concurrent test runs (it skips on CRAN);nlmixr2/rxode2and runs.github/rhub/rxode2-parallel-cse.R, failing on any sanitizer report;downstreaminput.NEWS.mdentries.Testing
main; after merging, runrhub::rhub_check(platforms = c("clang-asan", "clang-ubsan")).