Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

progress_indicator_base::refresh_impl::m_firstSample used uninitialized #177

Open
freekvw opened this issue Apr 1, 2015 · 1 comment
Open

Comments

@freekvw
Copy link
Collaborator

freekvw commented Apr 1, 2015

Running tpie/test/unit/ut-internal_priority_queue basic fails on my machine with:

../tpie/tpie/progress_indicator_base.cpp line 38: Assertion failed:
../tpie/tpie/progress_indicator_base.cpp line 38: ptime::seconds: Special ptime
Assertion (false) failed ../tpie/tpie/progress_indicator_base.cpp:38: ptime::seconds: Special ptime

What appears to happen is that:

  • A progress_indicator_base is constructed, setting m_current to 0 and range to 2.
  • step() is called twice.
  • In the second step() call, step >= m_remainingSteps (both == 1), causing call_refresh() to be called.
  • Since m_current is now 2, impl->m_firstSample is not initialized.
  • ptime::seconds() fails.

Apparently call_refresh() is expected to have been called at a moment when m_current is still 0, but this doesn't happen.

@SSoelvsten
Copy link
Contributor

SSoelvsten commented Jul 27, 2022

I have not seen this unit test fail on any machine, operating system or compiler with the current version. I cannot seem to find a commit that tried to fix this, but maybe this issue is out-of-date?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants