Bug 197941

Summary: OpenSceneGraph fails on 3ds files
Product: [Fedora] Fedora Reporter: Rene van Paassen <m.m.vanpaassen>
Component: OpenSceneGraphAssignee: Ralf Corsepius <rc040203>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: extras-qa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.2-1.fc5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-01 05:26:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rene van Paassen 2006-07-07 14:49:28 UTC
Description of problem:

openscenegraph fails when trying to load a 3ds file

Version-Release number of selected component (if applicable):


How reproducible:

take 3ds file terrain.3ds from delta3d data package, and try

osgviewer terrain.3ds

Steps to Reproduce:
1.
2.
3.
  
Actual results:

Warning:: Picked up error in TriangleIntersect
   (330.151 57.2903 5445.48,    343.484 58.24 5672.46,  330.151 56.3407 5444.31)
  (nan,        nan,    nan)
Warning:: Picked up error in TriangleIntersect
   (343.484 58.24 5672.46,      343.484 57.2903 5672.07,        330.151 56.3407
5444.31)
   (nan,        nan,    nan)


Expected results:

3d terrain view

Additional info:

The bug is, IMHO, actually a g++ bug. See the more extensive description of
#197349. Am filing it here too, so a temporary fix on OpenSceneGraph package can
be made

Comment 1 Ralf Corsepius 2006-07-10 10:14:12 UTC
I can reproduce the "TriangleIntersect" bug, I can not confirm your observation
on g++. For me, using gcc-4.1.1-6, the "TriangleIntersect" bug is reproducable
with both "-g" and ".g -O2".

I am inclined to think the cause is a real functional/algorithmic bug in OSG,
causing divisions by zero (the nans in your log above).


Comment 2 René van Paassen 2006-11-28 09:07:58 UTC
I learned something in the meantime. 

The problem is strict aliasing rules. Adding the option -fno-strict-aliasing
creates a workable RPM. Of course, this is not a permanent solution, but for now
it will do. Also OpenSceneGraph 1.1 has the problem. 

Proposed change to spec file:

# Propagate RPM_OPT_FLAGS
  echo "OPTF = $RPM_OPT_FLAGS -fno-strict-aliasing" >> $dir/Make/makedefs



Comment 3 Ralf Corsepius 2006-11-28 10:33:39 UTC
(In reply to comment #2)
> I learned something in the meantime. 
Thanks for reminding me about his PR, I already had almost forgotten about it :(

> The problem is strict aliasing rules.
Hmm, -fstrict-aliasing is a fairly popular excuse, these days. In 90% of all
cases, I have been struggling with it [1], in the end, the cause had been
something else and not -fstrict-aliasing ;)

[1] I am currently struggling with it in another project

> Adding the option -fno-strict-aliasing
> creates a workable RPM. Of course, this is not a permanent solution, 
> but for now
> it will do. Also OpenSceneGraph 1.1
So, am I correct in presuming you tried it?
Which architecture and which version of Fedora are you currently using?

I'll try to reproduce your issue on fc6/i386 and check if -fno-strict-aliases
fixes it ... If yes, I'll probably apply your "hack".

Comment 4 Ralf Corsepius 2006-11-28 15:44:11 UTC
(In reply to comment #3)
> Which architecture and which version of Fedora are you currently using?
> 
> I'll try to reproduce your issue on fc6/i386 and check if -fno-strict-aliases
> fixes it ... If yes, I'll probably apply your "hack".
I can't reproduce the original problem with terrain.3ds w/ OpenSceneGraph-1.2 on
fc6/i386. So either this issue must have been fixed in GCC or in OpenSceneGraph-1.2.

Réné should you be using FC5, could you try to rebuild FE6's OpenSceneGraph-1.2
rpm and try to reproduce the error (I don't have a system running FC5 anymore)?
If this should fix your issue, I would be willing to take the plunge and upgrade
fc5 to OpenSceneGraph-1.2, a step I so far had hesitated to do.

Comment 5 Rene van Paassen 2006-11-29 07:34:12 UTC
Have rebuilt the fc6 OpenSceneGraph-1.2 for fc5, and bug is indeed gone. I would
say go ahead and create an fc5 OpenSceneGraph-1.2 

Comment 6 Ralf Corsepius 2006-12-01 05:26:22 UTC
(In reply to comment #5)
> Have rebuilt the fc6 OpenSceneGraph-1.2 for fc5, and bug is indeed gone. I would
> say go ahead and create an fc5 OpenSceneGraph-1.2 

OK, I went ahead and pushed OpenSceneGraph-1.2 into fc5 ;)