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

ncclDebugLog: fix for log payload larger than buf #825

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

Conversation

danielahlin
Copy link

The logging function ncclDebugLog does not properly check the return value of the vsnprintf call (or, less importantly, the snprintf calls). Consequenly, when the length of the logging header and the logging message payload is larger than buf, then :

  1. Log messages are incorrect.
  2. buffer[len++] = '\n' writes out of bounds.
  3. fwrite(buffer, 1, len, ncclDebugFile) reads out of bounds.

@sjeaugey
Copy link
Member

sjeaugey commented Oct 9, 2023

Is this a theoretical issue, or did you encounter cases where we would print a line so long it would exceed the 1024 chars in buffer?

@danielahlin
Copy link
Author

I found it when developing #826.

I don't remember right now what I printed to the log, but probably the value of some environment variable.

@nzmsv
Copy link

nzmsv commented Dec 16, 2024

I also ran into this and wrote a patch before noticing this ticket (#1215)

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.

3 participants