Skip to content

Core add timer base min - #2

Open
jamacku wants to merge 3 commits into
mainfrom
core-add-TIMER_BASE_MIN
Open

Core add timer base min#2
jamacku wants to merge 3 commits into
mainfrom
core-add-TIMER_BASE_MIN

Conversation

@jamacku

@jamacku jamacku commented Feb 27, 2026

Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Buddy - CI Failure Analysis

Important

This analysis was generated by AI and may not be fully accurate. Please review the suggestions critically before applying any changes.

馃煝 Confidence: high

Multiple build jobs are failing during compilation because the extern declaration for timer_vtable was removed from src/core/timer.h. This causes an 'undeclared identifier' error in src/core/unit.c, which still uses this variable. Other unrelated build and CodeQL analysis failures appear to be caused by a missing bpftool in the CI environment.

Comment thread src/core/timer.h Outdated
@github-actions

github-actions Bot commented Feb 27, 2026

Copy link
Copy Markdown

Commit validation

Tracker - RHEL-155454

The following commits meet all requirements

commit upstream
0a0d690 - _Add TIMER_BASE_MIN to TimerBase enum rhel-only: doc
12b62b6 - Fix logo image formatting in README.md rhel-only: policy
2cc1e5e - Apply suggestions from code review rhel-only: ci

Tracker validation

馃敶 Tracker 'RHEL-155454' does not exist on https://redhat.atlassian.net


Pull Request validation

Failed

馃敶 Failed or pending checks:

  • Fuzzing[skipped]
  • triage[skipped]
  • Analyze (python)[failure]
  • Analyze (cpp)[failure]
  • ci (centos, 10, address,undefined, 1, -Og, yes, 0, sanitizers)[failure]

馃敶 Review - Missing review from a member (1 required)


Triggered by Workflow Run

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Buddy - CI Failure Analysis

[!IMPORTANT]\n> This analysis was generated by AI and may not be fully accurate. Please review the suggestions critically before applying any changes.

馃煝 Confidence: high

The CI failures are not caused by the code changes in this pull request. All build jobs (GCC, Clang, CodeQL C++) are failing during the Meson configuration step with the error Command /usr/sbin/bpftool --version failed, which indicates bpftool is missing or misconfigured in the CI runner environment. While unrelated to these failures, a semantic bug was found in the code changes.

Comment thread src/core/timer.h
TIMER_CALENDAR,
_TIMER_BASE_MAX,
_TIMER_BASE_MIN,
_TIMER_BASE_INVALID = -EINVAL,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While unrelated to the current CI failures (which appear to be an environmental issue), this change introduces a semantic bug. By adding _TIMER_BASE_MIN after _TIMER_BASE_MAX, its value will be greater than _TIMER_BASE_MAX, which will break any logic that relies on a MIN < MAX ordering.

If this is intended to define the minimum value, it should be placed at the beginning of the enum. If it serves another purpose, it should be renamed to avoid confusion.

Suggested change
_TIMER_BASE_INVALID = -EINVAL,
_TIMER_BASE_MAX,

Please remove this line and re-introduce it in the correct location at the top of the enum if it's needed.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Buddy - CI Failure Analysis

[!IMPORTANT]\n> This analysis was generated by AI and may not be fully accurate. Please review the suggestions critically before applying any changes.

馃煝 Confidence: high

Multiple build jobs are failing due to a CI environment issue (missing bpftool), which appears unrelated to the code changes. However, the mkosi integration test job shows an AddressSanitizer failure (stack-buffer-underflow). This memory error is very likely caused by the incorrect ordering of enum members in src/core/timer.h, where _TIMER_BASE_MIN is defined after _TIMER_BASE_MAX, resulting in _TIMER_BASE_MIN > _TIMER_BASE_MAX.

Comment thread src/core/timer.h
TIMER_CALENDAR,
_TIMER_BASE_MAX,
_TIMER_BASE_MIN,
_TIMER_BASE_INVALID = -EINVAL,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mkosi integration test job is failing with an AddressSanitizer stack-buffer-underflow error, which is very likely caused by this change.

By adding _TIMER_BASE_MIN after _TIMER_BASE_MAX, their values become _TIMER_BASE_MAX = 2 and _TIMER_BASE_MIN = 3. This violates the common MIN <= MAX invariant and is likely causing out-of-bounds memory access in code that uses this enum.

Please reorder these members to ensure _TIMER_BASE_MIN has a smaller value than _TIMER_BASE_MAX.

Suggested change
_TIMER_BASE_INVALID = -EINVAL,
_TIMER_BASE_MIN,
_TIMER_BASE_MAX,

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Buddy - CI Failure Analysis

[!IMPORTANT]\n> This analysis was generated by AI and may not be fully accurate. Please review the suggestions critically before applying any changes.

馃煛 Confidence: medium

Most build jobs are failing during the configuration phase due to a bpftool version check. This appears to be a CI environment issue unrelated to the code changes. However, the mkosi integration test, which did build successfully, failed with sanitizer errors. A logic error in the modified TimerBase enum in src/core/timer.h is a likely cause of these test failures, as it breaks the convention for _MIN and _MAX enum sentinels.

Comment thread src/core/timer.h
TIMER_CALENDAR,
_TIMER_BASE_MAX,
_TIMER_BASE_MIN,
_TIMER_BASE_INVALID = -EINVAL,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds _TIMER_BASE_MIN after _TIMER_BASE_MAX, which is incorrect and breaks the logic of the enum. Conventionally, _MAX is the last item and its automatically-assigned value is used as a count of the preceding items. With this change, _TIMER_BASE_MAX has a value of 2, while _TIMER_BASE_MIN has a value of 3.

This will break any code that uses _TIMER_BASE_MAX for array sizing or loop bounds, potentially leading to out-of-bounds access, which could explain the sanitizer errors seen in other CI jobs. Please reorder these members.

Suggested change
_TIMER_BASE_INVALID = -EINVAL,
_TIMER_BASE_MIN,
TIMER_UNIT_INACTIVE,
TIMER_CALENDAR,
_TIMER_BASE_MAX,

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Buddy - CI Failure Analysis

[!IMPORTANT]\n> This analysis was generated by AI and may not be fully accurate. Please review the suggestions critically before applying any changes.

馃煝 Confidence: high

Multiple build jobs failed due to a missing bpftool dependency, which appears to be a CI environment issue unrelated to the code changes. However, the mkosi sanitizer job failed with a stack-buffer-underflow. This is very likely caused by the incorrect ordering of the new _TIMER_BASE_MIN enum member in src/core/timer.h, which gives it a larger value than _TIMER_BASE_MAX.

Comment thread src/core/timer.h
TIMER_CALENDAR,
_TIMER_BASE_MAX,
_TIMER_BASE_MIN,
_TIMER_BASE_INVALID = -EINVAL,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enum member has been added in the wrong place. By placing _TIMER_BASE_MIN after _TIMER_BASE_MAX, it is assigned a larger integer value (3) than _TIMER_BASE_MAX (2), which is logically incorrect.

This is the likely cause of the AddressSanitizer: stack-buffer-underflow error reported by the mkosi test job. To fix this, _TIMER_BASE_MIN should be moved to the beginning of the enum to ensure it has the lowest value.

Suggested change
_TIMER_BASE_INVALID = -EINVAL,
_TIMER_BASE_MIN,
TIMER_UNIT_INACTIVE,
TIMER_CALENDAR,
_TIMER_BASE_MAX,

@jamacku
jamacku force-pushed the core-add-TIMER_BASE_MIN branch 3 times, most recently from 107381d to 3c4663e Compare April 28, 2026 11:38
jamacku added 3 commits April 28, 2026 13:55
rhel-only: doc

Resolves: RHEL-155454
rhel-only: policy

Resolves: RHEL-155454
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

rhel-only: ci

Related: RHEL-155454
@jamacku
jamacku force-pushed the core-add-TIMER_BASE_MIN branch from 3c4663e to 2cc1e5e Compare April 28, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant