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
@portante Is there still interest in this issue tracker? I just had a look at it and I agree that it is wrong. I also have seen that strtok() is used, which is not thread-safe. So the module will potentially make rsyslog segfault.
Given the fact that besides this tracker here we never received any attention regarding mmgrok, I wonder it if it really is useful to try to make it behave differently (except for strtok() for reliability reasons).
rgerhards
added a commit
to rgerhards/rsyslog
that referenced
this issue
May 4, 2018
The modules used strtok(), which is not thread-safe. So it will potentially
segfault when multiple instances are spawned (what e.g. happens on busy
systems).
This patch replaces strtok() with its thread-safe counterpart
strtok_r().
see also rsyslog#1359
Seems like
mmgrok
is not working quite like the way we'd want it to work.At line https://github.com/rsyslog/rsyslog/blob/master/contrib/mmgrok/mmgrok.c#L163, it seems that the
instanceData
data structurepszSource
field is initialized with the configured value, e.g.msg
(one could reference a JSON property, like "!myfield
", just as well).However, as we process messages, it appears that one line https://github.com/rsyslog/rsyslog/blob/master/contrib/mmgrok/mmgrok.c#L351, we overwrite the
instanceData
structure'spszSource
field with the actual message buffer data.Maybe I am reading this wrong, but why does it just pass that data as a parameter instead?
The text was updated successfully, but these errors were encountered: