[Insight-users] Sid broke my Applications

Gavin Baker gavinb+xtk at cs.mu.OZ.AU
Thu Nov 11 06:32:14 EST 2004


Howdy,

Skip to the %%% section if you want the short version. :)

On Thu, Nov 11, 2004 at 07:09:39PM +1100, Gavin Baker wrote:

> ... Something in that change has broken the InsightApplications for
> me, at least those that use FLTK (2).
> 
> What I get now is a segfault at XftCharIndex(), and looking at the
> stack trace it is where fl_draw() calls XftDrawString8() in response
> to a draw_label().  It seems a null font handle is being passed in,
> which is undesireable to say the least.

This eve I have been in dark places... I built a debug version of FLTK
and started digging around with GDB.  I narrowed it down to
XftFontOpen() failing in fl_font_xft.cxx:fontopen(...).  There was no
indication as to *why* it was failing.  A valid display handle is
presented, I validated all the parameters.  The exact same font code
works in another test harness (plain X code).

So I tried to build a simple app from the ground up, adding stuff
until it works.  But now it wouldn't fail.  I went back to the apps
that _were_ failing and looked at the extra libs.  ImageViewer was
working fine, it's nice and simple.  I took FastMarchingLevelSet and
ripped out half the UI until it depended only on FLTK.  This worked.
I added in the FltkImageViewer, and it still worked.  I added in the
VTK stuff - and it bombed.

I went back to my dead simple test app and added some simple VTK
calls.  If I just link in with VTKCommon and call
vtkVersion::GetVTKVersion(), it works.  If I so much as _link_ with
vtkRendering, that is when it dies.  Now looking at the results of
`ldd vtkRendering` I discover -- D'oh!

%%%

VTK 4.4 has its own Freetype library!  I normally build VTK to use all
the system libraries (eg. jpeg, tiff, etc) to avoid these sorts of
problems.  But it seems that if you enable VTK_USE_RENDERING (which
you kinda have to) then it pulls in vtkfreetype and vtkftgl from
Utilities as well.  And you don't see this when configuring CMake;
there's no choice.  This vtkfreetype somehow conflicts at runtime (*not*
at link time) with FLTK's freetype, and causes the font selection to
stop working.

Does this mean that VTK 4.4 is not compatible with FLTK under Unix
then?

whew...

  :: Gavin

-- 
Gavin Baker                                      Complex Systems Group
http://www.cs.mu.oz.au/~gavinb             The University of Melbourne


More information about the Insight-users mailing list