Your message dated Tue, 07 Apr 2009 21:17:14 +0000
with message-id <[email protected]>
and subject line Bug#522277: fixed in analog 2:6.0-19
has caused the Debian Bug report #522277,
regarding analog: Only reads first stream in multi-stream bz2 log files
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(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]
immediately.)
--
522277: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=522277
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: analog
Version: 2:6.0-17~lenny1
Severity: normal
Tags: patch
Multi-stream bz2 files are created if you concatenate two "normal" bz2
files. Analog's current code stops at the end of the first stream. This
happens without error, and simply shows up as an unexplained failure to
read to the end of the log file.
The attached patch checks if the end-of-stream is also the end-of-file,
and if not, it opens the next stream and continues on.
A workaround is to use
UNCOMPRESS *.bz2 "bzcat"
in your configuration file, thus overriding the built-in bzip code.
-- System Information:
Debian Release: 5.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages analog depends on:
ii debconf [debconf-2.0] 1.5.24 Debian configuration management sy
ii libbz2-1.0 1.0.5-1 high-quality block-sorting file co
ii libc6 2.7-18 GNU C Library: Shared libraries
ii libgd2-xpm 2.0.36~rc1~dfsg-3 GD Graphics Library version 2
ii libjpeg62 6b-14 The Independent JPEG Group's JPEG
ii libpcre3 7.6-2.1 Perl 5 Compatible Regular Expressi
ii libpng12-0 1.2.27-2+lenny2 PNG library - runtime
ii perl 5.10.0-19 Larry Wall's Practical Extraction
ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime
analog recommends no packages.
Versions of packages analog suggests:
ii apache2 2.2.9-10+lenny2 Apache HTTP Server metapackage
ii apache2-mpm-prefork [htt 2.2.9-10+lenny2 Apache HTTP Server - traditional n
pn rmagic <none> (no description available)
-- debconf information excluded
--- input.c.old 2004-12-19 13:51:30.000000000 +0000
+++ input.c 2009-04-02 10:07:38.000000000 +0100
@@ -377,6 +377,9 @@
choice getmoredata(Logfile *lf, char *start, size_t length) {
#ifndef LINE_PARSER
int bze;
+ void* unusedPtr;
+ char* unusedData;
+ int unusedCount;
#endif
int n;
@@ -397,9 +400,53 @@
n = 0; /* unzReadCurrentFile() returns -1 on error */
break;
case LF_BZ2:
- n = BZ2_bzRead(&bze, (BZFILE *)(lf->file2), (void *)start, length);
- if (bze != BZ_OK && bze != BZ_STREAM_END)
- n = 0; /* return value from BZ2_bzRead() undefined on error */
+ n = 0;
+ // Multiple BZ2 streams may occur in a single file. If we reach the end of
+ // a stream before we have enough bytes, open the next stream and go again
+ while (n < length) {
+ n = n + BZ2_bzRead(&bze, (BZFILE *)(lf->file2), (void *)start + n, length - n);
+
+ if (bze != BZ_OK && bze != BZ_STREAM_END) {
+ n = 0; /* return value from BZ2_bzRead() undefined on error */
+ break;
+ }
+
+ if (bze == BZ_STREAM_END) {
+ // Is this really the end of the file, or is there another stream?
+ // Check for "unused" data (see the bzip docs for what this is)
+ BZ2_bzReadGetUnused(&bze, (BZFILE *)(lf->file2), &unusedPtr, &unusedCount);
+ if (bze != BZ_OK) {
+ n = 0; // Something's wrong, give up
+ break;
+ }
+
+ if (unusedCount == 0 && feof((FILE *)(lf->file))) {
+ break; // Real end-of-file
+ }
+
+ // Put the unused data somewhere safe for a moment
+ unusedData = malloc(unusedCount);
+ memcpy(unusedData, unusedPtr, unusedCount);
+
+ // Close the old stream
+ BZ2_bzReadClose(&bze, (BZFILE *)(lf->file2));
+ if (bze != BZ_OK) {
+ n = 0; // Something's wrong, give up
+ break;
+ }
+
+ // Open the new stream
+ lf->file2 = (void *)BZ2_bzReadOpen(&bze, (FILE *)(lf->file),
+ 0, 0, unusedData, unusedCount);
+ if (bze != BZ_OK || (BZFILE *)(lf->file2)==NULL) {
+ n = 0; // Something's wrong, give up
+ break;
+ }
+
+ // Unused data is copied immediately by bzReadOpen
+ free(unusedData);
+ }
+ }
break;
#endif
default:
--- End Message ---
--- Begin Message ---
Source: analog
Source-Version: 2:6.0-19
We believe that the bug you reported is fixed in the latest version of
analog, which is due to be installed in the Debian FTP archive:
analog_6.0-19.diff.gz
to pool/main/a/analog/analog_6.0-19.diff.gz
analog_6.0-19.dsc
to pool/main/a/analog/analog_6.0-19.dsc
analog_6.0-19_i386.deb
to pool/main/a/analog/analog_6.0-19_i386.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Bradley Smith <[email protected]> (supplier of updated analog package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Tue, 07 Apr 2009 20:44:46 +0100
Source: analog
Binary: analog
Architecture: source i386
Version: 2:6.0-19
Distribution: unstable
Urgency: low
Maintainer: Bradley Smith <[email protected]>
Changed-By: Bradley Smith <[email protected]>
Description:
analog - web server log analyzer
Closes: 522277
Changes:
analog (2:6.0-19) unstable; urgency=low
.
* Add Vcs-* fields.
* Add 01_bzip_reading.diff. Patch from
Andrew McCarthy <[email protected]>. Closes: #522277.
* Update Standards-Version to 3.8.1. (No changes).
Checksums-Sha1:
29823d7a6a2879965c2697d10ac7a9a966036ec6 1218 analog_6.0-19.dsc
c68728dc91a8e45aa52399b2c531a667640ca275 26086 analog_6.0-19.diff.gz
ca6881da9c11ca600630e02b486fa3a0ab20fab4 1367292 analog_6.0-19_i386.deb
Checksums-Sha256:
4b75cdf0a03e6329b8fc311fecb44ab7666191188e6207c2959582b8b0a7e798 1218
analog_6.0-19.dsc
246c3402eedf452128bd8d0b736f78bc5c71062ac754f026510215dd96fb1d12 26086
analog_6.0-19.diff.gz
513bb35729d1be72deedbe67419eabf5a8d82dec2cdd5c47422d477bedf35042 1367292
analog_6.0-19_i386.deb
Files:
a976f2a8111c71fcd280a63328136065 1218 web optional analog_6.0-19.dsc
40948647c8caa3cb095c948ad96f3140 26086 web optional analog_6.0-19.diff.gz
8cc34ab3b579cf9e064cc4c4d0d61e98 1367292 web optional analog_6.0-19_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAknbrjAACgkQj3BimscY00fA5QCfb/8RtQMjuq9berWrr5TL3CKk
BCIAnA81lFpU6UE9iGpqxMlf6lHY3kyO
=2FJX
-----END PGP SIGNATURE-----
--- End Message ---