[syslog-ng]Urgent: Mangled messages in pipe() destinations in version 1.5.19

Andreas Schulze Andreas.Schulze@mediaWays.NET
Fri, 02 Aug 2002 17:26:25 +0200


Hello Balazs,

in version 1.5.19 (and in other versions between >1.5.7 and <=1.5.19, too)
we observing obscure message mangling in pipe() destinations.

Imagine the config below and the scenario:
	syslog-ng --write(2)--> pipe() --read(2)--> application

All four log paths below, writes lines to the pipe '/tmp/pipe'.
With 1.5.7 we read from the pipe exactly that, what syslog-ng
(using the config below) writes to it.

But with all newer versions (espec. 1.5.19) we read (with the same config):

message_1
message_2
messagmessage_4  !!!
...
message_n

if we try to let syslog-ng write:

message_1
message_2
message_3
message_4
...
message_n

(The numbers and terms are only examples, because of the different sources
and high message load.)

Seems, that write(2) to fifo skips some message ends now.
(espec. the terminating newline)

 > # example config:
 > #
> source sys { sun-streams ("/dev/log" door("/var/run/syslog_door")); };
> source net { udp (ip(w.x.y.z) port(n)); };
> destination d_cisco { pipe("/tmp/pipe" template("@cisco: | $MSG\n")); };
> destination d_icmp  { pipe("/tmp/pipe" template("@icmpd: | $MSG\n")); };
> log { source(net); filter(fa); destination(da); destination(d_cisco); };
> log { source(net); filter(fb); destination(db); destination(d_cisco); };
> log { source(sys); filter(f1); destination(d1); destination(d_icmp); };
> log { source(sys); filter(f2); destination(d2); destination(d_icmp); };

We are running a config similar to this above, with 1.5.7 since a lot of 
months
very successfully in production ennvironment with very high message load.

Since 1.5.1? the message mangling occurs.
But now, some of your newer features becomes mission critical for us.

Have you any idea, what happens? Versions <= 1.5.7 works well.

Thanks a lot.
-- 
Best regards --Andreas Schulze
                [phone: +49.5246.80.1275, fax: +49.5246.80.2275]

| I believe, it was Dennis Ritchie who said something like:
|   "C is rarely the best language for a given task,
|    but it's often the second-best".
| The implication being that: "[...]"
|
| sh# cat>$$.c<<EOT
| main(l,a,n,d)char**a;{for(d=atoi(a[1])/10*80-atoi(a[2])/5-596;n="@NK\
| ACLCCGZAAQBEAADAFaISADJABBA^SNLGAQABDAXIMBAACTBATAHDBANZcEMMCCCCAAhE\
| IJFAEAAABAfHJETBdFLDAANEfDNBPHdBcBBBEA_AL H E L L O,    W O R L D! "
| [l++-3];)for(;n-->64;)putchar(!d+++33^l&1);}
| EOT
| gcc -o$$ $$.c;clear;./$$ 52 8;rm -f $$*