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

net: syslog: Make sure CONFIG_LOG_IMMEDIATE is not set #30290

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

jukkar
Copy link
Member

@jukkar jukkar commented Nov 27, 2020

The immediate logging option cannot be used with network logging
support CONFIG_LOG_BACKEND_NET as that would cause the generated
rsyslog messages to be malformed. The UDP packets would only have
one byte payloads which is not correct. So make sure that user is
not able to select a configuration with immediate mode and network
logging.

Signed-off-by: Jukka Rissanen jukka.rissanen@linux.intel.com

@jukkar jukkar added the DNM This PR should not be merged (Do Not Merge) label Nov 27, 2020
The immediate logging option cannot be used with network logging
support CONFIG_LOG_BACKEND_NET as that would cause the generated
rsyslog messages to be malformed. The UDP packets would only have
one byte payloads which is not correct. So make sure that user is
not able to select a configuration with immediate mode and network
logging.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
@jukkar
Copy link
Member Author

jukkar commented Nov 27, 2020

When running this in native_posix which enables immediate mode by default, I get a flood of these messages and nothing works

[00:00:04.120,000] <err> log: argument 2 in source log log message "argument %d in source %s log message "%s" missinglog_strdup()." missinglog_strdup().

@nordic-krch any idea what is going on?

@jukkar jukkar removed the DNM This PR should not be merged (Do Not Merge) label Nov 30, 2020
@nordic-krch
Copy link
Contributor

@jukkar this report about missing log_strdup indicates that there is a %s argument used in the logger for transient string and it is not duplicated into the logger memory. This check can be suppressed with CONFIG_LOG_DETECT_MISSED_STRDUP=n. However, it means that some logger strings may be malformed.

Note that i'm working on logging overhaul that may remove need for log_strdup #30353

@jukkar
Copy link
Member Author

jukkar commented Dec 4, 2020

this report about missing log_strdup indicates that there is a %s argument used in the logger for transient string and it is not duplicated into the logger memory. This check can be suppressed with CONFIG_LOG_DETECT_MISSED_STRDUP=n. However, it means that some logger strings may be malformed.

Sure, that is very clear. I am just wondering why I am getting a flood of these messages in native_posix if I disable immediate mode. There are no such floods if immediate mode is enabled in native_posix. So my question is that is this some configuration issue or is the immediate mode mandatory in native_posix?

@nordic-krch
Copy link
Contributor

Function is_rodata attempts to decide if string is in RO, probably this function is wrong for native_posix

static bool is_rodata(const void *addr)

@jukkar jukkar merged commit cc528d3 into zephyrproject-rtos:master Dec 4, 2020
@jukkar jukkar deleted the syslog_net branch December 4, 2020 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants