/usr/share/fpcsrc/3.2.2/packages/libxml/examples/reader1.pas with /lib/x86_64-linux-gnu/libxml2.so.2.9.13
Summary
The package libxml is not working since Linux UBUNTU Jammy (libxml2.so.2.9.13 fpc 3.2.2)
System Information
- Operating system: Linux UBUNTU Jammy
- Processor architecture: x86-64
- Compiler version: 3.2.2
- Device: Computer
NAME="Linux Mint"
VERSION="21.2 (Victoria)"
ID_LIKE="ubuntu debian"
UBUNTU_CODENAME=jammy
libxml2.so.2.9.13 fpc 3.2.2
Kernel: 5.15.0-92-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 5.8.4
tk: GTK 3.24.33 wm: muffin vt: 7 dm: LightDM 1.30.0 Distro: Linux Mint 21.2 Victoria
base: Ubuntu 22.04 jammy
Steps to reproduce
Compile a local copy of /usr/share/fpcsrc/3.2.2/packages/libxml/examples/reader1.pas
this program used to test the package. Compilation ok.
Example Project
Execute the program reader1 with an xml file (example hyperliens-sato.xml)
## Content of hyperliens-sato.xml
_____________________
<?xml version="1.0"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>Procès verbaux du CIP (Législative) : ISBN 2-7384-5791-6</title>
</titleStmt>
<publicationStmt> <p>Liens entre les appels de note et les notes</p></publicationStmt>
<sourceDesc> <p>2738457916_1corrv5_2</p></sourceDesc>
</fileDesc>
</teiHeader>
<text type="liens">
<body>
<linkGrp type="note" targFunc="NoteAppel Note">
<link target="2738457916-app01.xml#a1 2738457916-app01-ng.xml#n1"/>
...
<link target="2738457916-app01.xml#a2 2738457916-app01-ng.xml#n2"/>
</linkGrp>
</body>
</text>
</TEI> -->
What is the current bug behavior?
I use ltrace to show the problem.
ltrace ./reader1 hyperliens-sato.xml
__libc_start_main(0x401260, 2, 0x7ffe7e0d3668, 0x401320 <unfinished ...>
xmlMemSetup(0x427420, 0x427430, 0x427450, 0x427470) = 0
xmlCheckVersion(0x5098, 0x7f7d58b49610, 0x427450, 0x427470 <no return ...>
--- SIGFPE (Floating point exception) ---
Runtime error 207 at $00007F7D589C9723
dladdr(0x7f7d589c9723, 0x7ffe7e0d2b70, 0, 0x7ffe7e0d2b90) = 1
$00007F7D589C9723
+++ exited (status 207) +++ -->
What is the expected (correct) behavior?
I used the same procedure with Kernel: 5.4.0-70-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 Desktop: Hfce 4.16.0 Distro: Linux Mint 20.3 Una; base: Ubuntu 20.04 focal The library is libxml2.so.2.9.10 fpc 3.04
Here the result without ltrace
./reader1 hyperliens-sato.xml
0 1 TEI 0 0
1 14 #text 0 1
\n
1 1 teiHeader 0 0
2 14 #text 0 1
\n
2 1 fileDesc 0 0
3 14 #text 0 1
\n
3 1 titleStmt 0 0
4 14 #text 0 1
\n
4 1 title 0 0
5 3 #text 0 1 Procès verbaux du CIP (Législative) : ...\n
4 15 title 0 0
4 14 #text 0 1
\n
3 15 titleStmt 0 0
3 14 #text 0 1
\n
3 1 publicationStmt 0 0
4 14 #text 0 1 \n
4 1 p 0 0
5 3 #text 0 1 Liens entre les appels de note et les no...\n
4 15 p 0 0
3 15 publicationStmt 0 0
3 14 #text 0 1
\n
3 1 sourceDesc 0 0
4 14 #text 0 1 \n
4 1 p 0 0
5 3 #text 0 1 2738457916_1corrv5_2\n
4 15 p 0 0
3 15 sourceDesc 0 0
3 14 #text 0 1
\n
2 15 fileDesc 0 0
2 14 #text 0 1
\n
1 15 teiHeader 0 0
1 14 #text 0 1
\n
1 1 text 0 0
2 14 #text 0 1
\n
2 1 body 0 0
3 14 #text 0 1
\n
3 1 linkGrp 0 0
4 14 #text 0 1
\n
4 1 link 1 0
4 14 #text 0 1
\n
4 8 #comment 0 1 ... \n
4 14 #text 0 1
\n
4 1 link 1 0
4 14 #text 0 1
\n
3 15 linkGrp 0 0
3 14 #text 0 1
\n
2 15 body 0 0
2 14 #text 0 1
\n
1 15 text 0 0
1 14 #text 0 1
\n
0 15 TEI 0 0
Relevant logs and/or screenshots
Possible fixes
Unit xml2 is old. We can read
{ Translation of the libxml2 headers for FreePascal
Copyright (C) 2008 by Ivo Steinmann }
Thank you.