Hi Regina,

On 15.08.2013 11:26, Regina Henschel wrote:
Hi Oliver,

Oliver-Rainer Wittmann schrieb:
Hi,

On 15.08.2013 10:10, Regina Henschel wrote:
Hi Oliver,

Oliver-Rainer Wittmann schrieb:
Hi,

Herbert, Andre and myself had a closer look on the error log of the
recent Linux 32bit build bot build (#456) and at the corresponding
code.
It seems that there is a programming error in method
<SvgSvgNode::getCurrentViewPort()>.

I am working on it.

Please tell me, what is the problem there. I wrote it.


What Herbert, Andre and myself have figured out is the following:
Error message from Linux 32bit build bot says:
/home/buildslave20/slave20/openoffice-linux32-nightly/build/main/svgio/source/svgreader/svgsvgnode.cxx:

In member function 'virtual const basegfx::B2DRange*
svgio::svgreader::SvgSvgNode::getCurrentViewPort() const':
/home/buildslave20/slave20/openoffice-linux32-nightly/build/main/svgio/source/svgreader/svgsvgnode.cxx:636:71:

error: taking address of temporary [-fpermissive]
/home/buildslave20/slave20/openoffice-linux32-nightly/build/main/svgio/source/svgreader/svgsvgnode.cxx:679:75:

error: taking address of temporary [-fpermissive]
/home/buildslave20/slave20/openoffice-linux32-nightly/build/main/svgio/source/svgreader/svgsvgnode.cxx:698:67:

error: taking address of temporary [-fpermissive]
make: ***
[/home/buildslave20/slave20/openoffice-linux32-nightly/build/main/solver/400/unxlngi6.pro/workdir/CxxObject/svgio/source/svgreader/svgsvgnode.o]

Error 1

The corresponding code line are:
- 636: return &basegfx::B2DRange(fX, fY, fX+fW, fY+fH);
- 679: return &basegfx::B2DRange(fX, fY, fX+fW, fY+fH);
- 698: return &basegfx::B2DRange(0.0, 0.0, fW, fH);
Thus, a pointer to a temporary created object is returned here and the
return type of this method is <basegfx::B2DRange*>. The life time of
such an object ends when the method ends. Thus, accessing the returned
pointer outside the method means accessing 'dead' memory.

Sorry, MS compiler not even gave a warning. I'm not experienced and
still struggling with C++. Therefore I had ask for review. Sadly it
slipped through. If you knew a solution, I would be happy.

I suggest, you replace the method getCurrentViewport with the previous
version of it. The crash has happened in method decomposeSvgNode and the
solution there is independent of method getCurrentViewport.

In content the method getCurrentViewport has to return 4 double values,
which are calculated inside the method. Changing it that way, would
result in a change in signature with deep impact on the whole class. I
think, a solutions needs to be discussed with Armin. But as far as I
know, Armin is now in vacation.


Please have a look at the corresponding issue 122600 and its mail thread - I have attached a solution.

Best regards, Oliver.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org

Reply via email to