Ascend C Operator Hang/Crash Debugging
Systematically debug issues where Ascend C operators cannot finish running, including program hang/suspension, Kernel timeout, and program crash.
Quick Diagnosis
程序无法运行完
│
├─ 程序崩溃?
│ ├─ 启用 coredump → ulimit -c unlimited
│ ├─ 生成 core 文件 → 运行程序
│ └─ GDB 分析 → gdb <exe> <core> → bt / bt full / info locals
│
└─ 程序卡死?
├─ 查看 plog 日志 → 定位卡死位置
├─ 检查 Buffer 配对 → AllocTensor/FreeTensor
├─ 检查同步 → EnQue/DeQue 配对
└─ Kernel 调试 → AscendC::PRINTF / DumpTensor / msDebug
Symptom-Cause Quick Reference Table
| Symptom |
Possible Cause |
Diagnosis Direction |
| Program hang/timeout |
Buffer not released / deadlock |
Check AllocTensor/FreeTensor pairing, EnQue/DeQue pairing |
| Core timeout/hang |
Buffer conflict/deadlock |
Check Alloc / Free pairing |
| Segmentation Fault |
Null pointer dereference / memory out-of-bounds |
GDB analyze coredump -> bt to view call stack |
| Abort |
Assertion failure / abnormal termination |
GDB analyze coredump -> check assertion condition |
| Stack overflow |
Recursion too deep / large array |
Check array size within Kernel |
| aic error |
Memory access out-of-bounds / unaligned access |
Check DataCopy length, 32B alignment |
| AIV hang |
Missing cross-core synchronization |
Check CrossCoreWaitFlag corresponding SetFlag |
| drain hang |
AIV->AIC flag not sent |
Check flag sending chain |
Enter detailed process by scenario
Detailed Resources