POV-Ray : Newsgroups : povray.general : Bug verification: POV-Ray crashes if values are to long : Re: Bug verification: POV-Ray crashes if values are to long Server Time
9 Aug 2024 21:16:08 EDT (-0400)
  Re: Bug verification: POV-Ray crashes if values are to long  
From: Peter J  Holzer
Date: 30 Apr 2000 10:02:04
Message: <slrn8goen0.jea.hjp-usenet@teal.h.hjp.at>
On Fri, 28 Apr 2000 19:10:36 +0200, Manuel Moser wrote:
>I found the following bug by testing POV-Ray's behavior on very large or
>very small values. If a value has more than 125 characters you'll get an
>error message "String to long". That is OK. But in some versions (see
>below) 
>POV-Ray crashes (see also below) if you try to parse a value with a few
>characters less than 126. For Example:
>
>#declare a = 
>12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
>
>It also happens when you put this into an #if (0=1) directive.
>I found the problem in the following versions marked with yes and didn't
>found it in the others: 
>
[...]
>  
>I found it already in an 3.0 Windows version but I don't remember which
>one.
>Can you try if you can duplicate the crash with your version.

Doesn't crash on Linux (RH 6.1, Povray compiled by myself), Solaris and
HP-UX. Also the code looks ok (Read_Float just copies to string to a
buffer which is correctly terminated and then calls sscanf).

>I suppose it happens only with the wat compiles.

I suspect that this is a bug in Watcom's sscanf implementation. You may
try to compile and run this program, and see if it crashes, too:

#include <stdio.h>

int main(void) {
    double d;
   
sscanf("12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345",
	   "%lf", &d);
    printf("%f\n", d);
    return 0;
}

	hp

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.