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

Verbose mode should use STDOUT, not STDERR #25

Open
orev opened this issue Mar 15, 2016 · 12 comments
Open

Verbose mode should use STDOUT, not STDERR #25

orev opened this issue Mar 15, 2016 · 12 comments
Labels

Comments

@orev
Copy link

orev commented Mar 15, 2016

Verbose mode should send messages to STDOUT, not STDERR. This enables capturing non-error messages in log files while allowing errors to be received as email alerts when run as a cron job. Also conceptually, verbose messages are not errors, so they should not be placed on STDERR.

@glensc
Copy link
Collaborator

glensc commented Sep 19, 2016

why this is good: if output is logged to stdout, i could logrotate -v | less

@kdudka
Copy link
Member

kdudka commented Sep 20, 2016

This is how logging is currently implemented:
https://github.com/logrotate/logrotate/blob/73f78069/log.c#L83

There is just one stream (currently stderr) for all messages above the specified log level. Apart from that, you can use the -l option to specify a file to log all messages to.

I see no real benefit in unconditionally changing the output stream from stderr to stdout now. The example in question could be easily changed to logrotate -v 2>&1 | less.

@orev
Copy link
Author

orev commented Sep 20, 2016

@kdudka Your comment does not address this request. No one said that logging should "unconditionally" go to stderr instead of stdout, and a shell redirection tutorial is not helpful or appropriate. The point is to separate informational messages from error messages, which is a well established concept.

The request is to have error messages go to stderr, and log/verbose messages go to stdout. This enables the extremely common idiom where the program runs from cron (which is pretty much always the case for logrotate), and regular logging occurs to a file while errors go to stderr, which can then be caught by cron and emailed out as an alert that something went wrong. Currently there is no way to automatically distinguish if output is an error or information.

If that takes more effort than making a simple change to the message() function, then so be it. Each call to message() would need to be reviewed and decided if it is an error or info, and updated accordingly.

@kdudka
Copy link
Member

kdudka commented Sep 20, 2016

On Tuesday, September 20, 2016 09:00:26 orev wrote:

@kdudka Your comment does not address this request. No one said that
logging should "unconditionally" go to stderr instead of stdout, and a
shell redirection tutorial is not helpful or appropriate. The point is to
separate informational messages from error messages, which is a well
established concept.

By "unconditionally" I meant "enabled by default". We try to avoid changes
in behavior where possible, especially when something works consistently for
a long period of time and users may already rely on the current behavior.

The request is to have error messages go to stderr, and log/verbose
messages go to stdout. This enables the extremely common idiom where the
program runs from cron (which is pretty much always the case for
logrotate), and regular logging occurs to a file while errors go to
stderr, which can then be caught by cron and emailed out as an alert
that something went wrong. Currently there is no way to automatically
distinguish if output is an error or information.

This request (which is orthogonal to what @glensc requested) is to some
extent already addressed by the -l option (used instead of -v). Is not it?

On Linux, you can use something like logrotate -l /dev/fd/1.

If that takes more effort than making a simple change to the message()
function, then so be it. Each call to message() would need to be
reviewed and decided if it is an error or info, and updated accordingly.

It is not about code changes really. It is about changing an interface
that has already been exposed to users for a long period of time.

@orev
Copy link
Author

orev commented Sep 26, 2016

I suggest that for any 4.0 release that might come, this change be made so logrotate follows the well-established convention of info on stdout, and errors on stderr. Using -l /dev/fd/1 might work, but it's certainly not typical or obvious, and is more of a workaround rather than a fix.

@kdudka
Copy link
Member

kdudka commented Sep 26, 2016

I do not think that such a convention applies generally. There are many programs out there that output info/progress/diagnostic messages to stderr, regardless severity of the messages being printed (curl, gcc, tar, ...).

@orev
Copy link
Author

orev commented Oct 12, 2016

I don't want to be arguing on here, but I really find it hard to accept the assertion that the convention of stdout and stderr is not a concept that applies generally. I mean, the entire concept is built right into the name of each output stream. It doesn't get any more obvious, and I really can't believe that I need to be arguing this. Whether other programs do it incorrectly, are used in special contexts, or have some very old legacy reasons for it aren't good examples.

The context for logrotate is very specifically, almost exclusively, to run through cron which has very specific expectations and behaviors depending on how output is generated. Such behavior is critical for sysadmins to determine the status of the log rotation (i.e. if something fails they need to know). It's not an interactive thing that can fudge the stdout/stderr concept to fit special interactive usage scenarios.

@cedricyaal
Copy link

I am also really surprised by this behaviour. I would have expected that only error will go to stderr and all others go to stdout.

@kdudka
Copy link
Member

kdudka commented Jul 9, 2018

I think neither the current nor the proposed behavior would please everyone. On top of that, changing the behavior in an update of logrotate is a no-go I think. Would it help if we introduced a new configuration and/or command line option to enable the proposed behavior?

@cedricyaal
Copy link

@kdudka yes i would help a lot thanks.

@Jonathan-LeRoux
Copy link

I was also very surprised when I started getting emails from cron after adding the --verbose option.
logrotate does not say what kind of error it encountered without --verbose. I was hoping to catch more info on the error that's bothering our system next time it occurs, so I added --verbose, and I now we get emails every single day. I thought I'd be clever and use cronic to wrap around logrotate and avoid getting emails when there's no error, but I just realized that logrotate dumps every message in stdout anyway.
I couldn't agree more with @orev. Error messages should be sent to stderr, while non-error messages should be sent to stdout.
The proposed workarounds are not clean fixes, they are just hacks.

cgzones added a commit to cgzones/logrotate that referenced this issue Oct 7, 2019
logrotate might crash when using invalid configuration settings in combination with include

example configuration:

    /tmp/logsegv/segv.log {
      include /tmp/logsegv/segv.cfg

      "" {

      }
    }

will lead to

    $ ./logrotate -vfd -s /tmp/logsegv/segv.state /tmp/logsegv/segv.cfg
    WARNING: logrotate in debug mode does nothing except printing debug messages!  Consider using verbose mode (-v) instead if this is not what you want.

    reading config file /tmp/logsegv/segv.cfg
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:2 include nesting too deep
    error: /tmp/logsegv/segv.cfg:4 unexpected log filename
    error: found error in /tmp/logsegv/segv.log , skipping
    removing last 1 log configs
    error: /tmp/logsegv/segv.cfg:4 unexpected log filename
    error: found error in log config, skipping
    removing last 1 log configs
    config.c:553:23: runtime error: load of null pointer of type 'struct logInfo *'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior config.c:553:23 in
    AddressSanitizer:DEADLYSIGNAL
    =================================================================
    ==12601==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000004d79a1 bp 0x7ffca98d0c30 sp 0x7ffca98d0c10 T0)
    ==12601==The signal is caused by a READ memory access.
    ==12601==Hint: address points to the zero page.
      #0 0x4d79a0 in freeTailLogs logrotate/config.c:553:23
      #1 0x4cb482 in readConfigFile logrotate/config.c:1870:21
      #2 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #3 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #4 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #5 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #6 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #7 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #8 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #9 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #10 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #11 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #12 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #13 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #14 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#15 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#16 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#17 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#18 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#19 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#20 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#21 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#22 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#23 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#24 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#25 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#26 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#27 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#28 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#29 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#30 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#31 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#32 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#33 0x4c70bb in readAllConfigPaths logrotate/config.c:759:13
      logrotate#34 0x4d961d in main logrotate/logrotate.c:2791:9
      logrotate#35 0x7fa31d719bba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26bba)
      logrotate#36 0x41f7a9 in _start (logrotate/logrotate+0x41f7a9)

    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV /home/christian/Coding/workspaces/smartgit/logrotate/config.c:553:23 in freeTailLogs
    ==12601==ABORTING

fixes: logrotate#271
cgzones added a commit to cgzones/logrotate that referenced this issue Oct 7, 2019
logrotate might crash when using invalid configuration settings in combination with include

example configuration:

    /tmp/logsegv/segv.log {
      include /tmp/logsegv/segv.cfg

      "" {

      }
    }

will lead to

    $ ./logrotate -vfd -s /tmp/logsegv/segv.state /tmp/logsegv/segv.cfg
    WARNING: logrotate in debug mode does nothing except printing debug messages!  Consider using verbose mode (-v) instead if this is not what you want.

    reading config file /tmp/logsegv/segv.cfg
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:2 include nesting too deep
    error: /tmp/logsegv/segv.cfg:4 unexpected log filename
    error: found error in /tmp/logsegv/segv.log , skipping
    removing last 1 log configs
    error: /tmp/logsegv/segv.cfg:4 unexpected log filename
    error: found error in log config, skipping
    removing last 1 log configs
    config.c:553:23: runtime error: load of null pointer of type 'struct logInfo *'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior config.c:553:23 in
    AddressSanitizer:DEADLYSIGNAL
    =================================================================
    ==12601==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000004d79a1 bp 0x7ffca98d0c30 sp 0x7ffca98d0c10 T0)
    ==12601==The signal is caused by a READ memory access.
    ==12601==Hint: address points to the zero page.
      #0 0x4d79a0 in freeTailLogs logrotate/config.c:553:23
      #1 0x4cb482 in readConfigFile logrotate/config.c:1870:21
      #2 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #3 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #4 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #5 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #6 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #7 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #8 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #9 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #10 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #11 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #12 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #13 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #14 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#15 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#16 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#17 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#18 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#19 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#20 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#21 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#22 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#23 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#24 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#25 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#26 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#27 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#28 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#29 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#30 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#31 0x4d164c in readConfigFile logrotate/config.c:1457:30
      logrotate#32 0x4c78fc in readConfigPath logrotate/config.c:685:13
      logrotate#33 0x4c70bb in readAllConfigPaths logrotate/config.c:759:13
      logrotate#34 0x4d961d in main logrotate/logrotate.c:2791:9
      logrotate#35 0x7fa31d719bba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26bba)
      logrotate#36 0x41f7a9 in _start (logrotate/logrotate+0x41f7a9)

    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV /home/christian/Coding/workspaces/smartgit/logrotate/config.c:553:23 in freeTailLogs
    ==12601==ABORTING

fixes: logrotate#271
kdudka pushed a commit that referenced this issue Oct 8, 2019
logrotate might crash when using invalid configuration settings in combination with include

example configuration:

    /tmp/logsegv/segv.log {
      include /tmp/logsegv/segv.cfg

      "" {

      }
    }

will lead to

    $ ./logrotate -vfd -s /tmp/logsegv/segv.state /tmp/logsegv/segv.cfg
    WARNING: logrotate in debug mode does nothing except printing debug messages!  Consider using verbose mode (-v) instead if this is not what you want.

    reading config file /tmp/logsegv/segv.cfg
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    reading config file /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:1 duplicate log entry for /tmp/logsegv/segv.log
    including /tmp/logsegv/segv.cfg
    error: /tmp/logsegv/segv.cfg:2 include nesting too deep
    error: /tmp/logsegv/segv.cfg:4 unexpected log filename
    error: found error in /tmp/logsegv/segv.log , skipping
    removing last 1 log configs
    error: /tmp/logsegv/segv.cfg:4 unexpected log filename
    error: found error in log config, skipping
    removing last 1 log configs
    config.c:553:23: runtime error: load of null pointer of type 'struct logInfo *'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior config.c:553:23 in
    AddressSanitizer:DEADLYSIGNAL
    =================================================================
    ==12601==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000004d79a1 bp 0x7ffca98d0c30 sp 0x7ffca98d0c10 T0)
    ==12601==The signal is caused by a READ memory access.
    ==12601==Hint: address points to the zero page.
      #0 0x4d79a0 in freeTailLogs logrotate/config.c:553:23
      #1 0x4cb482 in readConfigFile logrotate/config.c:1870:21
      #2 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #3 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #4 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #5 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #6 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #7 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #8 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #9 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #10 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #11 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #12 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #13 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #14 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #15 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #16 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #17 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #18 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #19 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #20 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #21 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #22 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #23 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #24 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #25 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #26 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #27 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #28 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #29 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #30 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #31 0x4d164c in readConfigFile logrotate/config.c:1457:30
      #32 0x4c78fc in readConfigPath logrotate/config.c:685:13
      #33 0x4c70bb in readAllConfigPaths logrotate/config.c:759:13
      #34 0x4d961d in main logrotate/logrotate.c:2791:9
      #35 0x7fa31d719bba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26bba)
      #36 0x41f7a9 in _start (logrotate/logrotate+0x41f7a9)

    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV /home/christian/Coding/workspaces/smartgit/logrotate/config.c:553:23 in freeTailLogs
    ==12601==ABORTING

Fixes: #271
Closes #272
@iliv
Copy link

iliv commented Nov 22, 2019

Yeah, @orev has a good point. This is conceptually correct and behavior contrary to this concept always make my eyebrows go up (logrotate or not).

@kdudka kdudka added the wontfix label Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants