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

Recursion support #5

Open
ghost opened this issue Oct 17, 2015 · 8 comments
Open

Recursion support #5

ghost opened this issue Oct 17, 2015 · 8 comments
Labels

Comments

@ghost
Copy link

ghost commented Oct 17, 2015

While in logrotate.conf you can do /var/log/.log /var/log//.log /var/log///.log {} to setup a default catch-all for logs, I'd rather see a recursion option that you could put under /var/log/*.log that would recursively look for *.log anywhere in /var/log/, no matter how many directories deep (within reason). It seems a bit cleaner to me that way.

Example:

/var/log/*.log {
    copytruncate
    daily
    compress
    recurse
}
@inikolaev
Copy link
Contributor

logrotate uses glob internally so an easy workaround could be enabling globstar if using Bash 4 or higher. This should allow to use the following syntax /var/log/**/*.log.

The globstar can be enabled with the following command:

shopt -s globstar

Some details on globstar option: http:https://www.linuxjournal.com/content/globstar-new-bash-globbing-option

@ghost
Copy link
Author

ghost commented May 30, 2016

Ah, thank you! I don't think these boxes are on bash 4.X, but that's certainly an option down the road. Didn't realize logrotate used bash in such a way.

So in this case, I would begin the logrotate configuration with shopt -s globstar. Is that correct?

@inikolaev
Copy link
Contributor

No, you should not put this into config. It's the command to enable globstar option in your shell. I haven't tried it myself with logrotate yet though.

@LorenzoAncora
Copy link

@inikolaev I have the same issue and enabling globstar does not work: logrotate fails with verifying log file path failed, because the matching ends at **.

(logrotate 3.11.0, bash 4.4.23)

@tmccombs
Copy link

@inikolaev that workaround doesn't work. afaik, logrotate uses the glob(3) c funtion to do expansion, not bash. so setting an option in bash has no effect on logrotate.

@inikolaev
Copy link
Contributor

@inikolaev that workaround doesn't work. afaik, logrotate uses the glob(3) c funtion to do expansion, not bash. so setting an option in bash has no effect on logrotate.

You might be right - I haven't realized that those are two different globs.

@kdudka
Copy link
Member

kdudka commented Jan 24, 2019

Shell options for globbing only affect how the shell interpreter itself expands globs while interpreting shell code. It cannot affect globbing done by external binary programs in any way.

cgzones referenced this issue in cgzones/logrotate Oct 7, 2019
    Direct leak of 248 byte(s) in 1 object(s) allocated from:
      #0 0x4976ad in malloc (logrotate/logrotate+0x4976ad)
      #1 0x4d6aa7 in newLogInfo logrotate/config.c:527:16
      #2 0x4cc2a5 in readConfigFile logrotate/config.c:1606:35
      #3 0x4c78fc in readConfigPath logrotate/config.c:688:13
      #4 0x4c70bb in readAllConfigPaths logrotate/config.c:762:13
      #5 0x4d964d in main logrotate/logrotate.c:2791:9
      #6 0x7f720c8dbbba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26bba)
cgzones referenced this issue in cgzones/logrotate 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 referenced this issue in cgzones/logrotate Oct 7, 2019
    Direct leak of 248 byte(s) in 1 object(s) allocated from:
      #0 0x4976ad in malloc (logrotate/logrotate+0x4976ad)
      #1 0x4d6aa7 in newLogInfo logrotate/config.c:527:16
      #2 0x4cc2a5 in readConfigFile logrotate/config.c:1606:35
      #3 0x4c78fc in readConfigPath logrotate/config.c:688:13
      #4 0x4c70bb in readAllConfigPaths logrotate/config.c:762:13
      #5 0x4d964d in main logrotate/logrotate.c:2791:9
      #6 0x7f720c8dbbba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26bba)
cgzones referenced this issue in cgzones/logrotate 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
    Direct leak of 248 byte(s) in 1 object(s) allocated from:
      #0 0x4976ad in malloc (logrotate/logrotate+0x4976ad)
      #1 0x4d6aa7 in newLogInfo logrotate/config.c:527:16
      #2 0x4cc2a5 in readConfigFile logrotate/config.c:1606:35
      #3 0x4c78fc in readConfigPath logrotate/config.c:688:13
      #4 0x4c70bb in readAllConfigPaths logrotate/config.c:762:13
      #5 0x4d964d in main logrotate/logrotate.c:2791:9
      #6 0x7f720c8dbbba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26bba)

Closes #272
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
@Crapshit
Copy link

Same here on RHEL 7 with logrotate 3.8.6 and bash 4.2.46(2)-release.
@kdudka: It would be great to have a feature as mentioned from @LorenzoAncora in issue #177

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