POV-Ray : Newsgroups : povray.general : povray uses internal libpng function -- broken with new png library Server Time
29 Nov 2024 03:32:11 EST (-0500)
  povray uses internal libpng function -- broken with new png library (Message 1 to 7 of 7)  
From: Thomas Klausner
Subject: povray uses internal libpng function -- broken with new png library
Date: 6 May 2006 02:57:29
Message: <445c48d9@news.povray.org>
Hi!

povray-3.6.1, the Unix version, uses the png_write_finish_row()
function, which is a private (internal) function of the png library
and not provided by the current png version (1.2.10).

Linking thus fails with:
../source/libpovray.a(png_pov.o)(.text+0x161a): In function
`pov::PNG_Image::~PNG_Image()': undefined reference to
`png_write_finish_row'

Does someone have a patch for this?

Cheers,
 Thomas


Post a reply to this message

From: Christoph Hormann
Subject: Re: povray uses internal libpng function -- broken with new png library
Date: 6 May 2006 05:10:03
Message: <e3hp2s$mvb$1@chho.imagico.de>
Thomas Klausner wrote:
> Hi!
> 
> povray-3.6.1, the Unix version, uses the png_write_finish_row()
> function, which is a private (internal) function of the png library
> and not provided by the current png version (1.2.10).
> 
> Linking thus fails with:
> ../source/libpovray.a(png_pov.o)(.text+0x161a): In function
> `pov::PNG_Image::~PNG_Image()': undefined reference to
> `png_write_finish_row'

Well - you could remove that call but will probably loose ability to 
interrupt/continue render with PNG output.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 04 May. 2006)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Nicolas Calimet
Subject: Re: povray uses internal libpng function -- broken with new png library
Date: 6 May 2006 06:52:57
Message: <445c8009$1@news.povray.org>
> povray-3.6.1, the Unix version, uses the png_write_finish_row()
> function, which is a private (internal) function of the png library
> and not provided by the current png version (1.2.10).

	You don't need a patch for now.  Rather, just force POV-Ray to
build and link with the libraries provided in the source archive, using
the  --disable-lib-checks  configure option.  Those libs are the versions
that were used along the POV-Ray development.

	Anyway, thanks for the report.  If possible, POV should not use any
function that is supposed to be internal to the library (if those were
really "private", POV could not use them anyway: somehow the lib itself
was not cleanly designed).

	- NC


Post a reply to this message

From: Thomas Klausner
Subject: Re: povray uses internal libpng function -- broken with new png library
Date: 6 May 2006 07:59:24
Message: <445c8f9c@news.povray.org>
Nicolas Calimet <pov### [at] freefr> wrote:
> > povray-3.6.1, the Unix version, uses the png_write_finish_row()
> > function, which is a private (internal) function of the png library
> > and not provided by the current png version (1.2.10).

>         You don't need a patch for now.  Rather, just force POV-Ray to
> build and link with the libraries provided in the source archive, using
> the  --disable-lib-checks  configure option.  Those libs are the versions
> that were used along the POV-Ray development.

Well, that's not really a solution. pkgsrc makes all packages
use one png package instead of tens of different internal copies
so that e.g. vulnerabilities or platform fixes have to be applied
only in one place.

>         Anyway, thanks for the report.  If possible, POV should not use any
> function that is supposed to be internal to the library (if those were
> really "private", POV could not use them anyway: somehow the lib itself
> was not cleanly designed).

If you could come up with a patch for that, I'd appreciate it.
For now, I'll probably use the following patch:
--- source/png_pov.cpp.orig     2004-08-02 23:11:37.000000000 +0000
+++ source/png_pov.cpp
@@ -107,9 +107,6 @@ extern "C"
        void png_pov_write_data(png_structp, png_bytep, png_size_t);
        void png_pov_flush_data(png_structp);

-       // This is an internal function for libpng
-       void png_write_finish_row(png_structp);
-

        /***********************************************************************
******
        *
@@ -782,7 +779,6 @@ PNG_Image::~PNG_Image()
       {
          // finished prematurely - trick into thinking done
          png_ptr->num_rows = png_ptr->row_number;
-         png_write_finish_row(png_ptr);
       }

 #ifdef POV_COMMENTS // temporarily skip comment writing code

(whitespace is probably broken in this patch, since I cut'n'pasted it)

Cheers,
 Thomas


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: povray uses internal libpng function -- broken with new png library
Date: 6 May 2006 09:17:08
Message: <445ca1d4$1@news.povray.org>
Thomas Klausner wrote:
>>        You don't need a patch for now.  Rather, just force POV-Ray to
>>build and link with the libraries provided in the source archive, using
>>the  --disable-lib-checks  configure option.  Those libs are the versions
>>that were used along the POV-Ray development.
> 
> Well, that's not really a solution. pkgsrc makes all packages
> use one png package instead of tens of different internal copies
> so that e.g. vulnerabilities or platform fixes have to be applied
> only in one place.

Please use the libraries that are supplied with POV-Ray as they are known to 
work properly due to extensive testing. If you insist on using a newer 
version of the libraries, the proper functioning of POV-Ray is not 
guaranteed by any means, and you would be on your own if there are any 
problems. Clearly, as you have noticed, there are changes in the libraries 
you are using, so you are already having problems...

So, *please* use what you are told to use, anything else is absolutely, 
completely and without restrictions *unsupported*. POV-Ray is not qualified 
for server use, and should not be exposed to untrusted users! There are no 
exceptions to this recommendation. As such, your argument about security 
completely misses the point! Please use the libraries supplied with POV-Ray, 
as they create a reliable version of POV-Ray that will *work* properly and 
be usable without problems. If you need to worry about library-level 
security problems in POV-Ray, your security settings are already inadequate.

What you are currently trying to do is similar to putting on a bullet proof 
vest, and then start shooting yourself in the foot. Clearly, not something 
you want to do! ;-)

	Thorsten Froehlich, POV-Team


Post a reply to this message

From: Thomas Klausner
Subject: Re: povray uses internal libpng function -- broken with new png library
Date: 7 May 2006 11:55:32
Message: <445e1874@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> Thomas Klausner wrote:
> >>        You don't need a patch for now.  Rather, just force POV-Ray to
> >>build and link with the libraries provided in the source archive, using
> >>the  --disable-lib-checks  configure option.  Those libs are the versions
> >>that were used along the POV-Ray development.
> > 
> > Well, that's not really a solution. pkgsrc makes all packages
> > use one png package instead of tens of different internal copies
> > so that e.g. vulnerabilities or platform fixes have to be applied
> > only in one place.

> Please use the libraries that are supplied with POV-Ray as they are known to 
> work properly due to extensive testing. If you insist on using a newer 
> version of the libraries, the proper functioning of POV-Ray is not 
> guaranteed by any means, and you would be on your own if there are any 
> problems. Clearly, as you have noticed, there are changes in the libraries 
> you are using, so you are already having problems...

At some point in the future you'll probably want to tackle this
problem. I just thought it might be possible to get this solved
now and not sometime in the future.
 Thomas


Post a reply to this message

From: Christoph Hormann
Subject: Re: povray uses internal libpng function -- broken with new png library
Date: 7 May 2006 12:35:03
Message: <e3l7dr$t8b$1@chho.imagico.de>
Thomas Klausner wrote:
> 
> At some point in the future you'll probably want to tackle this
> problem. I just thought it might be possible to get this solved
> now and not sometime in the future.
>  Thomas

It is good that you pointed out this problem.  As i explained however 
the function in question is only used for interrupted/partial renders. 
The long term solution for this will be to handle this independent from 
the output file format.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 04 May. 2006)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

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