Skip to content

fix use-after-free due to race condition with ASAN enabled #811

fix use-after-free due to race condition with ASAN enabled

fix use-after-free due to race condition with ASAN enabled #811

Workflow file for this run

name: check
on:
push:
branches:
- main
pull_request:
jobs:
sanitizer-check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: install
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: moon version
run: |
moon version --all
moonrun --version
- name: disable mimalloc
run: |
echo "" >dummy_libmoonbitrun.c
gcc dummy_libmoonbitrun.c -c -o ~/.moon/lib/libmoonbitrun.o
- name: setup sanitizer check
run: |
for f in $(find src -name "moon.pkg.json" -not -wholename "src/internal/*" -print); do
content_except_first_brace=$(cat $f | tail -c +2)
(
echo -e -n '{\n "link": { "native": { "cc-flags": "-g -fsanitize=address -fno-omit-frame-pointer" }},'
printf "%s\n" "$content_except_first_brace"
) >$f
done
- name: run test with address sanitizer
run: |
export ASAN_OPTIONS=fast_unwind_on_malloc=0
for i in $(seq 1 50); do
moon test
done