Skip to content

[8.6] MOD-7574: Output Current Thread IndexSpec Information On Crash#8114

Merged
redisearch-backport-pull-request[bot] merged 1 commit into8.6from
backport-8051-to-8.6
Jan 21, 2026
Merged

[8.6] MOD-7574: Output Current Thread IndexSpec Information On Crash#8114
redisearch-backport-pull-request[bot] merged 1 commit into8.6from
backport-8051-to-8.6

Conversation

@redisearch-backport-pull-request
Copy link
Contributor

@redisearch-backport-pull-request redisearch-backport-pull-request bot commented Jan 21, 2026

Description

Backport of #8051 to 8.6.


Note

Backports crash-report improvements and INFO safety hardening.

  • Crash-safe index context: New IndexSpec_AddToInfo(ctx, sp, obfuscate, skip_unsafe_ops) surfaces index definition/stats without allocations/locks; used in current_thread crash section with run_time_ns tracking (via SpecInfo.runningTime).
  • Obfuscation: Adds Obfuscate_Prefix and integrates obfuscation for filters, prefixes, field names/paths; supports skip_unsafe_ops to bypass risky ops (e.g., vector sizes, stopwords, dict lookups) in signal handlers.
  • INFO stability: Removes FTINFO compile guards to always expose stats; Cursors_RenderStatsForInfo uses trylock and reports status=locked if contention; GC renderStatsForInfo always available and wired in callbacks.
  • Minor fixes: Adjusts stopwords iteration API; minor ordering tweak for CurrentThread_SetIndexSpec usage.
  • Tests: Reworks crash tests to parse and validate crash log content (including Rust panic), index sections, sizes, and timing.

Written by Cursor Bugbot for commit 80a21b9. This will update automatically on new commits. Configure here.

* initial commit

* remove redundant index name  since it will be added in the info function

* fix compilation

* fix code review comment + change function name

* add how long the thread was running on an index

* fixing minor bug in syn dump command

* add init call, add time to test

* use existing IndexSpec_AddToInfo, modify it a bit to ensure it is signal safe and obfuscates user data

* update test

* fix cursor stats for info function

* fix compilation and comments

* fix test + update comment

* fix code review comments

* code review fixes

* fix tests

* can't use IndexesScanner_IndexedPercent because we don't have redis module ctx

(cherry picked from commit 6ad5523)
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

const char *prefix = HiddenUnicodeString_GetUnsafe(rule->prefixes[i], NULL);
const char *prefix_to_use = obfuscate ? Obfuscate_Prefix(prefix) : prefix;
prefixes = array_ensure_append_1(prefixes, "\"");
prefixes = array_ensure_append_n(prefixes, prefix_to_use, strlen(prefix_to_use));
Copy link

Choose a reason for hiding this comment

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

Missing NULL check for prefixes in loop

Low Severity

The new prefix handling code checks first_prefix for NULL at line 2893-2894 before entering the loop, but inside the loop, prefix obtained from HiddenUnicodeString_GetUnsafe is not checked for NULL. When obfuscate is false, prefix_to_use equals prefix directly, and strlen(prefix_to_use) is called at line 2901. If HiddenUnicodeString_GetUnsafe returns NULL for any subsequent prefix, this causes undefined behavior.

Fix in Cursor Fix in Web

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 3.38983% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.76%. Comparing base (64674d6) to head (80a21b9).
⚠️ Report is 2 commits behind head on 8.6.

Files with missing lines Patch % Lines
src/spec.c 0.00% 37 Missing ⚠️
src/cursor.c 0.00% 14 Missing ⚠️
src/info/info_redis/info_redis.c 0.00% 3 Missing ⚠️
src/obfuscation/obfuscation_api.c 0.00% 2 Missing ⚠️
src/stopwords.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              8.6    #8114      +/-   ##
==========================================
- Coverage   84.02%   83.76%   -0.26%     
==========================================
  Files         365      365              
  Lines       55111    55277     +166     
  Branches    14296    14296              
==========================================
- Hits        46305    46303       -2     
- Misses       8645     8813     +168     
  Partials      161      161              
Flag Coverage Δ
flow 84.68% <3.38%> (-0.25%) ⬇️
unit 50.68% <1.69%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@redisearch-backport-pull-request redisearch-backport-pull-request bot added this pull request to the merge queue Jan 21, 2026
Merged via the queue into 8.6 with commit 8f94607 Jan 21, 2026
50 of 51 checks passed
@redisearch-backport-pull-request redisearch-backport-pull-request bot deleted the backport-8051-to-8.6 branch January 21, 2026 10:16
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