View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000525 | luatex | luatex bug | public | 2010-11-25 09:08 | 2010-12-13 14:43 |
Reporter | vojta | Assigned To | Taco | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x86_32 | OS | Debian Linux | OS Version | 2.6.36 |
Product Version | 0.64.0 | ||||
Fixed in Version | 0.65.0 | ||||
Summary | 0000525: Segmentation fault on 32-bit linux | ||||
Description | Luatex dies with a segmentation fault whenever it is run and tries to produce a (nonempty) pdf file. The problem is that pdfgen.w includes <kpathsea/c-auto.h>, but pdfpage.w does not, leading to inconsistencies in sizeof(off_t) and therefore in offsets of fields in the PDF structure. | ||||
Steps To Reproduce | luatex story | ||||
Additional Information | The following debugging session displays the problem: | % gdb texk/web2c/luatex | GNU gdb (GDB) 7.2-debian | Copyright (C) 2010 Free Software Foundation, Inc. | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | This is free software: you are free to change and redistribute it. | There is NO WARRANTY, to the extent permitted by law. Type "show copying" | and "show warranty" for details. | This GDB was configured as "i486-linux-gnu". | For bug reporting instructions, please see: | <http://www.gnu.org/software/gdb/bugs/>... | Reading symbols from /home/vojta/build/source6/texk/web2c/luatex...done. | (gdb) break pdfgen.w:111 | Breakpoint 1 at 0x80a53b4: file ./luatexdir/pdf/pdfgen.w, line 111. | (gdb) break pdfpage.w:43 | Breakpoint 2 at 0x80af013: file ./luatexdir/pdf/pdfpage.w, line 43. | (gdb) run ../x | Starting program: /home/vojta/build/source6/texk/web2c/luatex ../x | | Breakpoint 1, init_pdf_struct (pdf=0x8974c70) at ./luatexdir/pdf/pdfgen.w:112 | 112 init_pdf_pagecalculations(pdf); | (gdb) print pdf | $1 = (PDF) 0x8974c70 | (gdb) print &pdf->pstruct | $2 = (pdfstructure **) 0x8974d40 | (gdb) cont | Continuing. | | Breakpoint 2, init_pdf_pagecalculations (pdf=0x8974c70) | at ./luatexdir/pdf/pdfpage.w:43 | 43 assert(pdf != NULL); | (gdb) print pdf | $3 = (PDF) 0x8974c70 | (gdb) print &pdf->pstruct | $4 = (pdfstructure **) 0x8974d38 | (gdb) Note that the offset of pdf->pstruct has changed! This is LuaTeX, Version beta-0.64.0-2010112423 (rev 3962) | ||||
Tags | No tags attached. | ||||
|
Correction: pdfpage.w does include c-auto.h, but it does so after <sys/types.h>, so the damage has already been done. |
|
The worrying thing here is how it is possible that sizeof(off_t) changes at all. Paul, does simply swapping the includes fix the issue? |
|
Yes, swapping the includes fixes the problem, as in: @@ -22,13 +22,13 @@ "$Id: pdfpage.w 3733 2010-07-06 22:14:07Z hhenkel $ " "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/pdf/pdfpage.w $"; +#include "ptexlib.h" + #include <stdlib.h> #include <stdio.h> #include <assert.h> #include <math.h> -#include "ptexlib.h" - #define lround(a) (long) floor((a) + 0.5) @ eternal constants As for "the worrying thing", I find the following comment in <kpathsea/config.h>: /* config.h: master configuration file, included first by all compilable source files (not headers). This is included by w2c/config.h, which contains a similar comment: /* w2c/config.h: All .c files include this first. This, in turn, is included by cpascal.h, which contains a similar message: /* cpascal.h: implement various bits of standard and other Pascal that we use in the change files. Public domain. This is the top-level include file for all the web2c-generated C programs except TeX and Metafont themselves, which use texmf.h. It's not included by the web2c programs, though. */ This, in turn, is included by luatexdir/luatex.h, which is included by luatexdir/ptexlib.h, but neither of those includes a similar message. And they should. |
|
P.S.: The reason that sizeof(off_t) changes (or, rather, the reason it varies between files) is that, if <kpathsea/c-auto.h> is included, then it does #define _FILE_OFFSET_BITS 64 Then, in <features.h>, __USE_FILE_OFFSET64 gets set, which then affects the definition of off_t in <sys/types.h>. |
|
Fixed as proposed in the note, revision 3994. |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-11-25 09:08 | vojta | New Issue | |
2010-11-25 09:11 | Taco | Status | new => assigned |
2010-11-25 09:11 | Taco | Assigned To | => hhenkel |
2010-11-26 06:44 | vojta | Note Added: 0000671 | |
2010-11-26 09:57 | Taco | Assigned To | hhenkel => Taco |
2010-11-26 10:00 | Taco | Note Added: 0000673 | |
2010-11-28 02:33 | vojta | Note Added: 0000680 | |
2010-11-28 02:40 | vojta | Note Added: 0000681 | |
2010-11-28 10:42 | Taco | Note Added: 0000682 | |
2010-11-28 10:42 | Taco | Status | assigned => resolved |
2010-11-28 10:42 | Taco | Resolution | open => fixed |
2010-12-13 14:43 | Taco | Fixed in Version | => 0.65.0 |
2010-12-13 14:43 | Taco | Status | resolved => closed |