ci(alloc-locality): the gate cannot fail when run locally on macOS
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with the alloc-locality job and the step "Reject malloc/calloc/realloc/free outside src/userApi/" in .github/workflows/ci.yml, and reproduce the bug by planting a free( call in src/ and running the git grep command locally on macOS. Replace the \b pattern with git grep -nP or an explicit boundary, and add a planted-violation self-test modeled on the other gates. Done when the gate fails on a planted violation on macOS and still passes on the clean tree on Linux CI.
Written by the indexing model from the issue text.
Description
Problem
The alloc-locality job in .github/workflows/ci.yml (step "Reject malloc/calloc/realloc/free outside src/userApi/") searches with
git grep -nE '\b(malloc|calloc|realloc|free)\s*\(' -- 'src/' 'test/' ...
On macOS (Apple Git 2.54, BSD regex), -E does not treat \b as a word boundary, so the pattern never matches. A local run of the job's script passes even with a planted free( in src/. On the Linux CI runner (GNU regex) the gate works as intended, so CI itself is not affected.
Reproduction (macOS)
mkdir -p src && printf 'void f(void){ free(p); }\n' > src/a.c
git init -q && git add -A && git -c commit.gpgsign=false commit -qm x
git grep -nE '\b(malloc|calloc|realloc|free)\s*\(' -- src/ # no match, rc=1
git grep -nP '\b(malloc|calloc|realloc|free)\s*\(' -- src/ # match, rc=0
Why it matters
Contributors run the CI gates locally (e.g. in a git copy) before pushing. For this gate a local "green" proves nothing on macOS.
Suggested fix
Use a portable pattern, e.g. git grep -nP (PCRE, same meaning on both platforms), or replace \b with an explicit boundary such as (^|[^A-Za-z0-9_])(malloc|calloc|realloc|free)[[:space:]]*\(. Add a planted-violation self-test like the other gates have, so the gate proves it can fail.
Out of scope: changing what the gate allows or forbids.
- Dominant language
- C
- Stars
- 1
- Forks
- 3
- Avg merge
- 8h 35m
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from es-ude/OnDeviceTraining
-
requantSymInt32TensorToScale can emit qMin - 1 under SR (no integer clamp after rounding)Possibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
es-ude/OnDeviceTraining#511 ·
Maintainers usually reply within 1 day
-
SR_HALF_AWAY rounds exact negative/zero ties down by one (u == 0 bias in roundSRHalfAway)Possibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
es-ude/OnDeviceTraining#510 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
es-ude/OnDeviceTraining#479 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
es-ude/OnDeviceTraining#478 ·
Maintainers usually reply within 1 day
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
es-ude/OnDeviceTraining#459 ·
Maintainers usually reply within 1 day
All issues in es-ude/OnDeviceTraining
Similar issues
-
documentation severity: low
Difficulty 1/5 Under an hour Newbie friendliness 88/100
luainkernel/lunatik#2231 ·
Maintainers usually reply within 1 day
-
Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
trezor/trezor-firmware#8210 ·
Maintainers usually reply within 3 days
-
area:storage documentation status:parked
Difficulty 1/5 Under an hour Newbie friendliness 88/100
nextbsd/nextbsd-userland#519 ·
Maintainers usually reply within 1 day
-
bug system: adam
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
FujiNetWIFI/fujinet-config#358 ·
Maintainers usually reply within 1 day