Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 310487 - dev-tex/luatex: Manual rebuilding required after upgrade of sys-libs/zlib
Summary: dev-tex/luatex: Manual rebuilding required after upgrade of sys-libs/zlib
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: TeX project
URL:
Whiteboard:
Keywords: NeedPatch, UPSTREAM
: 405563 421751 428374 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-21 09:14 UTC by Lubos Kolouch
Modified: 2012-08-01 13:00 UTC (History)
6 users (show)

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


Attachments
build.log (build.log,29.75 KB, text/plain)
2012-04-03 13:10 UTC, Dennis Schridde
Details
Patch removing the obnoxious zlib version check (luatex-0.70.1-remove-zlib-version-check.patch,691 bytes, patch)
2012-07-30 16:07 UTC, Ulrich Müller
Details | Diff
debian patch (relax-zlib-version-check,1.18 KB, patch)
2012-07-31 20:06 UTC, Alexis Ballier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lubos Kolouch 2010-03-21 09:14:27 UTC
After updating to sys-libs/zlib-1.2.4, texlive stops working with error
PANIC: unprotected error in call to Lua API (zlib library version does not match - header: 1.2.3, library: 1.2.4)

Reproducible: Always

Steps to Reproduce:
1. $ texexec
2. PANIC: unprotected error in call to Lua API (zlib library version does not match - header: 1.2.3, library: 1.2.4)

Actual Results:  
PANIC: unprotected error in call to Lua API (zlib library version does not match - header: 1.2.3, library: 1.2.4)

Expected Results:  
texexec runs normally
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2010-03-21 11:39:33 UTC
I tried this. Only had texlive-core installed, and was not able to build texlive-basic before re-installing luatex (because of zlib upgade). 
Then, texlive-context for texexec.

$ texexec 
MTXrun | kpse fallback with progname 'context' initialized in 0.01 seconds
TeXExec | version 6.2.1 - 1997-2009 - PRAGMA ADE/POD

And it's working. 

So, I suspect you need to rebuild something, such as luatex.

Also make sure you don't have local copy of zlib.h or zconf.h in e.g. /usr/local installed by some 3rd party application.
Comment 2 Lubos Kolouch 2010-03-21 12:03:34 UTC
You are right, after rebuilding luatex it works.
Thank you!
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2012-03-30 12:18:39 UTC
*** Bug 405563 has been marked as a duplicate of this bug. ***
Comment 4 Dennis Schridde 2012-04-03 13:10:52 UTC
Created attachment 307627 [details]
build.log
Comment 5 Dennis Schridde 2012-04-03 13:11:20 UTC
I just hit the same issue. Is it possible to automate rebuilding this somehow?
Comment 6 Ulrich Müller gentoo-dev 2012-05-18 07:00:43 UTC
Reopening and reassigning to maintainer, since this nasty problem is reappearing after every zlib update.

PANIC: unprotected error in call to Lua API (zlib library version does not match - header: 1.2.6, library: 1.2.7)

Either luatex should link explicitly against libz.so.1.2.7, so that the issue can be picked up by revdep-rebuild. Or (IMHO preferably) the check for the library's version should be removed. After all, if the SONAME is the same (i.e. libz.so.1), then the library's ABI should be unchanged.
Comment 7 Alexis Ballier gentoo-dev 2012-06-18 13:01:55 UTC
*** Bug 421751 has been marked as a duplicate of this bug. ***
Comment 8 Alexis Ballier gentoo-dev 2012-07-30 12:34:32 UTC
*** Bug 428374 has been marked as a duplicate of this bug. ***
Comment 9 Alexis Ballier gentoo-dev 2012-07-30 12:35:05 UTC
(In reply to comment #6)
> Reopening and reassigning to maintainer, since this nasty problem is
> reappearing after every zlib update.
> 
> PANIC: unprotected error in call to Lua API (zlib library version does not
> match - header: 1.2.6, library: 1.2.7)
> 
> Either luatex should link explicitly against libz.so.1.2.7, so that the
> issue can be picked up by revdep-rebuild. Or (IMHO preferably) the check for
> the library's version should be removed. After all, if the SONAME is the
> same (i.e. libz.so.1), then the library's ABI should be unchanged.

have you tried to contact upstream and/or write a patch for this ? :)
Comment 10 Ulrich Müller gentoo-dev 2012-07-30 16:07:23 UTC
Created attachment 319734 [details, diff]
Patch removing the obnoxious zlib version check

I've tested building luatex with attached patch and zlib-1.2.6.
I see no apparent problems when running it, after I had upgraded zlib to 1.2.7.
Comment 11 Alexis Ballier gentoo-dev 2012-07-30 19:56:40 UTC
(In reply to comment #10)
> Created attachment 319734 [details, diff] [details, diff]
> Patch removing the obnoxious zlib version check
> 
> I've tested building luatex with attached patch and zlib-1.2.6.
> I see no apparent problems when running it, after I had upgraded zlib to
> 1.2.7.

sounds good to me, but have you tried to ask upstream as of why they wrote that check?
Comment 12 Alexis Ballier gentoo-dev 2012-07-31 20:06:27 UTC
hmm, found this too:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581818

will attach debian patch
Comment 13 Alexis Ballier gentoo-dev 2012-07-31 20:06:55 UTC
Created attachment 319912 [details, diff]
debian patch
Comment 14 Ulrich Müller gentoo-dev 2012-07-31 23:16:00 UTC
I've reported the issue to the dev-luatex@ntg.nl mailing list where my posting is awaiting maintainer approval. So quoting it here for reference:

╓────
║ Forwarding downstream bug report <https://bugs.gentoo.org/310487>.
║ 
║ LuaTeX does a check if the version of the zlib shared library when
║ executing agrees with the zlib version used at build time. IMHO, this
║ check does more harm than good:
║ 
║ - LuaTeX will refuse to run after every minor upgrade of zlib (e.g. if
║   upgrading from zlib-1.2.6 to zlib-1.2.7) and needs to be rebuild.
║ - There's no good way for automatic tools to detect this. See the
║   downstream bug for details.
║ - The full zlib version is the wrong thing to check. Changes in zlib's
║   ABI are tracked by its soname (i.e. libz.so.1); the dynamic linker
║   already takes care that the right version will be used.
║ - In addition to this, zlib's deflateInit* and inflateInit* functions
║   contain another version check, which looks at the initial version
║   component only. So in total, the zlib version is checked at three
║   different places (each time differently!).
║ 
║ So, would it be possible to remove the check for the zlib version?
║ See patch included below.
╙────

(In reply to comment #13)
> Created attachment 319912 [details, diff] [details, diff]
> debian patch

I think that the Debian patch misses the point. There's no need for another version check in LuaTeX, in addition to soname and the one in zlib. It should be dropped altogether, for the reasons stated above.
Comment 15 Ulrich Müller gentoo-dev 2012-08-01 07:37:36 UTC
Upstream report is here:
<http://www.ntg.nl/pipermail/dev-luatex/2012-July/004534.html>
Comment 16 Alexis Ballier gentoo-dev 2012-08-01 13:00:28 UTC
I first thought the debian patch was less radical, but you convinced me. Thanks, your patch is now applied to -r1 -> fixed.