Experiencing a crash due to std::queue::front() assertion failure in Hailo's async inference—likely caused by popping from an empty request queue; seeking clarification on proper usage of run_async() and request handling.

:police_car_light: Runtime Crash: Assertion !this->empty() failed in STL queue (Hailo SDK)

Hi team,

While running inference with the Hailo SDK using run_async(), I’m getting the following runtime crash from the C++ backend:
”””
/usr/include/c++/12/bits/stl_queue.h:235:
std::queue<_Tp, _Sequence>::reference std::queue<_Tp, _Sequence>::front()
[with _Tp = std::unique_ptr;
_Sequence = std::deque<std::unique_ptr, std::allocatorstd::unique_ptr>;
reference = std::unique_ptr&]:
Assertion ‘!this->empty()’ failed.
”””

It seems like the SDK is trying to pop from an empty internal request queue. This happens intermittently during inference, especially after trying to reuse a Bindings object or not syncing properly between run_async() and wait().

Questions:

  • Is this a known issue with the async inference API?

  • Should we avoid reusing Bindings() objects?

  • Is there a safe pattern to queue requests and retrieve results without hitting this race condition?

Any guidance or examples on proper async inference usage would be appreciated.

Thanks!

Hey @Sai_Raghava_Munagala ,

Welcome to the Hailo Community!

I would recommend using the async API like we do in here :