HighResWallClockTimer assert can fail on MacOS (Debug mode)

Open
#1,073 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
performance

Research direction

Start with src/include/stir/HighResWallClockTimer.h around lines 252–272 and inspect the stop implementation, especially the microSecs type and the m_Secs assertion. Use the linked GitHub Actions failure and gettimeofday documentation to assess the type mismatch versus a backwards clock adjustment. Done means the MacOS debug timing path no longer triggers the assertion while preserving the reported elapsed time.

Written by the indexing model from the issue text.

Description

wontfix

for the first time ever, a job failed on this

https://github.com/UCL/STIR/actions/runs/3152842139/jobs/5128571067#step:8:22350

Assertion failed: (m_Secs >= 0), function stop, file /Users/runner/work/STIR/STIR/src/include/stir/HighResWallClockTimer.h, line 271

Relevant code is
https://github.com/UCL/STIR/blob/4142d5969e4320e32ed9dbe463b0fd50f36fb3f6/src/include/stir/HighResWallClockTimer.h#L252-L272

There seems to be 2 possible causes (see gettimeofday man page:

  • microSecs uses the wrong type (it should be suseconds_t, not int)
  • GHA runs a time service that adjusted its time backwards (unlikely)

Previous timings in that job are of the order of 0.006473s.

Dominant language
C++
Stars
160
Forks
113
Avg merge
12d 15h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UCL/STIR

All issues in UCL/STIR

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.