Bug 5560 - Accessing Cairo.Context.FontMatrix throws a SEGV on OSX Lion
Summary: Accessing Cairo.Context.FontMatrix throws a SEGV on OSX Lion
Alias: None
Product: Class Libraries
Classification: Mono
Component: Mono.Cairo ()
Version: 2.10.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-06-06 20:36 UTC by Jeff Kesselman
Modified: 2018-03-13 11:07 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jeff Kesselman 2012-06-06 20:36:30 UTC
Any attempt to read Cairo.Context.FontMatrix on OSX Lion throws a SEGV like the following:


Native stacktrace:

    0   mono                                0x000b6ea9 mono + 745129
    1   mono                                0x00006e0e mono + 24078
    2   libsystem_c.dylib                   0x949e259b _sigtramp + 43
    3   ???                                 0xffffffff 0x0 + 4294967295
    4   mono                                0x000b4e32 mono + 736818
    5   mono                                0x000b7ac4 mono + 748228
    6   mono                                0x000b8e18 mono + 753176
    7   mono                                0x00107a02 mono + 1075714
    8   ???                                 0x0035e2c1 0x0 + 3531457
    9   ???                                 0x003d9a18 0x0 + 4037144
    10  ???                                 0x0a20deb0 0x0 + 169926320

Debug info from gdb:

/tmp/mono-gdb-commands.ulVxAb:1: Error in sourced command file:
unable to debug self

Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
Comment 1 Jeff Kesselman 2012-06-06 20:40:07 UTC
I dont know the mono codebase very well, but from my brief poking at it, my ignorant suspicion is that cairo_font_get_matrix expects to have a pointer to a block of memory to put the resulting matrix as iust second parameter, but the binding is just passing an unitialized object reference.  My guess is that this results in it trying to write the matrix to wherever in memory a .NET "null" maps to (address 0?)
Comment 2 Miguel de Icaza [MSFT] 2012-08-15 16:56:03 UTC
The call is correct, since the parameter is passed with the "out" modifier, which passes a pointer to the stack variable "Matrix m".
Comment 3 Marek Safar 2018-03-13 11:07:35 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and reopen the bug report.

Thank you!