Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

More or less out of the blue, I've gotten the following:

xelatex: Bad file descriptor
Latexmk: fls file doesn't appear to have been made

I've no clue about the first and the second is confusing in that the appropriate .fls file was created during the latexmk run. Since my text is mostly \input based, I narrowed it down to two files. One has undergone significant change so it is the likely target for investigation based on the debugging rule of whatever changed is the problem but the other was a simple inclusion for the bibliography which has not changed in quite some time. I've done a latexmk -C filename several times without improvement. It creates the .pdf file but still fails with:

Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256

As an aside, where does Latexmk put the errors is finds and 'collects'? Nor can I seem to find what 'code 256' actually means.

Suggestions, brickbats, pointers all welcome at this point.

UPDATE: Here is a MWE that duplicates (at least for me) the problem:

First the test.tex file:

\documentclass{memoir}
\begin{document}
\input{bibliography}
\end{document}

Then the bibliography.tex file as \input above

\nocite{*}
\bibliographystyle{plain}
\bibliography{test}

And then the actual test.bib file:

@book{Bateman.1906,
 author = {Bateman, Newton and Selby, Paul and Short, William F.},
 year = {1906},
 title = {Historical encyclopedia of Illinois},
 address = {Chicago},
 publisher = {Munsell Pub. Co.}
}

@book{Beckett.1966,
 author = {Beckett, J. C.},
 year = {1966},
 title = {The making of modern Ireland, 1603-1623},
 address = {London},
publisher = {Faber}
}

UPDATE II: Just in case here is the latexmkrc file I use:

$pdf_mode = $preview_mode = 1;
$dvi_mode = $postscript_mode = 0;
$pdflatex = "xelatex %O %S";
$hash_calc_ignore_pattern{'dat'} = '^.*$';
$pdf_previewer = 'start "c:/Program Files/SumatraPDF/SumatraPDF.exe" %O %S';

The only oddness that I can think of is the $hash_calc_ignore_pattern{'dat'} which skips over a .dat file I use for versioning.

UPDATE III Screen dump including 'clean' and run:

+C:\>latexmk -C test
Latexmk: This is Latexmk, John Collins, 11 Nov. 2012, version: 4.35.
**** Report bugs etc to John Collins <collins at phys.psu.edu>. ****
Latexmk: Examining fdb file 'test.fdb_latexmk' for rules ...

+C:\>latexmk test
Latexmk: This is Latexmk, John Collins, 11 Nov. 2012, version: 4.35.
**** Report bugs etc to John Collins <collins at phys.psu.edu>. ****
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': Rules & subrules not known to be previously run:
   pdflatex
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'xelatex  -recorder  "test.tex"'
------------
This is XeTeX, Version 3.1415926-2.4-0.9998 (MiKTeX 2.9)
entering extended mode
(C:\Users\hsmyers\Desktop\Jourdan\test\test.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
 lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\memoir\memoir.cls"
Document Class: memoir 2011/03/06 v3.6j configurable book, report, article docu
ment class
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\ifetex\ifetex.sty"
("C:\Program Files\MiKTeX 2.9\tex\plain\ifetex\ifetex.tex"))
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\misc\etex.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\memoir\mem10.clo")
("C:\Program Files\MiKTeX 2.9\tex\latex\memoir\mempatch.sty"))
(C:\Users\hsmyers\Desktop\Jourdan\test\test.aux)
(C:\Users\hsmyers\Desktop\Jourdan\test\bibliography.tex
(C:\Users\hsmyers\Desktop\Jourdan\test\test.bbl
bibitemlist
)) [1] (C:\Users\hsmyers\Desktop\Jourdan\test\test.aux)

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

 )
Output written on test.pdf (1 page).
Transcript written on test.log.
Latexmk: Found input bbl file 'test.bbl'
Latexmk: References changed.
Latexmk: Log file says output to 'test.pdf'
Latexmk: Found bibliography file(s) [test.bib]
Latexmk: applying rule 'bibtex test'...
Rule 'bibtex test': The following rules & subrules became out-of-date:
      'bibtex test'
------------
Run number 1 of rule 'bibtex test'
------------
For rule 'bibtex test', running '&run_bibtex(  )' ...
------------
Running 'bibtex  "test"'
------------
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'test.aux'
------------
Run number 2 of rule 'pdflatex'
------------
------------
Running 'xelatex  -recorder  "test.tex"'
------------
xelatex: Bad file descriptor
Latexmk: fls file doesn't appear to have been made
Latexmk: Found input bbl file 'test.bbl'
Latexmk: References changed.
Latexmk: Log file says output to 'test.pdf'
Latexmk: Found bibliography file(s) [test.bib]
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.

Sorry about the length even with a short MWE it ran fairly long.

RESOLUTION??: While thrashing around trying various things I stumbled across a fix. Note that I said 'a' fix, not 'the' fix since while this works it doesn't tell me what was wrong in the first place :( What I did was run TexWorks which to my surprise ran to completion without error. Then because I'm both curious and paranoid, I made a slight change and then ran latexmk again. Likewise to completion without error. So there you have it---job well done---NOT! On the other hand I'm back up and running if still somewhat ignorant.

share|improve this question

closed as off-topic by Joseph Wright Aug 13 '13 at 10:58

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Does xelatex go through if you run it on its own? –  doncherry Apr 16 '13 at 21:55
    
@doncherry Hmmmm---seems to work fine. Perplexed. –  hsmyers Apr 16 '13 at 22:41
    
@doncherry Just for grins I re-ran latexmk after the successful xelatex run and it produced the same problematic output as the preceding. I suppose the good news is that I can run things by hand until I either figure out what is wrong or am told (either will do fine...) –  hsmyers Apr 16 '13 at 23:12
    
I can’t possibly claim to be an expert on compiling, but I’d try to boil the files further down to a classic MWE, i.e. remove stuff and recompile until the error disappears to see what the trouble is. Sorry if this is trivial and/or irrelevant to you – looking at your impressive coding vita .. :). One way or the other, some of the pros are bound to come by soon, probably including John Collins, the creator of latexmk. –  doncherry Apr 16 '13 at 23:47
2  
You also need to show us the screen output around where xelatex was run. That might possibly give more information. The collected information at the end is just indicating that you need to look in detail at what appears earlier on the screen. The code 256 is from when latexmk ran xelatex, as reported by the system function of Perl. It implies that the program xelatex itself gave a return code 1 at the operating-system level. Latexmk reports the code because it saw that xelatex failed, but did not see any error messages it is programmed to analyze. –  John Collins Apr 17 '13 at 16:17

Browse other questions tagged or ask your own question.