You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[2016-05-26T15:29:21.460108] multi-line-prefix() and/or multi-line-garbage() specified but multi-line-mode() is not regexp based (prefix-garbage or prefix-suffix), please set multi-line-mode() properly;
[2016-05-26T15:29:21.460116] Error initializing message pipeline;
[2016-05-26T15:29:21.460123] Error initializing new configuration, reverting to old config;
[2016-05-26T15:29:21.460157] Unable to detect fully qualified hostname for localhost, use_fqdn() will use the short hostname;
[2016-05-26T15:29:21.460168] Compiling #unnamed sequence [log] at [/home/btibi/work/impl-deinit-for-native-parser/install/etc/syslog-ng.conf:15:2]
[2016-05-26T15:29:21.460176] Compiling #anon-source0 sequence [source] at [/home/btibi/work/impl-deinit-for-native-parser/install/etc/syslog-ng.conf:15:2]
[2016-05-26T15:29:21.460183] Compiling #unnamed junction [log] at [/home/btibi/work/impl-deinit-for-native-parser/install/etc/syslog-ng.conf:15:10]
[2016-05-26T15:29:21.460191] Compiling #unnamed single [log] at [/home/btibi/work/impl-deinit-for-native-parser/install/etc/syslog-ng.conf:17:3]
[2016-05-26T15:29:21.460200] Error cloning pipe into its reference point, probably the element in question is not meant to be used in this situation; location='/home/btibi/work/impl-deinit-for-native-par$er/install/etc/syslog-ng.conf:17:3'
Quit (core dumped)
This problem can be reproduced with plugins whose init() method can return FALSE. affile and the "native" parsers are certainly affected. They are needed to trigger a config reverting.
We need an other plugin which cannot be cloned/clone() could fail. File destinations cannot be cloned, so they are perfect for this purpose.
What happens during the reproduction?
original configuration is loaded, everything is fine
PIF_INLINED flag is set on the LogPipe instances
we replace the configuration
syslog-ng is reloaded
new configuration is created
old configuration is deinitialized
PIF_INLINED flag is still set on the LogPipe instance
new configuration is initialized
it will fail, because the configuration is invalid
cfg_tree_compile() is not idempotent for at least two reasons:
* it stores the pipes to be initialized in an array, which will grow
for each cfg_tree_compile() calls
* it uses PIF_INLINED to indicate if a LogPipe was pasted directly into
the config rather than cloned
But cfg_tree_start() invokes cfg_tree_compile() unconditionally, which
means that if a config is initialized multiple times, cfg_tree_compile()
will accumulate cruft in its state.
Issue #1065 on github explains one case where syslog-ng crashes on reload:
#1065
This patch fixes this problem by guarding the compile function with
a variable, which ensures that the body of the function is executed only
once.
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
I found a nasty bug in the configuration loading process.
It can be reproduced by following these steps:
start syslog-ng with the following (valid) configuration:
Replace the configuration with the following one:
Reload syslog-ng
Expected result:
This problem can be reproduced with plugins whose
init()
method can returnFALSE
.affile
and the "native" parsers are certainly affected. They are needed to trigger a config reverting.We need an other plugin which cannot be cloned/
clone()
could fail. File destinations cannot be cloned, so they are perfect for this purpose.What happens during the reproduction?
PIF_INLINED
flag is set on theLogPipe
instancesPIF_INLINED
flag is still set on theLogPipe
instancePIF_INLINED
is set, we try to clone the pipe -> it will fail https://github.com/balabit/syslog-ng/blob/master/lib/cfg-tree.c#L461-L474kill()
call https://github.com/balabit/syslog-ng/blob/master/lib/mainloop.c#L217-L223syslog-ng
3.8
is certainly affected and by looking at the code3.6
and3.7
as well.The text was updated successfully, but these errors were encountered: