Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cron: handle ENOMEM without asserting #5515

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

garlick
Copy link
Member

@garlick garlick commented Oct 23, 2023

Problem: cronodate_create() calls xzmalloc() which asserts on ENOMEM, but cronodate is used in a broker module, so asserting is inappropriate.

Have cronodate_create() call cmalloc() and return NULL on failure. Ensure the return value is checked all along the call path from the cron broker module:

cron_entry_create()
 -> cron_datetime_create()
  -> datetime_entry_from_json()
   -> datetime_entry_create()
    -> cronodate_create()

(This was peeled off of #5514)

Problem: cronodate_create() calls xzmalloc() which asserts on
ENOMEM, but cronodate is used in a broker module, so asserting is
inappropriate.

Have cronodate_create() call cmalloc() and return NULL on failure.
Ensure the return value is checked all along the call path from the
cron broker module:

cron_entry_create()
 -> cron_datetime_create()
  -> datetime_entry_from_json()
   -> datetime_entry_create()
    -> cronodate_create()
Copy link
Contributor

@grondo grondo left a comment

Choose a reason for hiding this comment

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

Good catch! LGTM!

@mergify mergify bot merged commit 0d3e448 into flux-framework:master Oct 23, 2023
30 checks passed
@garlick garlick deleted the cron_noassert branch March 4, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants