[Solved] Using TikZ fadings with a precompiled preamble causes Segmentation fault (core dumped)

ttsc Asks: Using TikZ fadings with a precompiled preamble causes Segmentation fault (core dumped)
I have noticed that I can use TikZ fadings in my documents and they work just fine. Also, I often use a precompiled preamble and that also work fine. However, when I try to use those two together, I get Segmentation fault (core dumped).

My questions are:

  1. Why is this happening?
  2. Is this a bug?
  3. Is there something that I could do to make this work?

Here are minimal steps to reproduce the problem.

I use Ubuntu and TeX Live 2021, but the same thing happens on Windows and with TeX Live 2019.

First I create a class file called test.cls with the following contents:

Code:
ProvidesClass{test}
LoadClass{standalone}
usepackage{tikz}
usetikzlibrary{fadings}

And a file called test.tex with the following contents:

Code:
documentclass{test}
begin{document}
  begin{tikzpicture}
    fill[color=blue,path fading=south] (0,0) circle (1cm);
  end{tikzpicture}
end{document}

I compile test.tex with pdflatex test.tex, and get the following result:


result 1

Then I create preamble.tex with the following content:

Code:
documentclass{test}
csname endofdumpendcsname
begin{document}
Preamble.
end{document}

And compile it with pdftex -ini -jobname="preamble" "&pdflatex" mylatexformat.ltx preamble.tex to get preamble.fmt.

Then I change test.tex to

Code:
%&preamble
begin{document}
  begin{tikzpicture}
    fill[color=blue,path fading=south] (0,0) circle (1cm);
  end{tikzpicture}
end{document}

And when I compile it again, I get Segmentation fault (core dumped). Here is the full output

Code:
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=preamble)
 restricted write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-07-12>
==============================================================================
JOB NAME         : "test"
CUSTOMISED FORMAT: "preamble"
PRELOADED FILES:
    test.cls    
standalone.cls    2018/03/26 v1.3a Class to compile TeX sub-files standalone
shellesc.sty    2019/11/08 v1.0c unified shell escape interface for LaTeX
ifluatex.sty    2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
   iftex.sty    2020/03/06 v1.0d TeX engine tests
 xkeyval.sty    2020/11/20 v2.8 package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
standalone.cfg    2018/03/26 v1.3a Default configuration file for 'standalone' 
class
 article.cls    2021/02/12 v1.4n Standard LaTeX document class
  size10.clo    2021/02/12 v1.4n Standard LaTeX file (size option)
    tikz.sty    2021/05/15 v3.1.9a (3.1.9a)
     pgf.sty    2021/05/15 v3.1.9a (3.1.9a)
  pgfrcs.sty    2021/05/15 v3.1.9a (3.1.9a)
pgfrcs.code.tex
 pgfcore.sty    2021/05/15 v3.1.9a (3.1.9a)
graphicx.sty    2020/12/05 v1.2c Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2021/03/04 v1.4d Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
  pdftex.def    2020/10/05 v1.2a Graphics/color driver for pdftex
  pgfsys.sty    2021/05/15 v3.1.9a (3.1.9a)
pgfsys.code.tex
pgfsyssoftpath.code.tex    2021/05/15 v3.1.9a (3.1.9a)
pgfsysprotocol.code.tex    2021/05/15 v3.1.9a (3.1.9a)
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
pgfcore.code.tex
pgfcomp-version-0-65.sty    2021/05/15 v3.1.9a (3.1.9a)
pgfcomp-version-1-18.sty    2021/05/15 v3.1.9a (3.1.9a)
  pgffor.sty    2021/05/15 v3.1.9a (3.1.9a)
 pgfkeys.sty    
pgfkeys.code.tex
 pgfmath.sty    
pgfmath.code.tex
pgffor.code.tex
tikz.code.tex

==============================================================================
(mylatexformat)Info: start reading document "test"
(mylatexformat)      on input line 2. (begin{document})
==============================================================================
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
No file test.aux.
(/usr/local/texlive/2021/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2021/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))Segmentation fault (core dumped)

Then I remove path fading=south from the TikZ picture so that test.tex contains the following:

Code:
%&preamble
begin{document}
begin{tikzpicture}
fill[color=blue] (0,0) circle (1cm);
end{tikzpicture}
end{document}

And the document works again and produces the following image:


result 2

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.