Skip to content

Fix utility robustness - #16

Merged
eriklax merged 2 commits into
halon:masterfrom
dfateyev:fix-robustness
Jul 27, 2026
Merged

Fix utility robustness#16
eriklax merged 2 commits into
halon:masterfrom
dfateyev:fix-robustness

Conversation

@dfateyev

Copy link
Copy Markdown
Contributor
  • Check mmap() and fork() return values
  • Rename SIGINT handler to avoid shadowing libc abort()

dfateyev and others added 2 commits July 12, 2026 01:51
The rate/parallel setup used two syscalls without checking for failure:

- The shared sem_t and counter pages from mmap() were used directly;
  on MAP_FAILED the following sem_init()/*counter access would
  dereference (void*)-1 and crash. Bail out with an error instead.

- fork() was assumed to succeed; on -1 the worker was silently lost.
  Report the failure to stderr.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The SIGINT handler was named abort(int), colliding with the standard
library's abort(void) declared via <stdlib.h>. It compiled only because
the signatures differ, but the clash is fragile and confusing. Rename
it to sigint_handler; behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@eriklax eriklax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@eriklax
eriklax merged commit 842254e into halon:master Jul 27, 2026
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