-
Notifications
You must be signed in to change notification settings - Fork 95
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
Large libbpf messages are truncated #300
Comments
@javierhonduco thanks for bringing that. Can you please test increasing that buffer from your end? |
With a buffer size of 1000: - out = (char *)calloc(1, 300);
+ out = (char *)calloc(1, 1000);
if (!out)
return -ENOMEM;
va_copy(check, args);
- ret = vsnprintf(out, 300, format, check);
+ ret = vsnprintf(out, 1000, format, check);
va_end(check); we get
Which is 998 chars + nul for the BPF verifier errors. Our program is rather large so the message can be many thousands of lines long, so dynamically allocating memory for the whole buffer might not be possible/practical |
Well, I suppose we can make two calls to vsnprintf, being the first to get the buffer required size: int required_size = vsnprintf(NULL, 0, format, check) + 1; and later: out = (char*)malloc(required_size);
...
ret = vsnprintf(out, required_size, format, args); |
@javierhonduco Please go get ...@commit and let me know if this is fixed on your end. Thanks. |
@geyslan Testing it, thanks! Right off the bat, I am a bit afraid of potentially allocating a very large buffer and having the size of the buffer depend on an external source (even if we decide to "trust" the kernel!) |
I get your concern, we are just doing this copy to expose the filtering mechanism in an easier way (via golang). Since we can't truncate the original logs, what do you suggest? |
Hi,
Recently we've seen that long verifier messages that used to be displayed in their entirety are now truncated. This unfortunately hinders debugging verifier problems. An example in https://github.com/javierhonduco/parca-agent/tree/truncated-logs-repro, built and ran with:
fails with these truncated logs
I believe this behaviour was introduced in e3f69db. The buffer is now 300 chars (including nul).
cc/ @kakkoyun @Sylfrena @brancz
The text was updated successfully, but these errors were encountered: