[tex-live] TeXLive2007: Bug in (Xe)TeX for 64bit and big endianess

Jonathan Kew jonathan_kew at sil.org
Tue May 8 15:50:07 CEST 2007

On 8 May 2007, at 1:00 pm, Dr. Werner Fink wrote:

> Hi,
> just to be noted, I've detected some pointer issues which
> cause XeTeX to fail on e.g. ppc64 and s390x.  The problem
> is that a cast from long to int will loose the four lower
> bytes due to the natural nature of the memory management
> of big endian systems.  I've attached a patch which fix this
> issue and get XeTeX on work on ppc64 and s390x.

Thanks for this; I'll take a look at it and integrate into the main  
code. I think there's one error in the patch, though: in the hunk  
that reads

-#define casttoptr(x)		(void*)(x)
-#define casttointeger(x)	(long)(x)
+#define casttoptr(x)		(void*)(&(x))
+#define casttointeger(x)	(int)(x)

the semantics will be incorrect. The old code assumed that a (TeX)  
"integer" variable was large enough to store the value of a C  
pointer, and that it can then cast back and forth between these  
(which may be a bad assumption!), but taking the *address* of the  
integer is not the solution here.

> Next is that I've found during debugging a lot of mixed
> long and int assignments which may also cause trouble
> e.g. in high memory loaded ia64 systems due to the large
> address spaces for virtual memory handling.  IMHO this
> should be fixed overall the source code not only the XeTeX.
> One wish I'd like to put here around: is there a way to use
> libpoppler instead of xpdf?  This would allow to use the
> system libpoppler and reduce any maintenance effort in any
> case of a security leak in xpdf/poppler because only the
> system libpoppler has to be replaced.  For the current
> libpoppler and XeTeX I've to disable the pdftosrc utility
> because I've found no way to use this together with libpoppler.

I don't know, but this is something to investigate. Doesn't pdftex  
also use xpdf? In fact, pdftosrc has nothing to do with xetex (AFAIK)...


More information about the tex-live mailing list