[syslog-ng]Urgent: Mangled messages in pipe() destinations in versions >1.5.8

Andreas Schulze Andreas.Schulze@mediaWays.NET
Mon, 30 Dec 2002 17:54:31 +0100


Balazs Scheidler wrote:
> On Sat, Dec 28, 2002 at 12:05:12AM +0100, Andreas Schulze wrote:
> 
>>Balazs Scheidler wrote:
>>
>>>On Fri, Sep 27, 2002 at 02:47:25PM +0200, Carlos Inacio wrote:
>>
>>I think, you changed the internal buffering from a line based buffer
>>to byte based buffer between 1.5.8 and 1.5.9.
>>In 1.5.7 there isn't that problem.
>>Maybe, line based buffering seems a better idea in this context.
>>
>>Hope, this coveres the problem.
> 
> Thanks for the detailed report. I think I have found the problem this time.
> Can you check this patch?

Yepp. We try it out as soon as possible.
Thanks a lot for the patch.

> Index: pkt_buffer.c
> ===================================================================
> RCS file: /var/cvs/syslog-ng/libol/src/pkt_buffer.c,v
> retrieving revision 1.15
> diff -u -r1.15 pkt_buffer.c
> --- pkt_buffer.c	18 Dec 2002 12:40:28 -0000	1.15
> +++ pkt_buffer.c	28 Dec 2002 09:53:00 -0000
> @@ -132,7 +132,7 @@
>  				if (self->super.writable)
>  					(*self->super.writable) = 1;
>  			}
> -			else if (res != 0) {
> +			else {
>  				/* this is slow, because of another memory move
>  				 * but this is run rarely anyway */
>  				struct buffer_node *item;

-- 
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 $$*