🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bionet.software.acedb
Article #68

Re: Off-by-one in $obj->asGif after upgrading to ACEDB_4.9s

#68
From: Morten Hulden
Date: Wed, 10 Sep 2003 10:21
38 lines
2891 bytes
On Tue, 9 Sep 2003, Ed Griffiths wrote:

> > After upgrading to ACEDB_4.9s, sgifserver seems to provide gif-images
> > where the first byte is NULL and the last byte is dropped.
> > 
> > AcePerl now outputs faulty gifs with the obj->asGif method (Object.pm). As
> > AcePerl has not changed, and giface client produces good gifs I assume
> > something changed in sgifserver. Anyone else seen this?
> > 
> > I also tested 4.9u with same results.
> > Compiled with gcc 3.2.2 on Linux RH9, -O2/-03 optimation.
> 
> I have looked into this and its been caused by a change to a low level routine
> in acedb changing which resulted in a null byte being inserted in front of the
> GIF image in the datastream. I think you see the last byte dropped because the
> aceperl code is now one byte out.
> 
> I am checking with Lincoln what we should do about this, the null byte in the
> datastream makes some sense in fact so the answer may be to change the aceperl
> code to handle it.

In that case, as already posted on this list, following patch to 
Ace::Object.pm will do the job:

Object.pm line 1764, Aceperl 1.86:
- return unless ($bytes, $trim) = $data=~m!^// (\d+) bytes\n(.+)!sm;
+ return unless ($bytes, $trim) = $data=~m!^// (\d+) bytes\n\x0?(.+)!sm;

Not necessary strictly correct place to strip the extra NULL-byte here,
just before output, but it works and I can now use versions of AceDB >=
4.9_s.

(Because of Perl autosplit, the patch should be made in the AcePerl 
source tree, which should then be reinstalled.)

rgds
Morten
Technical Details
Message-ID: <Pine.LNX.4.44.0309091750320.22135-100000@untamo.ngb.se>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!hgmp.mrc.ac.uk!net.bio.net

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6d40,196502b48d6a5094
X-Google-Attributes: gidf6d40,public
X-Google-ArrivalTime: 2003-09-10 03:21:27 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!hgmp.mrc.ac.uk!net.bio.net
From: Morten Hulden <morten@ngb.se>
Newsgroups: bionet.software.acedb
Subject: Re: Off-by-one in $obj->asGif after upgrading to ACEDB_4.9s
Date: 10 Sep 2003 11:21:22 +0100
Organization: BIOSCI/MRC Human Genome Mapping Project Resource Centre
Lines: 41
Sender: mod-ace@hgmp.mrc.ac.uk
Approved: BIOSCI Approval Key <biosci-approval-key@net.bio.net>
Message-ID: <Pine.LNX.4.44.0309091750320.22135-100000@untamo.ngb.se>
NNTP-Posting-Host: mercury.hgmp.mrc.ac.uk
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: niobium.hgmp.mrc.ac.uk 1063189287 136 193.62.192.80 (10 Sep 2003 10:21:27 GMT)
X-Complaints-To: news@net.bio.net
NNTP-Posting-Date: Wed, 10 Sep 2003 10:21:27 +0000 (UTC)
X-Original-To: bionet-software-acedb@net.bio.net
X-Auth: PGPMoose V1.1 PGP bionet.software.acedb
 iQCVAwUAP177IKCIqsWvyF5FAQEJgQP+LIT9K+RUR4ZASu6JdCPuSbbzKc2zmBEJ
 oXmAaCz73LWbMS9Nt6SXs5A/98I2jryNHX0iUNnBSS1PNdPFa8r/PgbxfptwR7CD
 Ikf4Pz7QMY1XFKjpzb2CnEor66x9kJdUpmXat0BoUciI+fVr04Y2NtKEq0bvM6QV
 ztXKtFKJZ7M=
 =CMJn