Bug 744434

Summary: VTK should not be being built against both libGL and libOSMesa
Product: [Fedora] Fedora Reporter: Tyson Whitehead <twhitehead>
Component: vtkAssignee: Orion Poplawski <orion>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: axel.thimm, mrceresa, orion, tfogal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: vtk-5.6.1-10.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-19 04:33:36 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 Tyson Whitehead 2011-10-08 16:38:08 UTC
Description of problem:

The Fedora 14-16 VTK libraries is being compiled with VTK_OPENGL_HAS_OSMESA.  This causes it to link against both libGL and libOSMesa and creates a symbol  resolution issues where the GL context is only accessible in one of the libraries but functions may dispatch to the other as both export the gl* symbols.

Please see this thread I opened on the mesa users list for more details.

http://lists.freedesktop.org/archives/mesa-users/2011-October/000330.html

The long and short of it is that for VTK to use both libGL and OSMesa, OSMesa has to be compiled with name mangling and VTK has to be compiled use it that way by settings VTK_USE_MANGLED_MESA and not VTK_OPENGL_HAS_OSMESA.  The latter is only for if one wants to use only OSMesa by itself.

http://www.vtk.org/Wiki/VTK/OpenGL#Mesa.2C_Off_Screen_Mesa.2C_Mangled_Mesa

Currently VTK_USE_MANGLED_MESA has bitrotted though, so there is no way to use OSMesa alongside libGL.  Tom Fogal is working on reviving it as part of their work on VisIt, so this situation will likely be changing at some point again

http://www.vtk.org/pipermail/vtk-developers/2011-August/010250.html

Even once VTK supports mangled mesa again, it will not be able to be linked against the system libOSMesa as this libraries is not compiled with name mangling.  A custom mangled OSMesa library will have to be compiled instead.

Doing this for every package that wants to use libGL alongside mangled OSMesa is a pain/maintenance issue, so Tom has kindly volunteered to write some patches and submit them upstream in order to support building a libMangledOSMesa.

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

Fedora 14 and up (may be earlier as well, I haven't checked)

How reproducible:

Always

Steps to Reproduce:

1. Checkout our Orlando VTK visualization app from 

git clone git://github.com/patrickdemond/OVis.git
cd OVis

2. Build it on a stock Fedora 14.

mkdir build
cd build
cmake ..
make

3. Run the application

./ovis

Actual results:

It will segfault as the GL context will have not been created in the library the that the gl* functions are being dispatched to due to libOSMesa and libGL exporting several of the same symbols.

Expected results:

The applications should just run.  You can get this behavior by forcing libGL to be loaded first so all non-OSMesa* symbols resolve to it.

LD_PRELOAD=/usr/lib64/libGL.so ./ovis

Recompiling the vtk source package with --without-OSMesa resolves the issue.

Additional info:

Comment 1 tom fogal 2011-10-10 18:03:20 UTC
Said patch has been posted:

   http://lists.freedesktop.org/archives/mesa-dev/2011-October/013130.html

should come out with 7.12, if accepted.

Comment 2 Orion Poplawski 2011-10-10 18:08:35 UTC
I'm in the process of building some updates.  Thanks for the report.

Comment 3 Fedora Update System 2011-10-10 20:15:19 UTC
vtk-5.6.1-11.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/vtk-5.6.1-11.fc16

Comment 4 Fedora Update System 2011-10-10 20:15:33 UTC
vtk-5.6.1-10.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/vtk-5.6.1-10.fc14

Comment 5 Fedora Update System 2011-10-10 20:15:49 UTC
vtk-5.6.1-10.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/vtk-5.6.1-10.fc15

Comment 6 Fedora Update System 2011-10-11 02:59:02 UTC
Package vtk-5.6.1-11.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing vtk-5.6.1-11.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14113
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-10-19 04:33:36 UTC
vtk-5.6.1-11.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2011-10-20 09:58:22 UTC
vtk-5.6.1-10.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2011-10-20 09:59:40 UTC
vtk-5.6.1-10.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Tyson Whitehead 2011-10-27 16:25:27 UTC
Hope this doesn't re-open the ticket or anything, but I just wanted to let you know I've installed the new F14 VTK package and everything now works great.

Thanks very much!  -Tyson