libnml: gate CMS_DISPLAY_ASCII_UPDATER banner behind debug flag#4074
Closed
grandixximo wants to merge 1 commit into
Closed
libnml: gate CMS_DISPLAY_ASCII_UPDATER banner behind debug flag#4074grandixximo wants to merge 1 commit into
grandixximo wants to merge 1 commit into
Conversation
The CMS_DISPLAY_ASCII_UPDATER constructor printed a multi-line 'may not function properly due to range limitations' WARNING banner unconditionally to stderr. That updater is also created transiently by NML::msg2str()/str2msg() to render an otherwise xdr-encoded buffer as an ASCII string (e.g. task command logging under EMC_DEBUG_TASK_ISSUE), so the banner fired during normal startup for a legitimate, harmless use. Route the banner through rcs_print_debug(PRINT_CMS_CONSTRUCTORS, ...) so it is silent by default but still available when CMS constructor debug printing is enabled. Verified the banner no longer appears on a touchy sim started with DEBUG = 0x10 (which instantiates the updater). Surfaced by the ui-smoke tests (PR LinuxCNC#4054).
5 tasks
Contributor
|
Converting to and from strings with the ascii updaters generate values that are artificially truncated. They may produce results that are not reflecting the actual state of affairs. That is why the banner exists and the warning is made so explicit. So hiding the message is probably not what you want. Once you instantiate an ascii updater class, you can get into serious trouble without knowing it when some process or person starts using its data. I suppose that the ascii updater is instantiated when debug is enabled and some debug messages use msg2str. In that case, just setting debug to zero should suffice. Or are there other instances where this might happen? |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CMS_DISPLAY_ASCII_UPDATER constructor printed a multi-line WARNING
banner unconditionally to stderr. That updater is also created transiently
by NML::msg2str()/str2msg() to render an xdr buffer as an ASCII string, so
the banner fired during normal operation for a harmless use.
Route it through rcs_print_debug(PRINT_CMS_CONSTRUCTORS, ...) so it is
silent by default but still available with CMS constructor debug printing.
Complements the touchy DEBUG=0 change by fixing the noise at the source
for any config that legitimately uses the ASCII updater.
Surfaced in the ui-smoke review, PR #4054.
Test: touchy sim with DEBUG = 0x10 (instantiates the updater) under xvfb,
banner no longer printed.