Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 729084 - media-libs/fontconfig-2.13.0-r4 USE=doc with texlive-2020 - TeX capacity exceeded, sorry [pool size=56298]
Summary: media-libs/fontconfig-2.13.0-r4 USE=doc with texlive-2020 - TeX capacity exce...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Fonts Team
Depends on:
Reported: 2020-06-22 05:03 UTC by Anon Emuss
Modified: 2021-06-04 18:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

Minimal case which reproduces the problem (fontconfig-2.13.0-r1-minimal-doc.txz,2.44 KB, application/octet-stream)
2020-06-22 05:27 UTC, Anon Emuss
Error output when running minimal test case (error_log.txt,7.35 KB, text/plain)
2020-06-22 05:30 UTC, Anon Emuss

Note You need to log in before you can comment on or make changes to this bug.
Description Anon Emuss 2020-06-22 05:03:40 UTC
The compilation of media-libs/fontconfig-2.13.0-r4 fails relatively early attempting to create fontconfig-devel.pdf, with the error message ``TeX capacity exceeded, sorry [pool size=56298].''  The package compiles successfully with USE=-doc.  The package used to compile with USE=+doc; a recent texlive update (to app-text/texlive-2020) may have broke the compilation.

Reproducible: Always

Steps to Reproduce:
1. USE=doc emerge -a1 =media-libs/fontconfig-2.13.0-r4
Actual Results:  
Compilation fails.

Expected Results:  
Successfully compile and install.
Comment 1 Anon Emuss 2020-06-22 05:08:48 UTC
At least one other person appears to have had this problem:
Comment 2 Anon Emuss 2020-06-22 05:27:33 UTC
Created attachment 645598 [details]
Minimal case which reproduces the problem

Attempted to produce a minimal case that reproduces the problem from the fontconfig doc/ directory.  In the provided directory, run:
  docbook2pdf fontconfig-devel.sgml

version.sgml and fccharset.sgml were taken from the fontconfig source code (version.sgml from a failed build), with the comments stripped out, and ID's removed (allowing it to be referenced repeatedly).

fontconfig-devel.sgml is a greatly-reduced copy of the fontconfig-devel.sgml from the fontconfig doc/ directory.  Instead of including many other of the .sgml files like the original, this only includes fccharset.sgml, and inserts the content of that multiple times (this fails with previously-defined-ID errors if the ID's are not stripped out).

On my system, docbook2pdf fails to compile this simplified fontconfig-devel.sgml (I will attempt to attach a sample error shortly).  It works if I reduce the number of times fccharset.sgml is repeated in the fontconfig-devel.sgml.  This makes it seem like the issue is simply one of TeX legitimately running out of memory on a large documentation file.  Presumably, if it works on some other system, increasing the number of repetitions should cause it to fail.

Some package versions from my system (amd64, profile default/linux/amd64/17.1):
fontconfig-2.13.0-r4 on my system has a patch to restore some missing fonts, but the problem persists without that patch.  The other packages are unmodified.
Comment 3 Anon Emuss 2020-06-22 05:30:51 UTC
Created attachment 645600 [details]
Error output when running minimal test case

Output when running docbook2pdf on the simplified fontconfig-devel.sgml attached earlier.  The error when building fontconfig-2.13.0-r4 is very similar.
Comment 4 Anon Emuss 2020-06-22 05:53:20 UTC
For others who encounter the same problems, here are two workarounds (either one works without the other):
  1) Compile with USE=-doc.
  2) Increase TeX pool size for pdfjadetex, either temporarily or permanently.
On my system, either of these allow fontconfig-2.13.0-r4 to compile and install successfully.  The second one also allows the attached minimal test case to succeed (but see comments further down).

On my system, to do option 2), I modified /etc/texmf/texmf.d/80jadetex.  There is a line near the bottom that reads:
  pool_size.pdfjadetex = 500000
I increased the pool size by 10%:
  pool_size.pdfjadetex = 550000
I then ran texmf-update (as root) to update the actual configuration files from that, and after that fontconfig-2.13.0-r4 successfully compiled and installed.  To restore the settings, restore that line and run texmf-update again.

For the maintainers:
This looks like a case where the configured memory pool is not quite large enough.  As shown above, a minor increase in the pool size fixes the problem.  Testing with the minimal test case shows that it, too, succeeds with the minor increase in pool size.  Modifying the test case so it repeats more times eventually causes it to fail again.  I tried doubling the number of times the test case repeated fccharset, and the test case failed again, reporting a pool size approximately double the pool size from the original error (100k instead of 50k).  This loosely suggests that the required pool size (over some minimum value that may have increased when texlive updated) increases linearly with the size of the documentation file.  That seems more like a result of a large file, and not a real bug.

I am not sure whether this is a bug that is worth your time, or if it even belongs here.  Since I saw somebody else had encountered a similar problem, I thought it was at least worth reporting what I found and my workarounds, in case that helps somebody.  I do not know exactly which package upgrade caused fontconfig to start failing to compile (it does look like fontconfig-2.13.1 has a similar problem), but am guessing that the newer texlive uses a little more of the default pool size, leaving just enough less for the fontconfig documentation that it exceeds the pool size.

This is probably not a bug with fontconfig, but having that in the subject line should help others to find this bug and the workarounds.  It might be considered a bug with jadetex.  Bug 469430 suggests others have had problems with /etc/texmf/texmf.d/80jadetex, but that was a while ago.  Also, a minor adjustment to pool size does not seem like a real bug.  For all I know, only a very few specific system configurations will even have trouble with the default settings.

Whatever you (maintainers) decide to do, I hope I have provided enough information that this does not take up too much of your time.
Comment 5 Anon Emuss 2020-08-02 00:19:01 UTC
This issue appears to have been fixed by other changes (but see below for a change that needs to be made for people previously affected).  Thanks to whomever made the changes that fixed it.

Feel free to close this bug, unless the change mentioned below seems important enough to make this easier for people to find.

It looks like jadetex is being replaced by texlive-formatsextra.  texlive-formatsextra-2020-r2 blocks jadetex, and other packages (such as docbook-sgml-utils-0.6.14-r4) now depend on texlive-formatsextra instead of jadetex when the jadetex USE flag is enabled.  Among other things, texlive-formatsextra does not install the troublesome /etc/texmf/texmf.d/80jadetex.  Without that file, fontconfig-2.13.0-r4[doc] appears to install without issue.

The only issue is that /etc/texmf/texmf.d/80jadetex is a protected configuration file.  Therefore, once jadetex was replaced by texlive-formatsextra, the file remained.  fontconfig-2.13.0-r4[doc] would not compile with that file in place.  I verified that it was unowned with:
  qfile -o /etc/texmf/texmf.d/80jadetex
and then removed it.  After running texmf-update so that change would take effect, fontconfig-2.13.0-r4[doc] installed without issue.
Comment 6 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2021-06-04 18:35:33 UTC
fixed long ago by kpathsea