bcgsc / btllib

Bioinformatics Technology Lab common code library
Other
23 stars 5 forks source link

Deadlock on 32bit architectures #80

Closed vpa1977 closed 1 year ago

vpa1977 commented 1 year ago

'orderder_queue.hpp' defines ORDER_QUEUE_XPXC(MPSC with the additional wait condition (num - target.last_tenant <= this->queue_size).

num is uint64_t and the rest of the variables are size_t. target.last_tenant is initialised to -1. On 64 bit architectures this condition evaluates to true due to the integer overflow. On 32 bit architectures size_t is 32 bits and overflow does not happen, resulting in always false wait condition.

The causes the queue to wait indefinitely and self-tests to fail [1].

[1] https://launchpadlibrarian.net/655111080/buildlog_ubuntu-lunar-armhf.btllib_1.4.10+dfsg-1ubuntu2~ppa2_BUILDING.txt.gz