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

affile: Mark messages as consumed in a write failure. #1725

Merged
merged 1 commit into from
Oct 23, 2017

Conversation

swstephenson
Copy link
Contributor

Fix a crash that occurs following a write failure when the file writer
buffer becomes full and a config reload is triggered.

If a write failure occurs in log_proto_file_writer_post as the buffer
becomes full, a subsequent call will be made where msg and
self->buffer[self->buff_count].iov_base point to the same memory.

The first call to log_proto_file_writer_flush will write the message
and free the buffer. The following call will raise an abort signal
when it attempts to free the buffer a second time.

If the message has been stored in self->buffer, it should be marked
as consumed irrespective of the result of log_proto_file_writer_flush.

This may relate to #1425

Signed-off-by: Sam Stephenson sam.stephenson@alliedtelesis.co.nz

Fix a crash that occurs following a write failure when the file writer
buffer becomes full and a config reload is triggered.

If a write failure occurs in log_progo_file_writer_post as the buffer
becomes full, a subsequent call will be made where msg and
self->buffer[self->buff_count].iov_base point to the same memory.

The first call to log_proto_file_writer_flush will write the message
and free the buffer. The following call will raise an abort signal
when it attempts to free the buffer a second time.

If the message has been stored in self->buffer, it should be marked
as consumed irrespective of the result of log_proto_file_writer_flush.

This may relate to syslog-ng#1425

Signed-off-by: Sam Stephenson <sam.stephenson@alliedtelesis.co.nz>
@kira-syslogng
Copy link
Contributor

This user does not have permission to start the build. Can one of the admins verify this patch and start the build? (admin please type: ok to test)

@bazsi
Copy link
Collaborator

bazsi commented Oct 19, 2017

@kira-syslogng : ok to test

Copy link
Collaborator

@bazsi bazsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch again. Must have taken some time to reproduce/diagnose the issue. Thanks a lot.

This looks good to me.

@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

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