[Bug 181] New: Daemon stops reading from unix-dgram source following charset decoding error
https://bugzilla.balabit.com/show_bug.cgi?id=181 Summary: Daemon stops reading from unix-dgram source following charset decoding error Product: syslog-ng Version: 3.3.x Platform: PC URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674099 OS/Version: Linux Status: ASSIGNED Severity: blocker Priority: unspecified Component: syslog-ng AssignedTo: algernon@balabit.hu ReportedBy: algernon@balabit.hu Type of the Report: bug Estimated Hours: 0.0 As explained in the Debian bug report (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674099), when we have an unix-dgram() source with encoding set, and we send invalid data there, no further messages will be processed. It's easy to reproduce, and only seems to happen with unix-dgram (tcp at least does not exhibit this problem). I'm not quite sure yet why this happens - the source is kept open, just doesn't seem to be handled at all. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=181 Balazs Scheidler <bazsi@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bazsi@balabit.hu --- Comment #1 from Balazs Scheidler <bazsi@balabit.hu> 2012-05-25 10:24:46 --- it probably happens with udp() too, as it might be SOCK_DGRAM related. In that case a connection closure closes the only socket that is used to read messages. This untested patch should help: diff --git a/lib/logreader.c b/lib/logreader.c index 562edd9..6c53b32 100644 --- a/lib/logreader.c +++ b/lib/logreader.c @@ -120,19 +120,19 @@ log_reader_work_finished(void *s) { LogReader *self = (LogReader *) s; - if (self->notify_code == 0) + if (self->notify_code) { - if (self->super.super.flags & PIF_INITIALIZED) - { - /* reenable polling the source assuming that we're still in - * business (e.g. the reader hasn't been uninitialized) */ + gint notify_code = self->notify_code; - log_reader_start_watches(self); - } + self->notify_code = 0; + log_pipe_notify(self->control, &self->super.super, notify_code, self); } - else + if (self->super.super.flags & PIF_INITIALIZED) { - log_pipe_notify(self->control, &self->super.super, self->notify_code, self); + /* reenable polling the source assuming that we're still in + * business (e.g. the reader hasn't been uninitialized) */ + + log_reader_start_watches(self); } log_pipe_unref(&self->super.super); } -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=181 --- Comment #2 from Gergely Nagy <algernon@balabit.hu> 2012-05-25 10:36:23 --- (In reply to comment #1)
it probably happens with udp() too, as it might be SOCK_DGRAM related.
In that case a connection closure closes the only socket that is used to read messages.
This untested patch should help:
It does not fix the issue in itself, I'm afraid (just tested). It does look better than what I came up with though: https://github.com/algernon/syslog-ng/commit/a0e9a73ce1336ae02b8219fc0a7842b... Your patch gave me an idea or two, though, thanks! -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=181 --- Comment #3 from Gergely Nagy <algernon@balabit.hu> 2012-05-25 10:42:18 --- (In reply to comment #2)
(In reply to comment #1)
it probably happens with udp() too, as it might be SOCK_DGRAM related.
In that case a connection closure closes the only socket that is used to read messages.
This untested patch should help:
It does not fix the issue in itself, I'm afraid (just tested).
For the record: with the patch applied, syslog-ng ends up 'spinning' in log_proto_buffered_server_fetch()/work_finished(), because self->status remains LPS_ERROR, and thus _buffered_server_fetch() bails out early, and the status never changes. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=181 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |3.3.6 -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=181 --- Comment #4 from Gergely Nagy <algernon@balabit.hu> 2012-06-22 11:03:58 --- I committed a patch to the hotfix/3.3/unix-dgram-encoding branch of my git tree, that addresses the problem, and is mostly based on Bazsi's patch. I'm not entirely happy yet, though, so this is not going onto master just yet. The patch in question can be reviewed at https://github.com/algernon/syslog-ng/commit/9acd81ec0a57de036160cded22c4c37... -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=181 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution| |FIXED Status|ASSIGNED |RESOLVED --- Comment #5 from Gergely Nagy <algernon@balabit.hu> 2012-06-29 08:42:23 --- With a patch from Bazsi, this is fixed in git. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla@bugzilla.balabit.com