]> git.donarmstrong.com Git - lilypond.git/commitdiff
revert previous patch to font-metric, and apply a new patch from upstream which actua... debian/2.14.2-4
authorDon Armstrong <don@donarmstrong.com>
Sun, 3 Feb 2013 21:06:26 +0000 (13:06 -0800)
committerDon Armstrong <don@donarmstrong.com>
Sun, 3 Feb 2013 21:06:26 +0000 (13:06 -0800)
debian/changelog
lily/font-metric.cc
lily/pango-font.cc

index c094903d76de4328acc01e77de4badebf4d962e8..117a83d8885b6bf6676fbd640564449ec4c49ce6 100644 (file)
@@ -5,8 +5,9 @@ lilypond (2.14.2-4) unstable; urgency=low
     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
 
index 4b4c2f802db26a0c8dc715d3153edca660c75398..458528dd2e4dce9a6994a6975c2f0a86ae570ebf 100644 (file)
@@ -106,9 +106,6 @@ Font_metric::mark_smob (SCM s)
 {
   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_;
 }
 
index a4fea75109bcb15141db97da016cd30d291375a2..bb6fb3974cf2544c356fa0565ab0983163b04e9f 100644 (file)
@@ -47,6 +47,10 @@ Pango_font::Pango_font (PangoFT2FontMap *fontmap,
                        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 ();