for the patch.
* Fix noopt support to use --disable-optimising as ./configure does
crazy things.
- * Make sure that the guile garbage collection does not collect s in
- font-metric.cc when it gets optimized away (closes: #684817)
+ * Apply patch from 13fc2437e2aaa9 to fix segfault in font-mark where a
+ garbage collection can trigger a null pointer dereference (closes:
+ #684817)
-- Don Armstrong <don@donarmstrong.com> Sun, 23 Dec 2012 13:25:44 -0800
{
Font_metric *m = (Font_metric *) SCM_CELL_WORD_1 (s);
m->derived_mark ();
- // we must do this to avoid s being optimized out and garbage
- // collected; leading to a segfault above.
- scm_remember_upto_here_1(s);
return m->description_;
}
PangoFontDescription const *description,
Real output_scale)
{
+ // This line looks stupid, but if we don't initialize physical_font_tab_ befo
+ // we allocate memory in scm_c_make_hash_table, then that could trigger a gar
+ // collection.
+ physical_font_tab_ = SCM_EOL;
physical_font_tab_ = scm_c_make_hash_table (11);
PangoDirection pango_dir = PANGO_DIRECTION_LTR;
context_ = pango_context_new ();