POV-Ray : Newsgroups : povray.beta-test : crash in origin/master : Re: crash in origin/master Server Time
29 Apr 2024 02:07:44 EDT (-0400)
  Re: crash in origin/master  
From: William F Pokorny
Date: 13 Feb 2017 11:15:55
Message: <58a1dbbb$1@news.povray.org>
On 02/13/2017 06:35 AM, William F Pokorny wrote:
>
> FYI.
>
> Took an initial look and at, at least for the Ubuntu gnu debug compiles
> I have handy and current, I do not get the seg fault where the
> equivalent normal compile fails... Maybe an optimization tangled issue?
>
> I had a few existing normally compiled binaries handy from previous
> specific commits. The last that worked for me was commit 7d06e7f, Fri
> Sep 9 09:50:47 2016 +0200. The first that failed was commit c6a6e98, Dec
> 20 13:55:46 2016 +0100.
>
> I'll have to step out for a while, but I'll plan to pick this up later
> this morning after checking in here.
>
> Bill P.
>

OK. The trigger for this segmentation fault seems to be commit: c52c176 
"Implemented basic Wavefront OBJ import. (#90)" where we also made 
changes to:

source/core/bounding/boundingbox.cpp

and

source/core/bounding/boundingbox.h

The specific trigger is a change in a find_axis() for loop where the 
problem additions have been commented so things work:

     for(i = first; i < last; i++)
     {
         bbox = &(Finite[i]->BBox);

         if(bbox->lowerLeft[X] < mins[X])
             mins[X] = bbox->lowerLeft[X];

         if(bbox->lowerLeft[X] + bbox->size[X] > maxs[X])
             maxs[X] = bbox->lowerLeft[X]; // + bbox->size[X]; // <--

         if(bbox->lowerLeft[Y] < mins[Y])
             mins[Y] = bbox->lowerLeft[Y];

         if(bbox->lowerLeft[Y] + bbox->size[Y] > maxs[Y])
             maxs[Y] = bbox->lowerLeft[Y]; // + bbox->size[Y]; // <--

         if(bbox->lowerLeft[Z] < mins[Z])
             mins[Z] = bbox->lowerLeft[Z];

         if(bbox->lowerLeft[Z] + bbox->size[Z] > maxs[Z])
             maxs[Z] = bbox->lowerLeft[Z]; // + bbox->size[Z]; // <--
     }

I see no difference in results, but I do not know the bounding code well 
enough to know if just backing the above additions from c52c176 is safe.

The secondary bit of this tangle is needing -O2 or -O3 compiles with 
both the gnu compiler and clang to get the crash.

I found compiling everything normally with -03 then selectively 
re-compiling the files in just the source/backend/scene with -O makes 
the seg fault go away, but I am at a loss as to why.

The only code therein looking to be tangled with the bounding structure is:

view.cpp:bool View::CheckCameraHollowObject(const Vector3d& point, const 
BBOX_TREE *node)

which is in fact the code Dick saw in his fails.

Lastly, I've not been able to get a debug compile of any form to fail 
for me.

Where do we go from here with this one?

Regards, Bill P.


Post a reply to this message

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