Skip to content

Commit d7e44f0

Browse files
committed
executorch: TEMP add gdb backtrace capture to diagnose cpuinfo abort
Restrict the matrix to cp312 only, keep debug symbols (CFLAGS/CXXFLAGS=-g and CMAKE_ARGS=-DCMAKE_BUILD_TYPE=RelWithDebInfo, matching build-tesserocr.yml's precedent), install gdb, and run the smoke test under gdb to capture a native backtrace of the deterministic cpuinfo_get_uarch abort. To be reset once the backtrace is read.
1 parent 10db2ac commit d7e44f0

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

‎.github/workflows/build-executorch.yml‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ jobs:
5252
# cp310/cp311 are dropped: torch and pytorch-tokenizers (both hard runtime
5353
# deps) have no riscv64 wheel for either on pypi.riseproject.dev. cp314t
5454
# is dropped too: upstream itself ships no free-threaded wheel.
55-
python: ["cp312", "cp313", "cp314"]
55+
# TEMP: restricted to cp312 only while diagnosing the cpuinfo abort
56+
# under gdb (gotcha 115) - restore ["cp312", "cp313", "cp314"] once done.
57+
python: ["cp312"]
5658
name: Build executorch ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64
5759
runs-on: ubuntu-24.04-riscv
5860
timeout-minutes: 720
@@ -183,9 +185,17 @@ jobs:
183185
pip install "cmake>=3.24,<4.0.0" "packaging>=24.2" pyyaml
184186
"setuptools>=77.0.3" wheel zstd certifi &&
185187
pip install --only-binary=:all: "torch==2.13.0"
188+
# TEMP diagnostic (gotcha 115): keep debug symbols so gdb's backtrace
189+
# resolves symbols instead of bare addresses. setup.py's get_build_type()
190+
# only offers Debug/Release via $DEBUG, but appends $CMAKE_ARGS after its
191+
# own -DCMAKE_BUILD_TYPE flag, so CMAKE_ARGS wins (RelWithDebInfo matches
192+
# this repo's own precedent in build-tesserocr.yml, and keeps optimizations
193+
# on so the crash still reproduces the same way as the real release build).
186194
CIBW_ENVIRONMENT: >-
187195
CMAKE_BUILD_PARALLEL_LEVEL=8
188196
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
197+
CFLAGS=-g CXXFLAGS=-g
198+
CMAKE_ARGS=-DCMAKE_BUILD_TYPE=RelWithDebInfo
189199
# The torch wheel already carries these and loads them RTLD_GLOBAL (gotcha 17).
190200
CIBW_REPAIR_WHEEL_COMMAND: >-
191201
auditwheel repair -w {dest_dir} {wheel}
@@ -202,7 +212,25 @@ jobs:
202212
# a newer torch than the extension was actually compiled against.
203213
CIBW_TEST_REQUIRES: torch==2.13.0
204214
CIBW_TEST_SOURCES: riscv64_smoke_test.py
205-
CIBW_TEST_COMMAND: python riscv64_smoke_test.py
215+
# TEMP diagnostic (gotcha 115): gdb works on the real riscv64 runner
216+
# (not under QEMU). The abort is 100% deterministic across all 3
217+
# python legs already observed, so a single gdb run is enough - no
218+
# retry loop needed. Fail the step either way so the log is easy to
219+
# spot: once with the backtrace if the abort reproduces, once with a
220+
# clear "did not reproduce" message otherwise.
221+
CIBW_BEFORE_TEST_LINUX: dnf -y install gdb
222+
CIBW_TEST_COMMAND: >-
223+
gdb -batch -ex run -ex "thread apply all bt 25" --args python riscv64_smoke_test.py
224+
> /tmp/gdb-backtrace.log 2>&1;
225+
gdb_status=$?;
226+
cat /tmp/gdb-backtrace.log;
227+
echo "gdb exit status: $gdb_status";
228+
if grep -qE "SIGABRT|Aborted" /tmp/gdb-backtrace.log;
229+
then echo "=== crash reproduced under gdb (backtrace above) ===";
230+
exit 1;
231+
else echo "=== SIGABRT/Aborted NOT found - crash did not reproduce under gdb ===";
232+
exit 1;
233+
fi
206234
207235
- name: Check the extensions and the vendored licences made it into the wheel
208236
run: |

0 commit comments

Comments
 (0)