[email protected]
[Top] [All Lists]

Bug#251701: marked as forwarded (fix #182217 breaks librrdp-perl)

Subject: Bug#251701: marked as forwarded fix #182217 breaks librrdp-perl
From: Debian Bug Tracking System
Date: Sat, 20 Dec 2008 21:48:13 +0000
Your message dated Sat, 20 Dec 2008 22:37:05 +0100
with message-id <[email protected]>
has caused the   report #251701,
regarding fix #182217 breaks librrdp-perl
to be marked as having been forwarded to the upstream software
author(s) [email protected]

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]

251701: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=251701
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Subject: Re: fix #182217 breaks librrdp-perl
From: Sebastian Harl
Date: Sat, 20 Dec 2008 22:37:05 +0100

(This is a follow-up to Debian bug report #251701 [1]. The text also
mentions bug report #182217, which can be found at [2].)

[1] http://bugs.debian.org/251701
[2] http://bugs.debian.org/182217

On Sun, May 30, 2004 at 01:20:18PM +0200, Robert Lindgren wrote:
> Package: librrdp-perl
> Version: 1.0.46-3
> Severity: normal
> The fix for #182217 looks to break librrdp-perl, when running 
> RRDp::cmd "graph - ......" rrdtool doesn't get the the rest of of the
> command and waits forever in:
> robert   25577 21.3  0.6  2268 1036 pts/1    S    13:18   0:00
> /usr/bin/rrdtool -
> [email protected]:/usr/local/nagios/sbin# strace -p 25577
> read(0,
> when - is changed to an image everything works ok.
> This is quite bad since it breaks all cgi's trying to make a graph on
> the fly.

This can be reproduced by using a small script like:

  #! /usr/bin/perl
  use RRDp;
  RRDp::start "/usr/bin/rrdtool";
  if (! -e "bts#251701.rrd") {
      RRDp::cmd 'create bts#251701.rrd --step 300
  RRDp::cmd 'graph - --imgformat PNG
      --end now --start end-3600s --width 400
  my $img = RRDp::read;
  # ...

By now (rrdtool 1.3), the problem is the following:

RRDp::read() expects the output to be terminated by a line matching
"^OK(<system information>)?". However, when outputting a PNG, the
output is most likely not terminated by a newline, so RRDp::read sits
there waiting for that magic line forever.

I'm not sure how to properly solve that. We don't get an end-of-file
marker at that point, so we cannot simply wait for that. One possible
way would be to look for "OK ..." at the _end_ of a line. However, since
<system information> is optional, we'd get a "false positive" if the
output includes "OK" at the end of _some_ line, which, I suppose, might
very well happen e.g. when outputting some binary image data. (Btw.,
this is already true for "OK" at the beginning of a line which could be
seen as a bug as well.)

Another way would be to tune the output of the rrdtool server process
and return the status (possibly including the number of bytes in the
following output) before printing the output of the command. Obviously,
this would require to cache all output. Also, this would break all
existing applications that use the rrdtool server.

Any comments and feedback would be very appreciated.


Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

--- End Message ---
<Prev in Thread] Current Thread [Next in Thread>
  • Bug#251701: marked as forwarded (fix #182217 breaks librrdp-perl), Debian Bug Tracking System <=