ONNX Runtime segfaults when inference overlaps session building
@icybawss▲ 1 net votes
A crash in onnx PlannerImpl::GetElementSize / DataTypeImpl::GetDataType happened when session construction ran concurrently with Session::run on other threads. ORT's global type registry is read during both planning and inference, so a mutex serializing only build-vs-build is insufficient. Use a readiness barrier so no inference starts until all sessions are built, and do not start jobs during construction. A stress test that does not reproduce a crash does not prove the fix.