On Wed, Mar 19, 2008 at 9:51 PM, Hazen Babcock <[EMAIL PROTECTED]> wrote:
> Agreed, but the segfault occurs because I did not think to check the
> return value of the function pango_cairo_create_layout(). It should
> return a pointer to a PangoLayout, but when it fails, as it does in
> our test case, it returns NULL. The program crashes when this null
> pointer is passed to the next function which expects a valid
> PangoLayout pointer. I can add a test for this and the program will
> no longer segfault, but this does not solve the problem of why
> pango_cairo_create_layout() is failing in the first place. Presumably
> it is trying to tell us something with the message:
> (process:10860): GLib-GObject-WARNING **: cannot register existing
> type `PangoCairoFcFontMap'
> Or maybe this could just mean that at some other point we are
> overwriting some crucial bit of memory?
> Unfortunately I have not been able to trigger this bug using a simple
> cairo/pango program that contains just the apparently problematic
> function calls.

While testing trying to patch the recently discussed multiple output
streams with the same driver bug I found something that is possibly
useful for diagnosing this Cairo segmentation fault issue, and
certainly useful as a workaround otherwise.  If plend is only called
after all plotting is complete and calls to plend1 are used between
plots then no segfaults seem to occur.


plsdev "xcairo"
plinit ()
plenv 0.0 1.0 0.0 1.0 1 0
plend1 ()
plsdev "xcairo"
plinit ()
plenv 0.0 1.0 0.0 1.0 1 0
plend1 ()
plend ()

In this case, no segfault occurs on my system (Ubuntu Hardy, 64bit,
latest PLplot SVN).  The segfault still occurs if I replace the
"plend1" calls with "plend".

Hope this helps, either as an indicator of where the problem
originates or simply as a relatively simple workaround.


Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Plplot-devel mailing list

Reply via email to