Your message dated Wed, 05 Oct 2005 03:17:08 -0700
with message-id <[EMAIL PROTECTED]>
and subject line Bug#275769: fixed in sdlperl 1.20.3-2
has caused the attached Bug report 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 I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 10 Oct 2004 06:40:39 +0000
>From [EMAIL PROTECTED] Sat Oct 09 23:40:39 2004
Return-path: <[EMAIL PROTECTED]>
Received: from adsl-69-110-115-185.dsl.pltn13.pacbell.net 
(bowser.home.broadwell.org) [69.110.115.185] 
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1CGXNn-0003DH-00; Sat, 09 Oct 2004 23:40:39 -0700
Received: from mrboots.home.broadwell.org ([172.30.1.21])
        by bowser.home.broadwell.org with esmtp (Exim 3.35 #1 (Debian))
        id 1CGWla-00078W-00; Sat, 09 Oct 2004 23:01:10 -0700
Mime-Version: 1.0 (Apple Message framework v619)
To: [EMAIL PROTECTED]
Message-Id: <[EMAIL PROTECTED]>
Content-Type: multipart/mixed; boundary=Apple-Mail-3-971607859
Cc: Geoffrey Broadwell <[EMAIL PROTECTED]>
Subject: Erroneous use of SvNOK and off-by-one error in sdlperl OpenGL.xs
From: Geoffrey Broadwell <[EMAIL PROTECTED]>
Date: Sat, 9 Oct 2004 23:40:08 -0700
X-Mailer: Apple Mail (2.619)
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.5 required=4.0 tests=BAYES_10,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 


--Apple-Mail-3-971607859
Content-Type: multipart/alternative;
        boundary=Apple-Mail-4-971607860


--Apple-Mail-4-971607860
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
        charset=US-ASCII;
        format=flowed

Package: sdlperl
Version: 1.20.3-1
Tags: patch

See below snippets from email exchange with package maintainer.  I've 
attached a patch for the cases of the bugs that I could find, but it 
has only had limited testing.


-'f


--Apple-Mail-4-971607860
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
        charset=US-ASCII

Package: sdlperl

Version: 1.20.3-1

Tags: patch


See below snippets from email exchange with package maintainer.  I've
attached a patch for the cases of the bugs that I could find, but it
has only had limited testing.



-'f



--Apple-Mail-4-971607860--

--Apple-Mail-3-971607859
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
        x-unix-mode=0600;
        name="SvNOK-fencepost.patch"
Content-Disposition: attachment;
        filename=SvNOK-fencepost.patch

diff -Naur sdlperl-1.20.3/OpenGL.xs sdlperl-1.20.3.patched/OpenGL.xs
--- sdlperl-1.20.3/OpenGL.xs    2003-04-03 08:58:08.000000000 -0800
+++ sdlperl-1.20.3.patched/OpenGL.xs    2004-10-09 22:04:43.000000000 -0700
@@ -585,7 +585,7 @@
                int i;
                double mat[16];
                for ( i = 0; i < 16; i++ ) {
-                       mat[i] = (i < items  && SvNOK(ST(i)) ? SvNV(ST(i)) : 
0.0 );
+                       mat[i] = i < items ? SvNV(ST(i)) : 0.0;
                }
                glLoadMatrixd(mat);
 
@@ -595,7 +595,7 @@
                int i;
                double mat[16];
                for ( i = 0; i < 16; i++ ) {
-                       mat[i] = (i < items  && SvNOK(ST(i)) ? SvNV(ST(i)) : 
0.0 );
+                       mat[i] = i < items ? SvNV(ST(i)) : 0.0;
                }
                glMultMatrixd(mat);
 
@@ -679,7 +679,7 @@
                double v[4];
                int i;
                for (i = 0; i < 4; i++ ) {
-                       v[i] = (i+1 < items && SvNOK(ST(i+1))) ? SvNV(ST(i+1)) 
: 0.0;
+                       v[i] = i+1 < items ? SvNV(ST(i+1)) : 0.0;
                }
                glClipPlane(plane,v);
        
@@ -718,13 +718,13 @@
                if ( items == 6 ) {
                        float v[4];     
                        for ( i = 0; i < 4; i++ ) {
-                               v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0;
+                               v[i] = SvNV(ST(i+2));
                        }
                        glLightfv(light,name,v);        
                } else if ( items == 5 ) {
                        float v[3];
                        for ( i = 0; i < 3; i++ ) {
-                               v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0;
+                               v[i] = SvNV(ST(i+2));
                        }
                        glLightfv(light,name,v);        
                } else if ( items == 3 ) {
@@ -749,7 +749,7 @@
        }
       for ( i = 0; i < 4; i++ )
         {
-       v[i] = (SvNOK(ST(i+1))) ? SvNV(ST(i+1)) : 0.0;
+       v[i] = SvNV(ST(i+1));
         }
       glLightModelfv (name, v);
       }
@@ -775,13 +775,13 @@
                if ( items == 6 ) {
                        float v[4];
                        for ( i = 0; i < 4; i++ ) {
-                               v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0;
+                               v[i] = SvNV(ST(i+2));
                        }
                        glMaterialfv(face,name,v);
                } else if ( items == 5 ) {
                        float v[3];
-                       for ( i = 0; i < 4; i++ ) {
-                               v[i] = (SvNOK(ST(i+2))) ? SvNV(ST(i+2)) : 0.0;
+                       for ( i = 0; i < 3; i++ ) {
+                               v[i] = SvNV(ST(i+2));
                        }
                        glMaterialfv(face,name,v);
                } else if ( items == 3 ) {      

--Apple-Mail-3-971607859
Content-Type: multipart/alternative;
        boundary=Apple-Mail-5-971607861


--Apple-Mail-5-971607861
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
        charset=US-ASCII;
        format=flowed



> From: Geoffrey Broadwell <[EMAIL PROTECTED]>
>
> It turns out that the first bug is worse than I thought.  This command 
> will show the problem:
>
>       perl -MDevel::Peek -e '$a = 0.0; $b = 0.0; $c = $a + $b; foreach ($a, 
> $b, $c) {Dump $_}'
>
> Yes, that's right -- NV + NV = IV, if you're unlucky.  And that 
> demotion makes it damn tricky to get some of the GL functions to work 
> reliably (the ones that do SvNOK() on their arguments).
>
>>      * Several functions spuriously check SvNOK(ST(i)) before attempting 
>> SvNV(ST(i)).  That not only adds an unnecessary step, but any IV or 
>> UV that had never been used in a floating-point context (and thereby 
>> been upgraded) will fail to convert; the OpenGL.xs code generally 
>> defaults 0.0 in this case.  This problem is evident when, for 
>> instance, setting light parameters with glLight.  If you try to set  
>> a light color to be white using (1, 1, 1, 1), you'll get black 
>> instead.  However, (1.0, 1.0, 1.0, 1.0) will work.
>>      * Several functions whose C-level equivalents require a pointer to 
>> an array allow a normal argument list at the Perl level, and create 
>> the array pointer by allocating a local array of fixed dimension, and 
>> then filling it from the Perl stack using a loop.  However, in some 
>> places, the loop and the array size don't match.  For example, the 
>> second case for Material allocates a 3-element array, and then loops 
>> 4 times to fill it.

--Apple-Mail-5-971607861
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
        charset=US-ASCII




<excerpt><bold><color><param>0000,0000,0000</param>From:
</color></bold>Geoffrey Broadwell <<[EMAIL PROTECTED]>


It turns out that the first bug is worse than I thought.  This command
will show the problem:


        perl -MDevel::Peek -e '$a = 0.0; $b = 0.0; $c = $a + $b; foreach ($a,
$b, $c) {Dump $_}'


Yes, that's right -- NV + NV = IV, if you're unlucky.  And that
demotion makes it damn tricky to get some of the GL functions to work
reliably (the ones that do SvNOK() on their arguments).


<excerpt>       * Several functions spuriously check SvNOK(ST(i)) before
attempting SvNV(ST(i)).  That not only adds an unnecessary step, but
any IV or UV that had never been used in a floating-point context (and
thereby been upgraded) will fail to convert; the OpenGL.xs code
generally defaults 0.0 in this case.  This problem is evident when,
for instance, setting light parameters with glLight.  If you try to
set  a light color to be white using (1, 1, 1, 1), you'll get black
instead.  However, (1.0, 1.0, 1.0, 1.0) will work.

        * Several functions whose C-level equivalents require a pointer to an
array allow a normal argument list at the Perl level, and create the
array pointer by allocating a local array of fixed dimension, and then
filling it from the Perl stack using a loop.  However, in some places,
the loop and the array size don't match.  For example, the second case
for Material allocates a 3-element array, and then loops 4 times to
fill it.

</excerpt></excerpt>
--Apple-Mail-5-971607861--

--Apple-Mail-3-971607859--


---------------------------------------
Received: (at 275769-close) by bugs.debian.org; 5 Oct 2005 10:18:23 +0000
>From [EMAIL PROTECTED] Wed Oct 05 03:18:23 2005
Return-path: <[EMAIL PROTECTED]>
Received: from katie by spohr.debian.org with local (Exim 3.36 1 (Debian))
        id 1EN6Ki-0003Hi-00; Wed, 05 Oct 2005 03:17:08 -0700
From: Sam Hocevar (Debian packages) <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
X-Katie: $Revision: 1.56 $
Subject: Bug#275769: fixed in sdlperl 1.20.3-2
Message-Id: <[EMAIL PROTECTED]>
Sender: Archive Administrator <[EMAIL PROTECTED]>
Date: Wed, 05 Oct 2005 03:17:08 -0700
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02

Source: sdlperl
Source-Version: 1.20.3-2

We believe that the bug you reported is fixed in the latest version of
sdlperl, which is due to be installed in the Debian FTP archive:

libsdl-perl_1.20.3-2_i386.deb
  to pool/main/s/sdlperl/libsdl-perl_1.20.3-2_i386.deb
sdlperl_1.20.3-2.diff.gz
  to pool/main/s/sdlperl/sdlperl_1.20.3-2.diff.gz
sdlperl_1.20.3-2.dsc
  to pool/main/s/sdlperl/sdlperl_1.20.3-2.dsc



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.
Sam Hocevar (Debian packages) <[EMAIL PROTECTED]> (supplier of updated sdlperl 
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.7
Date: Wed,  5 Oct 2005 10:37:08 +0200
Source: sdlperl
Binary: libsdl-perl
Architecture: source i386
Version: 1.20.3-2
Distribution: unstable
Urgency: low
Maintainer: Sam Hocevar (Debian packages) <[EMAIL PROTECTED]>
Changed-By: Sam Hocevar (Debian packages) <[EMAIL PROTECTED]>
Description: 
 libsdl-perl - SDL bindings for the Perl language
Closes: 275769 297532 297533 303703 319955 320548 322435
Changes: 
 sdlperl (1.20.3-2) unstable; urgency=low
 .
   * Acknowledge NMU by Graham Wilson (Closes: #320548, #322435). Thank you.
   * debian/control:
     + Set policy to 3.6.2.1.
     + Build-depend on libpng12-dev (Closes: #303703).
   * debian/copyright:
     + Updated the FSF address.
   * Makefile.PL:
     + Support for GNU/kFreeBSD, thanks to Aurélien Jarno (Closes: #319955).
   * OpenGL.xs:
     + Applied patch by Geoffrey Broadwell for erroneous use of SvNOK and an
       off-by-one error (Closes: #275769).
     + Re-enabled GLU NURBS (Closes: #297532).
   * test/OpenGL/tutorial:
     + Brought OpenGL tutorial samples in sync with the API (Closes: #297533).
Files: 
 421c935f6c97b981cf83292e5a43f399 837 perl optional sdlperl_1.20.3-2.dsc
 ba9cd30ade75eb5a5ef956e0901f95ba 13290 perl optional sdlperl_1.20.3-2.diff.gz
 0c1972767edd8f22c0fb0a5f9089fadd 906194 perl optional 
libsdl-perl_1.20.3-2_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDQ6VCfPP1rylJn2ERApRbAJ9V7uoqlNhQuEB+C4r7IWVsqHO8XgCcCWIH
mngTFG4rBFryb5F7xgAuuSA=
=uFAK
-----END PGP SIGNATURE-----


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to