Skip to content

Fix utility robustness#16

Open
dfateyev wants to merge 2 commits into
halon:masterfrom
dfateyev:fix-robustness
Open

Fix utility robustness#16
dfateyev wants to merge 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>
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