Skip to content

Try to avoid losing client outputs if exit clean-up crashes; try to avoid (Open)SSL-related crashes there#3497

Merged
jimklimov merged 4 commits into
networkupstools:masterfrom
jimklimov:issue-3454
Jun 28, 2026
Merged

Try to avoid losing client outputs if exit clean-up crashes; try to avoid (Open)SSL-related crashes there#3497
jimklimov merged 4 commits into
networkupstools:masterfrom
jimklimov:issue-3454

Conversation

@jimklimov

Copy link
Copy Markdown
Member

Hopefully fixes: #3454

Depending on the system and compiler optimizations, possibly the root cause was not NULL-initializing the ssl_ctx global variable (by standard it should have been NULL by default, but...) so we might be freeing a random non-NULL address during exit().

It still seems reasonable to clean up and claim that SSL did not get initialized if we bail out from upscli_init() early (mid-way through the routine).

The rest is a band-aid for symptoms seen here (e.g. losing upsc output if clean-up crashed) just in case something like this keeps misfiring in later evolution.

…anup() right away [networkupstools#3454]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…d exit, just in case [networkupstools#3454]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov added this to the 2.8.6 milestone Jun 22, 2026
@jimklimov jimklimov added FreeBSD issues related to FreeBSD and its derivatives (including pfSense) service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug SSL/NSS Issues and PRs about SSL, TLS and other crypto-related matters impacts-release-2.8.5 Issues reported against NUT release 2.8.5 (maybe vanilla or with minor packaging tweaks) labels Jun 22, 2026
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

@jimklimov jimklimov merged commit d21c02c into networkupstools:master Jun 28, 2026
22 of 23 checks passed
@jimklimov jimklimov deleted the issue-3454 branch June 28, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FreeBSD issues related to FreeBSD and its derivatives (including pfSense) impacts-release-2.8.5 Issues reported against NUT release 2.8.5 (maybe vanilla or with minor packaging tweaks) service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug SSL/NSS Issues and PRs about SSL, TLS and other crypto-related matters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

upsc segfaults (SIGSEGV) when querying remote upsd on FreeBSD 14.x with NUT 2.8.5

2 participants