Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1278347 > unrolled thread

Bug#1125474: xpdf: Fontconfig warning: using without calling FcInit()

Started byVincent Lefevre <vincent@vinc17.net>
First post2026-01-14 13:20 +0100
Last post2026-01-15 11:50 +0100
Articles 8 — 3 participants

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#1125474: xpdf: Fontconfig warning: using without calling FcInit() Vincent Lefevre <vincent@vinc17.net> - 2026-01-14 13:20 +0100
    Bug#1125474: xpdf: Fontconfig warning: using without calling FcInit() Adam Sampson <ats@offog.org> - 2026-01-14 13:50 +0100
      Bug#1125474: xpdf: Fontconfig warning: using without calling FcInit() Vincent Lefevre <vincent@vinc17.net> - 2026-01-14 14:20 +0100
        Bug#1125474: xpdf: Fontconfig warning: using without calling FcInit() Vincent Lefevre <vincent@vinc17.net> - 2026-01-14 14:20 +0100
        Bug#1125474: xpdf: Fontconfig warning: using without calling FcInit() Vincent Lefevre <vincent@vinc17.net> - 2026-01-15 04:10 +0100
          Bug#1125474: libxm4: missing call to FcInit() when using Fontconfig Vincent Lefevre <vincent@vinc17.net> - 2026-01-15 11:00 +0100
          Bug#1125474: xpdf: Fontconfig warning: using without calling FcInit() Graham Inggs <ginggs@debian.org> - 2026-01-15 11:20 +0100
            Bug#1125474: xpdf: Fontconfig warning: using without calling FcInit() Vincent Lefevre <vincent@vinc17.net> - 2026-01-15 11:50 +0100

#1278347 — Bug#1125474: xpdf: Fontconfig warning: using without calling FcInit()

FromVincent Lefevre <vincent@vinc17.net>
Date2026-01-14 13:20 +0100
SubjectBug#1125474: xpdf: Fontconfig warning: using without calling FcInit()
Message-ID<Md80W-au0j-13@gated-at.bofh.it>
Package: xpdf
Version: 3.04+git20250304-1+b1
Severity: normal

With fontconfig 2.17.1-3, I now get the following warning when
running xpdf (even without any argument):

Fontconfig warning: using without calling FcInit()

Other PDF viewers (atril, qpdfview, zathura) do not have such an issue.

-- System Information:
Debian Release: forky/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.18.3+deb14-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages xpdf depends on:
ii  libc6          2.42-7
ii  libgcc-s1      15.2.0-12
ii  libpaper2      2.2.5-0.3+b3
ii  libpoppler147  25.03.0-11.1+b1
ii  libstdc++6     15.2.0-12
ii  libx11-6       2:1.8.12-1
ii  libxm4         2.3.8-5
ii  libxt6t64      1:1.2.1-1.3

Versions of packages xpdf recommends:
ii  cups-bsd          2.4.16-1
ii  fonts-urw-base35  20200910-8
ii  poppler-data      0.4.12-1
ii  poppler-utils     25.03.0-11.1+b1
ii  sensible-utils    0.0.26

xpdf suggests no packages.

-- no debconf information

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

[toc] | [next] | [standalone]


#1278348

FromAdam Sampson <ats@offog.org>
Date2026-01-14 13:50 +0100
Message-ID<Md8tX-au9P-1@gated-at.bofh.it>
In reply to#1278347
Hi Vincent,

On Wed, Jan 14, 2026 at 01:13:50PM +0100, Vincent Lefevre wrote:
> With fontconfig 2.17.1-3, I now get the following warning when
> running xpdf (even without any argument):
> Fontconfig warning: using without calling FcInit()

We just found the relevant fontconfig bug at the same time - your
comment popped up there while I was reading it!
https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/472

It's not a bug in xpopple as we don't use fontconfig directly there;
it'll be indirect through Poppler and Motif. But I'm more inclined to
think of this as a regression in fontconfig, since it's never required
explicit FcInit/FcFini calls in the past, and they can't be added to
libraries because previous releases of fontconfig don't do reference
counting, so multiple calls to FcFini would cause breakage.

Thanks,

-- 
Adam Sampson <ats@offog.org>                         <http://offog.org/>

[toc] | [prev] | [next] | [standalone]


#1278349

FromVincent Lefevre <vincent@vinc17.net>
Date2026-01-14 14:20 +0100
Message-ID<Md8WZ-auBN-1@gated-at.bofh.it>
In reply to#1278348
Hi Adam,

On 2026-01-14 12:43:48 +0000, Adam Sampson wrote:
> It's not a bug in xpopple as we don't use fontconfig directly there;
> it'll be indirect through Poppler and Motif.

There are other PDF viewers that are based on Poppler and such
a warning is not output. Perhaps FcInit is called in Poppler
and the xpdf issue comes from Motif (since it comes first).

> But I'm more inclined to think of this as a regression in
> fontconfig, since it's never required explicit FcInit/FcFini calls
> in the past, and they can't be added to libraries because previous
> releases of fontconfig don't do reference counting,

If a call to FcInit wasn't required, that's an API change and
an ABI breakage in fontconfig.

> so multiple calls to FcFini would cause breakage.

That's something that they would have to solve.

If I understand correctly, the new fontconfig version was not
ready yet for Debian, and it would also require a soname bump
(when ready).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

[toc] | [prev] | [next] | [standalone]


#1278350

FromVincent Lefevre <vincent@vinc17.net>
Date2026-01-14 14:20 +0100
Message-ID<Md8X0-auBN-3@gated-at.bofh.it>
In reply to#1278349
On 2026-01-14 14:11:11 +0100, Vincent Lefevre wrote:
> On 2026-01-14 12:43:48 +0000, Adam Sampson wrote:
> > so multiple calls to FcFini would cause breakage.
> 
> That's something that they would have to solve.

This is apparently incorrect about FcFini: according to

  https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/448

this was fixed in May 2025.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

[toc] | [prev] | [next] | [standalone]


#1278424

FromVincent Lefevre <vincent@vinc17.net>
Date2026-01-15 04:10 +0100
Message-ID<MdlUd-aDci-3@gated-at.bofh.it>
In reply to#1278349

[Multipart message — attachments visible in raw view] — view raw

Control: reassign -1 libxm4 2.3.8-5
Control: retitle -1 libxm4: missing call to FcInit() when using Fontconfig
Control: severity -1 important
Control: affects -1 xpdf

Summary: Before some use of Fontconfig, Motif needs to call FcInit().
This has always been required, but without any consequence until now.
With libfontconfig1 2.17.1-3, which is now in unstable, one gets a
warning on stderr. It is bad for a library to send debug messages to
stderr, but... This just announces more important changes in future
versions of Fontconfig, which would mean a breakage in case of such
a missing call to FcInit(). So this bug must be fixed ASAP.

On 2026-01-14 14:11:11 +0100, Vincent Lefevre wrote:
> Hi Adam,
> 
> On 2026-01-14 12:43:48 +0000, Adam Sampson wrote:
> > It's not a bug in xpopple as we don't use fontconfig directly there;
> > it'll be indirect through Poppler and Motif.
> 
> There are other PDF viewers that are based on Poppler and such
> a warning is not output. Perhaps FcInit is called in Poppler
> and the xpdf issue comes from Motif (since it comes first).

I've added an abort() after the warning in Fontconfig, and I confirm
that this is obtained via Motif. I've attached the backtrace.

This happens via the ValidateAndLoadFont call:

[...]
#6  0x00007f172b316b89 in FcObjectFromName (name=name@entry=0x7f172b051b24 "encoding") at ./src/fcname.c:110
No locals.
#7  0x00007f172b319888 in IA__FcPatternAddString (p=0x55bb07356dc0, object=object@entry=0x7f172b051b24 "encoding", s=0x55bb0731f41
0 "iso10646-1") at ./src/fcpat.c:825
No locals.
#8  0x00007f172afa4b23 in ValidateAndLoadFont (rend=rend@entry=0x55bb07356d50, display=<optimized out>, display@entry=0x55bb07308550) at ./lib/Xm/XmRenderT.c:2107
[...]

and this function is defined in "lib/Xm/XmRenderT.c", and if
I understand corretly, this is "case XmFONT_IS_XFT:".

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

[toc] | [prev] | [next] | [standalone]


#1278444 — Bug#1125474: libxm4: missing call to FcInit() when using Fontconfig

FromVincent Lefevre <vincent@vinc17.net>
Date2026-01-15 11:00 +0100
SubjectBug#1125474: libxm4: missing call to FcInit() when using Fontconfig
Message-ID<MdsiZ-aHcS-5@gated-at.bofh.it>
In reply to#1278424
On 2026-01-15 03:58:52 +0100, Vincent Lefevre wrote:
> I've added an abort() after the warning in Fontconfig, and I confirm
> that this is obtained via Motif. I've attached the backtrace.
> 
> This happens via the ValidateAndLoadFont call:
> 
> [...]
> #6  0x00007f172b316b89 in FcObjectFromName (name=name@entry=0x7f172b051b24 "encoding") at ./src/fcname.c:110
> No locals.
> #7  0x00007f172b319888 in IA__FcPatternAddString (p=0x55bb07356dc0, object=object@entry=0x7f172b051b24 "encoding", s=0x55bb0731f41
> 0 "iso10646-1") at ./src/fcpat.c:825
> No locals.
> #8  0x00007f172afa4b23 in ValidateAndLoadFont (rend=rend@entry=0x55bb07356d50, display=<optimized out>, display@entry=0x55bb07308550) at ./lib/Xm/XmRenderT.c:2107
> [...]
> 
> and this function is defined in "lib/Xm/XmRenderT.c", and if
> I understand corretly, this is "case XmFONT_IS_XFT:".

The code in ValidateAndLoadFont() is the following:

[...]
                    _XmRendPattern(rend) = FcPatternCreate();
                    if (_XmRendFontName(rend))
                      FcPatternAddString(_XmRendPattern(rend), FC_FAMILY,
                                         (XftChar8 *)_XmRendFontName(rend));
                    if (_XmRendFontFoundry(rend))
                      FcPatternAddString(_XmRendPattern(rend), FC_FOUNDRY,
                                         (XftChar8 *)_XmRendFontFoundry(rend));
                    if (_XmRendFontEncoding(rend))
                      FcPatternAddString(_XmRendPattern(rend), XFT_ENCODING,
                                         (XftChar8 *)_XmRendFontEncoding(rend));
                    if (_XmRendFontStyle(rend))
                      FcPatternAddString(_XmRendPattern(rend), FC_STYLE,
                                         (XftChar8 *)_XmRendFontStyle(rend));
                    if (_XmRendFontSize(rend))
                      FcPatternAddInteger(_XmRendPattern(rend), FC_SIZE,
                                         _XmRendFontSize(rend));
                    if (_XmRendPixelSize(rend))
                      FcPatternAddInteger(_XmRendPattern(rend), FC_PIXEL_SIZE,
                                         _XmRendPixelSize(rend));
                    if (_XmRendFontSlant(rend))
                      FcPatternAddInteger(_XmRendPattern(rend), FC_SLANT,
                                         _XmRendFontSlant(rend));
                    if (_XmRendFontWeight(rend))
                      FcPatternAddInteger(_XmRendPattern(rend), FC_WEIGHT,
                                         _XmRendFontWeight(rend));
                    if (_XmRendFontSpacing(rend))
                      FcPatternAddInteger(_XmRendPattern(rend), FC_SPACING,
                                         _XmRendFontSpacing(rend));
                    p = XftFontMatch(display, 0, _XmRendPattern(rend), &res);
[...]

It is the FcPatternAddString() call with XFT_ENCODING that triggers
the warning on my machine.

Note that XftFontMatch() will internally call XftInit(), which will
call FcInit(), but this occurs after the above FcPatternAddString()
call.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

[toc] | [prev] | [next] | [standalone]


#1278449

FromGraham Inggs <ginggs@debian.org>
Date2026-01-15 11:20 +0100
Message-ID<MdsCm-aHAe-9@gated-at.bofh.it>
In reply to#1278424
Hi Vincent

On Thu, 15 Jan 2026 at 02:10, Vincent Lefevre <vincent@vinc17.net> wrote:
> Summary: Before some use of Fontconfig, Motif needs to call FcInit().
> This has always been required, but without any consequence until now.

Do you have a reference for this? (that is has always been required)

> With libfontconfig1 2.17.1-3, which is now in unstable, one gets a
> warning on stderr.

You could file a bug against fontconfig 2.17.1-3 to prevent it from
migrating to testing for now.  Other packages might also be affected.

Regards
Graham

[toc] | [prev] | [next] | [standalone]


#1278454

FromVincent Lefevre <vincent@vinc17.net>
Date2026-01-15 11:50 +0100
Message-ID<Mdt5o-aHKx-7@gated-at.bofh.it>
In reply to#1278449
Hi Graham,

On 2026-01-15 09:10:52 -0100, Graham Inggs wrote:
> On Thu, 15 Jan 2026 at 02:10, Vincent Lefevre <vincent@vinc17.net> wrote:
> > Summary: Before some use of Fontconfig, Motif needs to call FcInit().
> > This has always been required, but without any consequence until now.
> 
> Do you have a reference for this? (that is has always been required)

https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/472

(it was given by Adam Sampsonin an earlier message). I'm currently
discussing there about this issue with the developer Akira Tagoh.

> > With libfontconfig1 2.17.1-3, which is now in unstable, one gets a
> > warning on stderr.
> 
> You could file a bug against fontconfig 2.17.1-3 to prevent it from
> migrating to testing for now.  Other packages might also be affected.

I've done testing with various applications, including gucharmap
and gnuplot, for which one can see complaints about this warning
on the web (several months ago), but I cannot see a warning with
them. For gnuplot, the user made the warning disappear by
recompiling the cairo library:

  https://sourceforge.net/p/gnuplot/bugs/2817/

So I suspect that there were such bugs in other software, but they
have been fixed in the mean time.

For GTK3, this has been fixed:

  https://gitlab.gnome.org/GNOME/gtk/-/issues/7639

Ditto for Firefox:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1974722

Concerning xpdf and Motif, I suppose that there hasn't been a report
before because they are little used.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web