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

libsubprocess: ensure bulk-exec output is terminated #6368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

garlick
Copy link
Member

@garlick garlick commented Oct 12, 2024

Problem: garbage appears in the logs when the bulkexec imp-kill generates output.

Since bulk-exec always uses unbuffered reads for performance, the output buffers returned by flux_subprocess_read() are not guaranteed to be NULL terminated.

Use "%.*s" instead of "%s" in the log format string for:

  • the imp kill on_output() handler
  • the fallback in case a user doesn't define an on_output() handler

Fixes #6366

Problem: garbage appears in the logs when the bulkexec imp-kill
generates output.

Since bulk-exec always uses unbuffered reads for performance, the
output buffers returned by flux_subprocess_read() are not guaranteed
to be NULL terminated.

Use "%.*s" instead of "%s" in the log format string for:
- the imp kill on_output() handler
- the fallback in case a user doesn't define an on_output() handler

Fixes flux-framework#6366
Copy link

codecov bot commented Oct 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.26%. Comparing base (50f8dc2) to head (df77f35).

Files with missing lines Patch % Lines
src/common/libsubprocess/bulk-exec.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6368      +/-   ##
==========================================
- Coverage   83.28%   83.26%   -0.03%     
==========================================
  Files         524      524              
  Lines       86230    86230              
==========================================
- Hits        71820    71802      -18     
- Misses      14410    14428      +18     
Files with missing lines Coverage Δ
src/common/libsubprocess/bulk-exec.c 81.55% <0.00%> (ø)

... and 11 files with indirect coverage changes

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.

job-exec.info logs contain garbage
1 participant