[vtk-developers] Patch to silence needless error message

Francois Bertel francois.bertel at kitware.com
Mon Mar 9 00:57:04 EDT 2009


Hi,

I applied a different patch. Instead of silently ignore an error, I
removed the cause of the error.

Comment:

BUG:GetDisplayId() had the side effect (and side effects are bad) to
open a connection to an X server (ie. allocate X resources like an X
event queue) if DisplayId was not existing. Notably, a symptom of this
side effect was that GetDisplayId() was emitting an error even if the
render window was set to render offscreen in a first place with OSMesa
and there was no X11 server running.

diff:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Rendering/vtkXOpenGLRenderWindow.cxx?r1=1.100&r2=1.101



On Sat, Mar 7, 2009 at 8:59 PM, Prabhu Ramachandran
<prabhu at aero.iitb.ac.in> wrote:
> Hi,
>
> Thanks for looking at this.
>
> On 03/07/09 23:47, Francois Bertel wrote:
>>
>> This fix looks wrong to me.
>>
>> If you use vtkXOpenGLRenderWindow.cxx, it means you use X11 for on
>> screen rendering and OSMesa when switching to offscreen. If you have
>> X11, XOpenDisplay should succeed in
>> vtkXOpenGLRenderWindow::GetDisplayId() even if you use OSMesa for
>> offscreen.
>
> If you ssh to a machine without X11 forwarding and run code that uses
> vtkXOpenGLRenderWindow, the XOpenDisplay call fails and does not cause any
> trouble apart from the error message, everything else works. Likewise if you
> don't have X11 there is a problem.
>
>> If you don't have X11, create an instance of
>> vtkOSOpenGLRenderWindow.cxx instead.
>
> Well, that would work but is a real pain (for example how would you run the
> test suite doing this?). Please look at this dashboard, you'll see the same
> exact warning indicating that vtkXOpenGLRenderWindow is used this way and
> works:
>
> http://www.cdash.org/CDash/testDetails.php?test=18416791&build=286623
>
> Notice the Test output prints the message the patch silences.
>
> cheers,
> prabhu
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtk-developers mailing list