SIGSEGV in AnalysisPredictor::PreparePirProgram on Linux ARM64 (Docker/Apple Silicon)
status/new-issuetype/bug-report
### bug描述 Describe the Bug
SIGSEGV in AnalysisPredictor::PreparePirProgram on Linux ARM64 (Docker/Apple Silicon)
Environment:
* OS: Linux ARM64 (inside Docker on macOS Sequoia)
* Hardware: Apple M1/M2/M3 (ARM64)
* Versions: PaddlePaddle 3.0.0b2 through 3.2.2
* Python: 3.12-slim
Description:
A consistent segmentation fault occurs during PaddleOCR initialization when running on Linux ARM64 within a Docker container. The crash is triggered regardless of whether FLAGS_enable_pir_api=0 is set, suggesting the PIR path is being forced during predictor initialization.
C++ Traceback:
1 0 paddle_infer::Predictor::Predictor(paddle::AnalysisConfig const&)
2 1 paddle::AnalysisPredictor::Init(...)
3 2 paddle::AnalysisPredictor::PreparePirProgram()
4 3 paddle::AnalysisPredictor::SaveOrLoadPirParameters(bool)
5 4 std::filesystem::__cxx11::path::~path() <-- CRASH HERE
Steps to Reproduce:
1. Run a python:3.12-slim Docker container on an Apple Silicon Mac.
2. pip install paddlepaddle==3.2.2 paddleocr==3.4.1.
3. Initialize PaddleOCR(lang='en').
4. Observe SIGSEGV during the first call to ocr().
Suggested Fix:
The crash originates in paddle/fluid/inference/api/analysis_predictor.cc. It appears std::filesystem usage in
SaveOrLoadPirParameters is not thread-safe or has memory alignment issues on aarch64 Linux builds. Bypassing the PIR executor (downgrading to 2.6.2) resolves the issue, but the 3.x line remains unusable on ARM64 Docker.
### 其他补充信息 Additional Supplementary Information
_No response_
0 条评论