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

flux-start: exit gracefully with error when getcwd() fails #2280

Merged
merged 3 commits into from Jul 31, 2019

Conversation

grondo
Copy link
Contributor

@grondo grondo commented Jul 31, 2019

This PR fixes the segv in the cron module found by @dongahn in issue #2274.

A test for flux-start run from a removed directory was also added.

Finally, while flux-start fails gracefully with the cron module fix, there is a huge number of errors. So a check was added early to flux-start main() to exit with an error if getcwd() fails to evoke an early exit.

Problem: The cron module fails to check the return value from
cron_ctx_create(), thus causing a segv later in module startup
when ctx == NULL.

Check that `ctx` was successfully created and exit if not.

Fixes flux-framework#2274
Ensure flux-start with default list of modules fails gracefully
when run from a directory that has been removed.
Problem: If flux-start is run with a current working directory that
has been removed, then a very long stream of errors is emitted
resulting in eventual failure.

Early in flux-start main(), exit with error if getcwd() fails.
@codecov-io
Copy link

Codecov Report

Merging #2280 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2280      +/-   ##
==========================================
- Coverage   80.85%   80.84%   -0.01%     
==========================================
  Files         213      213              
  Lines       33458    33463       +5     
==========================================
+ Hits        27053    27054       +1     
- Misses       6405     6409       +4
Impacted Files Coverage Δ
src/modules/cron/cron.c 81.94% <100%> (+0.04%) ⬆️
src/cmd/flux-start.c 78.47% <100%> (+0.28%) ⬆️
src/common/libflux/mrpc.c 87.79% <0%> (-1.19%) ⬇️
src/common/libflux/message.c 80.62% <0%> (-0.13%) ⬇️

@garlick
Copy link
Member

garlick commented Jul 31, 2019

Thanks for running this down!

@garlick garlick merged commit b04bcca into flux-framework:master Jul 31, 2019
@dongahn
Copy link
Member

dongahn commented Jul 31, 2019

Thanks @grondo!

@grondo grondo deleted the issue#2274 branch January 28, 2020 00:22
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.

None yet

4 participants