Skip to content

Commit ff402a8

Browse files
Disassemble GcCensus's main on macOS (diagnostic)
1 parent 380ce1a commit ff402a8

1 file changed

Lines changed: 17 additions & 29 deletions

File tree

‎.github/workflows/diag.yml‎

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: diag
2-
# Throwaway: runs the census test with the stack scan traced, on macOS only
2+
# Throwaway: why GcCensus misses a local array on macOS (libhxcpp #269)
33
on:
44
push:
55
branches: ['diag/**']
@@ -18,33 +18,21 @@ jobs:
1818
- uses: ./.github/workflows/setup
1919
with:
2020
haxe: 4.3.7
21-
- name: probe executable memory
22-
working-directory: test/diag
23-
run: cc -O1 -o rwx rwx.c && ./rwx
24-
- name: build
25-
working-directory: test/diag
21+
- name: build the regression test with symbols
22+
working-directory: test/regression/GcCensus
23+
run: haxe build.hxml -D ${{ matrix.os == 'macos-latest' && 'HXCPP_ARM64' || 'HXCPP_M64' }} -D HXCPP_DEBUG_LINK
24+
- name: run it
25+
working-directory: test/regression/GcCensus
2626
run: |
27-
haxe -m Main --cpp bin -D ${{ matrix.os == 'macos-latest' && 'HXCPP_ARM64' || 'HXCPP_M64' }} -D HXCPP_DEBUG_LINK
28-
haxe -m Main --cpp bin-robust -D ${{ matrix.os == 'macos-latest' && 'HXCPP_ARM64' || 'HXCPP_M64' }} -D HXCPP_DEBUG_LINK -D HX_DIAG_ROBUST_CAPTURE
29-
- name: disassemble CaptureX64
30-
if: matrix.os == 'macos-15-intel'
31-
working-directory: test/diag
32-
run: otool -tV bin/Main -p __ZN2hx10CaptureX64ERNS_21RegisterCaptureBufferE | sed -n "1,40p" || true
33-
- name: run each 20 times
34-
working-directory: test/diag
35-
run: |
36-
for b in bin bin-robust; do
37-
bad=0
38-
for i in $(seq 1 20); do
39-
$b/Main > out.txt 2>/dev/null || true
40-
grep -q 'is missing a class' out.txt && bad=$((bad+1))
41-
done
42-
echo "$b: census missed a class in $bad of 20 runs"
43-
grep 'after reuse' out.txt
44-
done
45-
- name: trace one run
46-
working-directory: test/diag
47-
run: |
48-
HX_CENSUS_TRACE=1 bin/Main > out.txt 2> trace.txt || true
27+
bin/Main > out.txt 2>/dev/null || true
4928
cat out.txt
50-
grep -E 'DIAG (main frame|keep|scan)' trace.txt
29+
HX_CENSUS_TRACE=1 bin/Main > /dev/null 2> trace.txt || true
30+
echo "trace:"
31+
cat trace.txt | head -120
32+
- name: disassemble Main.main
33+
working-directory: test/regression/GcCensus
34+
run: |
35+
otool -tV bin/Main -p __ZN8Main_obj4mainEv | awk 'NR>2 && /^__Z/ && !/^__ZN8Main_obj4mainEv/ {exit} {print}'
36+
- name: generated source
37+
working-directory: test/regression/GcCensus
38+
run: sed -n '/void Main_obj::main()/,/^}/p' bin/src/Main.cpp

0 commit comments

Comments
 (0)