Skip to content

fix infinite recursion bug for ticks to ms conversion#1165

Open
vlucent wants to merge 1 commit into
h2zero:masterfrom
vlucent:tick-to-ms-fix
Open

fix infinite recursion bug for ticks to ms conversion#1165
vlucent wants to merge 1 commit into
h2zero:masterfrom
vlucent:tick-to-ms-fix

Conversation

@vlucent

@vlucent vlucent commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

also fixes the watchdog boot loop as that's also why it was timing out #1164

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2e5be9b9-a72f-4904-8ef5-f65c5641e80a

📥 Commits

Reviewing files that changed from the base of the PR and between edf1b9e and f789215.

📒 Files selected for processing (1)
  • src/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h

📝 Walkthrough

Walkthrough

In the non-CONFIG_BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT FreeRTOS path, the inline wrapper ble_npl_time_ticks_to_ms() was calling itself instead of the underlying npl_freertos_time_ticks_to_ms() helper, causing infinite recursion. The call target is corrected to npl_freertos_time_ticks_to_ms(ticks, out_ms).

Changes

Fix self-recursion in ticks-to-ms wrapper

Layer / File(s) Summary
Recursive call fix
src/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h
Replaces the self-recursive ble_npl_time_ticks_to_ms(ticks, out_ms) call with the correct npl_freertos_time_ticks_to_ms(ticks, out_ms) delegation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

Arr, a wrapper called itself, what a cursed loop!
Infinite recursion sent the stack into a droop.
One line swapped out, the right helper now called,
The ship sails true, no longer forestalled!
Yarrr, one character diff saves the whole crew! 🏴‍☠️

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Arrr, the title accurately describes the fix for the recursive ticks-to-ms conversion bug.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@h2zero

h2zero commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Thanks!, not sure where that came from...

@vlucent

vlucent commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

To be fair, those function names all look very similar.

Also, fun fact: it's almost exactly 1 year ago since the initial commit.

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

Successfully merging this pull request may close these issues.

2 participants