Skip to content

adelsystem_cbi: derive the onboard temperature alarm count from its array - #3646

Open
user01010111 wants to merge 8 commits into
networkupstools:masterfrom
user01010111:codex/adelsystem-alarm-count
Open

user01010111 wants to merge 8 commits into
networkupstools:masterfrom
user01010111:codex/adelsystem-alarm-count

Conversation

@user01010111

@user01010111 user01010111 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Merge order: #3645, then #3646, then #3647. This PR includes #3645 until the prerequisites merge; its alarm-count change is commit aaa733b.

Use SIZEOF_ARRAY(obta_ar) for the alarm count instead of four. The array contains one entry, so the old count let the polling loop read beyond it.

The unmodified full driver reproduces the overflow under AddressSanitizer. With the read-storage and recovery fixes applied, the full driver passes the corresponding ASan/UBSan polling and recovery checks, with alarm processing exercised. These integration results cover the combined series; hardware was not tested.

Fixes #3643.

Developed with OpenAI Codex using gpt-6-astra and gpt-daybreak-blue-latest.

Reproduction files and instructions: #3644 (comment)

Read Modbus bits and registers into byte- and word-sized buffers, then
convert the result explicitly into the caller's integer value. This removes
uninitialised-value use while retaining the existing masks and error handling.

Fixes networkupstools#3642

AI assistance: OpenAI Codex with gpt-6-astra and gpt-daybreak-blue-latest.

Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
…rray

Use SIZEOF_ARRAY(obta_ar) for the alarm count instead of four. The array
contains one entry, so the old count let the polling loop read beyond it.

Fixes networkupstools#3643

AI assistance: OpenAI Codex with gpt-6-astra and gpt-daybreak-blue-latest.

Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

A ZIP file with standard source tarball and another tarball with pre-built docs for commit d58b0ad is temporarily available: NUT-tarballs-PR-3646.zip.

@user01010111
user01010111 marked this pull request as ready for review September 14, 2026 18:26
@jimklimov jimklimov added modbus Incorrect or missing readings On some devices driver-reported values are systemically off (e.g. x10, x0.1, const+Value, etc.) AI For good or bad, machine tools are upon us. Humans are still the responsible ones. labels Sep 18, 2026
@jimklimov jimklimov added this to the 2.8.6 milestone Sep 18, 2026
@jimklimov

Copy link
Copy Markdown
Member

CI faults: Spellchecker concerns addressed in #3647

jimklimov and others added 5 commits September 23, 2026 18:08
Use uint16_t for register_read() output and its get_dev_state() caller.
Keep the typed libmodbus buffers, masks and failure behaviour, and cast
formatting arguments explicitly for portable integer promotion.

Validated both read modes with GCC and Clang, boundary and consumer
checks, sanitizers, and real-libmodbus polling with the dependent fixes.
Both modes also pass custom/default-port disconnect and recovery tests,
surviving three refused reconnects and restoring changed readings.
GCC project tests and distribution/install/uninstall checks pass.

AI assistance: OpenAI Codex (gpt-6-astra). Adversarial review by Claude
Code (claude-opus-5-5, high effort) covered the complete PR, amendment,
callers and validation evidence, with a follow-up on compiler diagnostics
and polling state dumps. No blocking read-path finding remained.

Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
…us series branch

Carry the reviewed Adelsystem uint16_t read-value amendment forward
without rewriting the existing contribution or maintainer history.

The amendment was developed with OpenAI Codex (gpt-6-astra) and reviewed
with Claude Code (claude-opus-5-5, high effort); the review scope was networkupstools#3645
and its type amendment.

Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
user01010111 added a commit to user01010111/nut that referenced this pull request Oct 13, 2026
…us series branch

Carry the reviewed Adelsystem uint16_t read-value amendment forward
without rewriting the existing contribution or maintainer history.

The amendment was developed with OpenAI Codex (gpt-6-astra) and reviewed
with Claude Code (claude-opus-5-5, high effort); the review scope was networkupstools#3645
and its type amendment.

Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 23, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 23, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 23, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 23, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 23, 2026
@AppVeyorBot

Copy link
Copy Markdown

✅ Build nut 2.8.5.5904-master completed (commit 0e16acbb11 by @jimklimov)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI For good or bad, machine tools are upon us. Humans are still the responsible ones. Incorrect or missing readings On some devices driver-reported values are systemically off (e.g. x10, x0.1, const+Value, etc.) modbus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adelsystem_cbi reads beyond its onboard temperature alarm table

3 participants