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

logpipe: do not reset config when pipe is deinited #282

Merged
merged 1 commit into from
Oct 10, 2014

Conversation

lbudai
Copy link
Collaborator

@lbudai lbudai commented Oct 10, 2014

There are two kind of initialization around log_pipes.

One is log_pipe_init_instance(), a kind of constructor, which is
called only once, when the object is constructed.

And there is log_pipe_init() (and its corresponding pair, log_pipe_deinit())
which could be called several times on a construced object (eg.:during reload).

Config is set by log_pipe_init_instance() but reset is called by
log_pipe_deinit().

During reload we already have a constructed object in deinited state
(config is set to NULL after deinit). When we call init() on such an object
it will cause seg.fault because config is NULL.

references:
#203

Signed-off-by: Budai Laszlo Laszlo.Budai@balabit.com

There are two kind of initialization around log_pipes.

One is log_pipe_init_instance(), a kind of constructor, which is
called only once, when the object is constructed.

And there is log_pipe_init() (and its corresponding pair, log_pipe_deinit())
which could be called several times on a construced object (eg.:during reload).

Config is set by log_pipe_init_instance() but reset is called by
log_pipe_deinit().

During reload we already have a constructed object in deinited state
(config is set to NULL after deinit). When we call init() on such an object
it will cause seg.fault because config is NULL.

Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
@juhaszviktor
Copy link
Contributor

👍

@bazsi
Copy link
Collaborator

bazsi commented Oct 10, 2014

Indeed, originally the config was assigned to the LogPipe using log_pipe_init(), thus its symmetric deinit was in log_pipe_deinit(). However the initialization went to the constructor, so it's a mistake to
drop the cfg reference in deinit.

So that patch is great, thanks for diagnosing the problem.

talien added a commit that referenced this pull request Oct 10, 2014
logpipe: do not reset config when pipe is deinited
@talien talien merged commit b3143de into syslog-ng:3.6/master Oct 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants