bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash in 2.25.4


From: Jean Abou Samra
Subject: Re: Crash in 2.25.4
Date: Sun, 28 May 2023 00:05:30 +0200
User-agent: Evolution 3.48.1 (3.48.1-1.fc38)

Le samedi 27 mai 2023 à 07:50 +0200, Jean Abou Samra a écrit :


> >  With lilypond 2.25.6 and your second patch applied, here are 2 .PDFs: 
> > first is without the offending font installed, the second is the temporary 
> > file produced when the font is present.
> 
> 
> Thanks, but I am more interested in the log than the PDF for this one.




[Colin's answer, which had attachments too big for the list; I saw it in the 
moderation interface]

Ran the test as FC_DEBUG=2025 ./out/bin/lilypond /Work/Non-Musical.ly >   
fclog.log 2> lilylog.log and I hope that's what you meant. Running   
without FC_DEBUG produced a log of zero bytes.  
  
Resulting files attached.  
  
Cheers,  
  
Colin


[my answer]

It's quite strange that fclog.log is empty without FC_DEBUG (note that for now 
I don't need FC_DEBUG anymore). Since the FcPatternPrint calls were put in 

```
static void
substitute_with_lily_config (FcPattern *pat, void *config)
{
  FcConfig *fcconfig = static_cast<FcConfig *> (config);
  FcConfigSubstitute (fcconfig, pat, FcMatchPattern);
}
```

which is registered as

```
    // Before searching a font pattern with Fontconfig, FcConfigSubstitute 
should
    // be called on the pattern with the appropriate FcConfig so that the
    // configuration can define transformations to be applied on the pattern.
    // LilyPond does this to define font aliases.  Unfortunately, Pango has a 
bug
    // with this when using custom FcConfigs: it calls FcConfigSubstitute with 
the
    // global, default FcConfig instead of the font map's FcConfig.  This is
    // https://gitlab.gnome.org/GNOME/pango/-/issues/743 .  Work around it by
    // adding an extra function to transform the pattern, calling
    // FcConfigSubstitute with the right FcConfig.
    // pango_ft2_font_map_set_default_substitute is deprecated as of Pango 1.46 
in
    // favor of pango_fc_font_map_set_default_substitute, but we still support
    // 1.44.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    pango_ft2_font_map_set_default_substitute (res, substitute_with_lily_config,
                                               font_config_.get (), nullptr);
#pragma GCC diagnostic pop
```

it looks like Pango did not call the default substitute function.

I'm not yet sure how that could happen.

If Pango fails to correctly substitute values in the FcConfig, it could 
potentially mean that it's passed with some fields uninitialized to Fontconfig. 
That could explain why the error is not reproducible; the value of "color" 
could be a random uninitialized boolean variable. But I'm not sure yet.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]