[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#618033: texlive-bin-2009: Missing -D_FILE_OFFSET_BITS=64 leads to files not opening (x86 /32bit)



Package: texlive-binaries
Version: 2009-8
Severity: normal

Dear all,

	thank you for all the effort putting a distriubtion together.

After upgrading to the lastly relased stable, I found that pdflatex would
not find (and therefore compile) the files given on the command line,
which were mounted by CIFS.

The error occurs in the kpathsea library (texk/kpathsea/readable.c), where the stat fails with the errno set to EOVERFLOW. It fails because the offset is to large. After I added manually -D_FILE_OFFSET_BITS=64 (following the stat 2 man page), kpathsea/pdflatex finds the file and compiles it happily. I added "a patch", which illustrates my hack to find and circumvent the problem.

Could that be that AC_SYS_LARGEFILE is missing in configure.ac while it is listed in common.ac.orig?

I am using
Linux 2.6.32-5-686 #1 SMP Wed Jan 12 04:01:41 UTC 2011 i686 GNU/Linux
and
libc6-i686     2.11.2-10

Happy to answer any further questions.

Sincerely yours
	Pierre Schnizer

--
+---------------------------------------------------------------------+
  Pierre Schnizer  <p.schnizer@gsi.de>

GSI Helmholtzzentrum fuer  Schwerionenforschung GmbH
Planckstrasse 1
D-64291 Darmstadt
www.gsi.de

Gesellschaft mit beschraenkter Haftung
Sitz der Gesellschaft: Darmstadt
Handelsregister: Amtsgericht Darmstadt, HRB 1528

Geschaeftsfuehrung: Professor Dr. Dr. h.c. Horst Stoecker, Dr. Hartmut Eickhoff
Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph
Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt
+---------------------------------------------------------------------+
--- texlive-bin-2009/debian/rules	2011-03-12 21:23:52.000000000 +0100
+++ texlive-bin-2009-modified/debian/rules	2011-03-13 16:49:37.000000000 +0100
@@ -18,6 +18,15 @@
 ifneq (,$(filter $(DEB_BUILD_ARCH),$(GCC_44_ARCHES)))
     export CC=gcc-4.4
     export CXX=g++-4.4
+else
+    # This is a hack here. I used it to rebuild the binaries on x86/32bit and 
+    # check that the stat() call would then succeed in 
+    # texlive-bin-2009/texk/kpathsea/readable.c
+    # I guess that necessity for the flag should be detected by autconf/automake
+    # I am not familiar enough with the GNU buildchain to try that
+    # Pierre
+    export CC=gcc -D_FILE_OFFSET_BITS=64
+    export CXX=g++ -D_FILE_OFFSET_BITS=64
 endif
 
 ifneq (,$(filter $(DEB_BUILD_ARCH),$(RELAX_ARCHES)))
--- texlive-bin-2009/texk/kpathsea/readable.c	2009-03-16 16:13:07.000000000 +0100
+++ texlive-bin-2009-modified/texk/kpathsea/readable.c	2011-03-13 16:44:41.000000000 +0100
@@ -58,9 +58,51 @@
 		  !(st & FILE_ATTRIBUTE_DIRECTORY));
 }
 #else
+
+#if 0
+/*
+ * This function here has the same functionality as the macro below. It was
+ * used to identify that the file not found error was due to the return
+ * value of stat as soley interpreted as a non existing file.
+ */
+static int
+readdable(const char * fn, struct stat *st)
+{
+  int flag;
+
+  flag = access(fn, R_OK);
+  if(flag != 0){
+    fprintf(stderr, "%s:%d readdable: Failed on access for %s\n",
+	    __FILE__, __LINE__,  fn);
+    return 0;
+  }
+  flag = stat (fn, st);
+  if(flag != 0){
+    fprintf(stderr, "%s:%d  readdable: Failed on stat for %s with errno %d ? EOVERFLOW = %d\n",
+	    __FILE__, __LINE__,  fn, errno, EOVERFLOW);
+    perror("Stat failed:");
+    return 0;
+  }
+
+  flag = S_ISDIR (st->st_mode);
+  if (flag == 0){
+    fprintf(stderr, "%s:%d  file readdable %s\n",
+	    __FILE__, __LINE__,  fn);
+      return 1;
+  }
+
+  fprintf(stderr, "%s:%d  readdable: Failed on stat for %s\n",
+	  __FILE__, __LINE__,  fn);
+  return 0;
+
+}
+#define  READABLE(fn, st) readdable(fn, &(st))
+#else
 #define READABLE(fn, st) \
   (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode))
 #endif
+#endif
+
 
 /* POSIX invented the brain-damage of not necessarily truncating
    filename components; the system's behavior is defined by the value of

Reply to: