apollo icon indicating copy to clipboard operation
apollo copied to clipboard

BoundedQueue::Size() Interface read error

Open ayongsir opened this issue 2 years ago • 1 comments

Describe the bug A clear and concise description of what the bug is.

I used BoundedQueue in multithreading and found an exception reading Size() during testing; The task queue I set is 500, But the size I read is unusually large: 18446744073709551614; It should be caused by a negative number in unsigned number subtraction: template <typename T> inline uint64_t BoundedQueue<T>::Size() { return tail_ - head_ - 1; }

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

ayongsir avatar Oct 24 '23 08:10 ayongsir

Screenshot from 2023-10-24 10-37-51

ayongsir avatar Oct 24 '23 08:10 ayongsir