Skip to content

v3.4.0#422

Merged
jkool702 merged 122 commits into
mainfrom
NEW/TUI
Jul 10, 2026
Merged

v3.4.0#422
jkool702 merged 122 commits into
mainfrom
NEW/TUI

Conversation

@jkool702

@jkool702 jkool702 commented Jul 3, 2026

Copy link
Copy Markdown
Owner

NEW FEATURES:

  1. TUI progress meter!
  2. SLURM preemption support
  3. the --halt flag to auto halt after some failure threshold
  4. multi-parameter sweeps via :::, ::::, and --link flags (same syntax/functionality as GNU parallel)

jkool702 and others added 30 commits June 29, 2026 18:24
…06686364

🤖 Auto-Build: Update Ring Loadables
…13284027

🤖 Auto-Build: Update Ring Loadables
…17978510

🤖 Auto-Build: Update Ring Loadables
…80426873

🤖 Auto-Build: Update Ring Loadables
…87658642

🤖 Auto-Build: Update Ring Loadables
…24194425

🤖 Auto-Build: Update Ring Loadables
…28859204

🤖 Auto-Build: Update Ring Loadables
…33847849

🤖 Auto-Build: Update Ring Loadables
…42019750

🤖 Auto-Build: Update Ring Loadables
…62991812

🤖 Auto-Build: Update Ring Loadables
@jkool702

jkool702 commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

@gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates forkrun to version v3.4.0, introducing several major features including a live telemetry dashboard (TUI), SLURM preemption support with signal traps, auto-halt thresholds on batch failures, and multi-input parameter sweeps. The review feedback highlights critical safety improvements in the C codebase: preventing potential NULL pointer dereferences of state when updating uma_ingest_offset, avoiding a 32-bit integer overflow in the percentage-based halt calculation, and mitigating stack overflow risks in the TUI by moving a large 1MB array off the stack.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread forkrun_ring.c Outdated
total_unique_batches += atomic_load_relaxed(&state[i].read_idx);
}
if (total_unique_batches >= 100) {
uint32_t current_pct = (total_poisoned * 100) / total_unique_batches;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

In large-scale runs, total_poisoned can be very large. Since total_poisoned is a uint32_t, the expression total_poisoned * 100 can overflow 32-bit unsigned integer limits if total_poisoned exceeds 42,949,672. This would result in an incorrect percentage calculation and potentially cause a premature abort or fail to abort. To prevent this, cast total_poisoned to uint64_t before multiplying.

                  uint32_t current_pct = ((uint64_t)total_poisoned * 100) / total_unique_batches;

Comment thread forkrun_ring.c Outdated
sys_write(evfd_ingest_data, &v, 8);
}
total_moved += copied_in_chunk;
atomic_store_relaxed(&state[0].uma_ingest_offset, total_moved);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The pointer state is dereferenced here without a NULL check. Since state can be NULL (as seen in other defensive checks in this function, such as on lines 5878, 6002, and 6013), this can lead to a segmentation fault. Please guard this store with a NULL check.

      if (state) atomic_store_relaxed(&state[0].uma_ingest_offset, total_moved);

Comment thread forkrun_ring.c Outdated
sys_write(evfd_ingest_data, &v, 8);
}
total_moved += n;
atomic_store_relaxed(&state[0].uma_ingest_offset, total_moved);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The pointer state is dereferenced here without a NULL check. Please guard this store with a NULL check to prevent potential segmentation faults.

        if (state) atomic_store_relaxed(&state[0].uma_ingest_offset, total_moved);

Comment thread forkrun_ring.c Outdated
sys_write(evfd_ingest_data, &v, 8);
}
total_moved += written;
atomic_store_relaxed(&state[0].uma_ingest_offset, total_moved);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The pointer state is dereferenced here without a NULL check. Please guard this store with a NULL check to prevent potential segmentation faults.

      if (state) atomic_store_relaxed(&state[0].uma_ingest_offset, total_moved);

Comment thread forkrun_ring.c Outdated
Comment on lines +6853 to +6854
uint8_t node_cpu_map[1024][1024];
memset(node_cpu_map, 0, sizeof(node_cpu_map));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Allocating a large array like node_cpu_map[1024][1024] (1 MB) on the stack can easily lead to stack overflow, especially in environments with limited stack sizes (such as custom threads or containerized environments). It is highly recommended to allocate this array on the heap using calloc or declare it as static to move it to the data segment, as ring_tui_main is run once in a background process.

    static uint8_t node_cpu_map[1024][1024];
    memset(node_cpu_map, 0, sizeof(node_cpu_map));

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
41.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@jkool702 jkool702 merged commit ec2b11a into main Jul 10, 2026
5 of 7 checks passed
@jkool702 jkool702 deleted the NEW/TUI branch July 10, 2026 21:41
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.

1 participant