Bug 32901 - PDF generation from SGML broken (again): suspect Latex (Texlive)
Summary: PDF generation from SGML broken (again): suspect Latex (Texlive)
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: All Packagers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-26 20:16 CET by Bruno Cornec
Modified: 2024-02-29 17:31 CET (History)
1 user (show)

See Also:
Source RPM: docbook-utils-0.6.14-24.mga9.src.rpm and jadetex-3.13-18.mga9.src.rpm, texlive-20220321-7.mga9.src.rpm
CVE:
Status comment:


Attachments
the main SGML file (1.36 KB, text/sgml)
2024-02-26 20:18 CET, Bruno Cornec
Details
the FDL license included by the main SGML file (21.46 KB, text/sgml)
2024-02-26 20:18 CET, Bruno Cornec
Details
Generated pdf (96.03 KB, application/pdf)
2024-02-28 20:44 CET, katnatek
Details
Generated tex file for pdfjadetex (77.79 KB, text/plain)
2024-02-29 13:16 CET, Bruno Cornec
Details

Description Bruno Cornec 2024-02-26 20:16:22 CET
Description of problem:

Generating the PDF files from my SGML files is broken on MGA9

Version-Release number of selected component (if applicable):

docbook-utils-0.6.14-24.mga9.src.rpm calling
jadetex-3.13-18.mga9.src.rpm calling lots of stuff, but not the right ones anymore


How reproducible:
Each time.

Steps to Reproduce:

1. urpmi docbook-utils-pdf
2. docbook2pdf  toto.sgml

you get the errors:
(/usr/share/texmf-dist/tex/latex/psnfss/ts1ptm.fd)
! Undefined control sequence.
<recently read> \Hy@colorlink 
                              
l.274 {GFDL}}
             GNU Free Documentation License, Version 1.1\endLink{}\endNode{}...


So it seems that some jadetex related definitions are not read correctly by latex.

This is a regression as on Mageia 8 with the same steps you get that expected result:

Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /users/bruno/prj/pb/projects/mondorescue/pbbuild/BUILD/mondo-doc-3.2.2/toto.sgml

and the PDF file is correctly generated.
Comment 1 Bruno Cornec 2024-02-26 20:18:21 CET
Created attachment 14422 [details]
the main SGML file
Comment 2 Bruno Cornec 2024-02-26 20:18:46 CET
Created attachment 14423 [details]
the FDL license included by the main SGML file
Comment 3 Bruno Cornec 2024-02-26 20:19:39 CET
In order to reproduce, download the 2 files provided as attachments as main.sgml and fdl.sgml in the same directoryand from that directory run:

dockbook2pdf main.sgml
Comment 4 Bruno Cornec 2024-02-26 20:20:16 CET
As a side note, I made a test on Fedora 39 and the same bug exists !
Comment 5 Lewis Smith 2024-02-26 21:51:43 CET
Both packages are unchanged from M8, and docbook-utils for much longer.
The jadetex site says last updated 2013.
The implication that jadetex is suddenly not valid would surely throw complaints from elsewhere; none found.

I suspect [la]tex. What say you?

CC: (none) => lewyssmith

Comment 6 katnatek 2024-02-26 23:56:35 CET
Could sgml2latex from linuxdoc-tools be an alternative ?

sgml2latex  -  create LaTeX, DVI, PostScript or PDF output from a LinuxDoc DTD SGML source file
Comment 7 Bruno Cornec 2024-02-27 15:07:04 CET
(In reply to katnatek from comment #6)
> Could sgml2latex from linuxdoc-tools be an alternative ?
> 
> sgml2latex  -  create LaTeX, DVI, PostScript or PDF output from a LinuxDoc
> DTD SGML source file

Well, I've been generating that same SGML files since ... 1995 using these tools. So this is a bug that should be fixed ! Using another tool chain is not the answer, sorry. As if you're using gcc since years and it now has a bug and you say  use llvm. Maybe it could work, but that doesn't change the fact a bug needs fixing.
Comment 8 Bruno Cornec 2024-02-27 16:30:18 CET
(In reply to Lewis Smith from comment #5)
> Both packages are unchanged from M8, and docbook-utils for much longer.

You're right :-(. For jadetex I was using svn diff -r1262629 to see what where the past changes till mga7 but no luck trying to put back some of these.

> The jadetex site says last updated 2013.

Upstream yes, but the integration with LaTeX seems to have evolve as our version of LaTeX evolved itself (from 2020 to 2022). I've not found any impact yet.

> The implication that jadetex is suddenly not valid would surely throw
> complaints from elsewhere; none found.

Do you know many Mageia users generating doc from SGML DocBook ? I think I'm one of the very few. 
Anyway, I provided a very simple test case, showing the bug, and Fedora 39 has it as well, but not mageia 8. Same files, same tools (with different versions of course).

> I suspect [la]tex. What say you?

Maybe, or I think more about a change related to the integration of jadetex into LaTeX creating the issue. But all my comparisons up to now have not revealed anything useful :-(

Will let you know if I find something more clear.
Comment 9 Lewis Smith 2024-02-27 20:40:08 CET
Thanks. At the moment I would not know where to push this.
Comment 10 Bruno Cornec 2024-02-27 21:09:08 CET
Maybe the group maintaining LaTeX ?
Comment 11 Lewis Smith 2024-02-27 21:35:09 CET
Doing that in hope. Latex/Texlive are big beasts, no person evident, so assigning globally.

CC: lewyssmith => (none)
Summary: PDF generation from SGML broken (again) => PDF generation from SGML broken (again): suspect Latex (Texlive)
Source RPM: docbook-utils-0.6.14-24.mga9.src.rpm and jadetex-3.13-18.mga9.src.rpm => docbook-utils-0.6.14-24.mga9.src.rpm and jadetex-3.13-18.mga9.src.rpm, texlive-20220321-7.mga9.src.rpm
Assignee: bugsquad => pkg-bugs

Comment 12 katnatek 2024-02-27 21:42:30 CET
(In reply to Bruno Cornec from comment #7)
> (In reply to katnatek from comment #6)
> > Could sgml2latex from linuxdoc-tools be an alternative ?
> > 
> > sgml2latex  -  create LaTeX, DVI, PostScript or PDF output from a LinuxDoc
> > DTD SGML source file
> 
> Well, I've been generating that same SGML files since ... 1995 using these
> tools. So this is a bug that should be fixed ! Using another tool chain is
> not the answer, sorry. As if you're using gcc since years and it now has a
> bug and you say  use llvm. Maybe it could work, but that doesn't change the
> fact a bug needs fixing.

Yes is not like all the world is saying 32b is not anymore a valid platform , buy you a new system. ;)

As Fedora also have, the bug could be an upstream issue
Comment 13 katnatek 2024-02-28 20:44:36 CET
Created attachment 14432 [details]
Generated pdf

Bruno the pdf is generated did should have something that is not there?
Comment 14 Bruno Cornec 2024-02-29 01:06:47 CET
(In reply to katnatek from comment #13)
> Bruno the pdf is generated did should have something that is not there?

The PDF generated is incorrect dur to the error messages mentionned in my description.

On Mageia 8 you have no error messages and the PDF is correctly generated.
Comment 15 Bruno Cornec 2024-02-29 10:50:19 CET
(In reply to Bruno Cornec from comment #14)
> (In reply to katnatek from comment #13)
> > Bruno the pdf is generated did should have something that is not there?
> 
> The PDF generated is incorrect dur to the error messages mentionned in my
> description.
> 
> On Mageia 8 you have no error messages and the PDF is correctly generated.

And in addition the command returns an error code which make the Makefile builind stop, breaking the whole build process in which this is run.
Comment 16 Bruno Cornec 2024-02-29 10:54:11 CET
(In reply to Bruno Cornec from comment #7)
> (In reply to katnatek from comment #6)
> > Could sgml2latex from linuxdoc-tools be an alternative ?
> > 
> > sgml2latex  -  create LaTeX, DVI, PostScript or PDF output from a LinuxDoc
> > DTD SGML source file
> 
> Well, I've been generating that same SGML files since ... 1995 using these
> tools. So this is a bug that should be fixed ! Using another tool chain is
> not the answer, sorry. As if you're using gcc since years and it now has a
> bug and you say  use llvm. Maybe it could work, but that doesn't change the
> fact a bug needs fixing.

And just FTR, sgml2latex only generates for Linuxdoc DTD SGML documents not DocBook one.
Comment 17 Bruno Cornec 2024-02-29 11:40:12 CET
I think that wally who made the jadetex.dtx patch the most recently could be the one who could help on this. Copying.

I have found one delta between 8 and 9 (/usr2) which is:
diff -r -u /usr/share/texmf-dist/tex/jadetex/base/jadetex.ltx /usr2/share/texmf-dist/tex/jadetex/base/jadetex.ltx
--- /usr/share/texmf-dist/tex/jadetex/base/jadetex.ltx  2008-12-23 01:48:00.000000000 +0000
+++ /usr2/share/texmf-dist/tex/jadetex/base/jadetex.ltx 2020-12-18 02:39:22.000000000 +0000
@@ -1309,7 +1309,9 @@
   \let\AtBeginDocument\@firstofone
   \ifdim\topskip<1sp\global\topskip 1sp\relax\fi
   \global\@maxdepth\maxdepth
-  \@begindocumenthook
+  \@kernel@before@begindocument
+  \UseOneTimeHook{begindocument}%
+  \@kernel@after@begindocument
   \global\let\@begindocumenthook\@undefined
   \global\let\@filelist\relax
   \global\let\@addtofilelist\@gobble

And that ltx is generated from the dtx.

The Hy@colorlink macro creating the issue is also defined in that file, so I'd guess that's where I need to focus.

CC: (none) => jani.valimaa

Comment 18 Bruno Cornec 2024-02-29 13:15:05 CET
Way to reproduce it at lower level:

$ jade -t tex -o toto.tex -i print -d /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print -V %paper-type%=A4 toto.sgml
$ pdfjadetex toto.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/Mageia) (preloaded format=pdfjadetex)
 restricted \write18 enabled.
entering extended mode
(./toto.tex
JadeTeX 2003/04/27: 3.13
(/usr/share/texmf-dist/tex/latex/psnfss/t1ptm.fd)
Elements will be labelled
Jade begin document sequence at 21
(./toto.aux) (/usr/share/texmf-dist/tex/latex/tipa/t3ptm.fd)
(/usr/share/texmf-dist/tex/latex/cyrillic/t2acmr.fd)
(/usr/share/texmf-dist/tex/latex/psnfss/t1ppl.fd)
(/usr/share/texmf-dist/tex/latex/psnfss/t1phv.fd) [1.0.47{/usr/share/texmf-dist
/fonts/map/pdftex/updmap/pdftex.map}]
(/usr/share/texmf-dist/tex/latex/psnfss/ts1ppl.fd)
! Undefined control sequence.
<recently read> \Hy@colorlink 
                              
l.271 {GFDL}}
             GNU Free Documentation License, Version 1.1\endLink{}\endNode{}...
[... other errors ...]
$ echo $?
1

So the culprit is between openjade, creating the intermediate tex file and jadetex creating the pdf.

If I compare the 2 tex files generated by the jade command between mageia 8 and mageia 9 I get the same file.

So the error is clearly coming from the pdfjadetex toto.tex command which again works on Mageia 8. Attaching the toto.tex file FTR.

Differences are:
pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Mageia 8)
pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/Mageia 9)

And at start mga8 pdftex mentions more loading:
(/usr/share/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-dist/tex/latex/refcount/refcount.sty)
(/usr/share/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty)

Not seen in the mga9 version.

So I think we should affect the anomaly to the pdfjadetex maintainer part of the jadetex package. Again it may be a slide effect of changes in latex, but I've not found why yet.
Comment 19 Bruno Cornec 2024-02-29 13:16:34 CET
Created attachment 14433 [details]
Generated tex file for pdfjadetex
Comment 20 Bruno Cornec 2024-02-29 13:18:18 CET
(In reply to Bruno Cornec from comment #14)
> (In reply to katnatek from comment #13)
> > Bruno the pdf is generated did should have something that is not there?
> 
> The PDF generated is incorrect dur to the error messages mentionned in my
> description.

In particular the TOC is completely worng. And there is the black word appearing which shouldn't.
Comment 21 Bruno Cornec 2024-02-29 13:24:04 CET
(In reply to Bruno Cornec from comment #20)
> (In reply to Bruno Cornec from comment #14)
> > (In reply to katnatek from comment #13)
> > > Bruno the pdf is generated did should have something that is not there?
> > 
> > The PDF generated is incorrect dur to the error messages mentionned in my
> > description.
> 
> In particular the TOC is completely worng. And there is the black word
> appearing which shouldn't.

Mayeb that black word is coming from here:
/usr/share/texmf-dist/tex/jadetex/jadetex.ltx: \RequirePackage[implicit=true,colorlinks,linkcolor=black,bookmarks=true]{hyperref}[2000/03/01]

That line is also tere in mageia 8. But as the error is coming around the hyperref package, I think that's where I should look next.
Comment 22 Bruno Cornec 2024-02-29 13:35:43 CET
The main difference I find between mag8 and mga9 around jadetex is the following:
(/usr is mga8 /usr2 is mga9)

$ diff /usr/share/texmf-dist/tex/jadetex/base/jadetex.ltx /usr2/share/texmf-dist/tex/jadetex/base/jadetex.ltx
1312c1312,1314
<   \@begindocumenthook
---
>   \@kernel@before@begindocument
>   \UseOneTimeHook{begindocument}%
>   \@kernel@after@begindocument

Will try to see on the texlive-texmf side whether I can change it back to see whether that has an impact. Expect delay due to time neede to rebuild the beast ;-)
Comment 23 Bruno Cornec 2024-02-29 17:31:23 CET
I can confirm that reverting the content of jadetex.ltx to the version of Mageia 8 doesn't solve the issue.

So I need to look elsewhere.

Note You need to log in before you can comment on or make changes to this bug.