Mailing List archive

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

[vdr] Avoiding NPTL problems



Since there are apparently still massive problems with running
VDR on an NPTL system, and I currently don't plan to set up an
NPTL system myself and spend time debugging this, and also because
the patches suggested by Werner Fink <werner@suse.de> in the
"Driver or VDR Problem setting and jusageing cutmarks on Nexus 2.1"
and Ludwig Nussel <ludwig.nussel@gmx.de> in the "[PATCH] NPTL" thread
change a bit too much for my taste (maybe that is all necessary after
all, but I just can't verify it myself now), I'm planning on adding a few lines
of code to VDR/vdr.c, which check for the presence of NPTL and, in case
it is, exit the program and tell the user to do 'export LD_ASSUME_KERNEL=2.4.1'
before starting vdr.

I know this is not a fix, just a workaround, but since everything appears
to run fine with 'LD_ASSUME_KERNEL=2.4.1' I guess it is better to stop
VDR right at the beginning than let it run a while and get into trouble
later.

Attached is a patch against VDR 1.3.10 that implements this.
I would appreciate if somebody with an NPTL system could check
if this actually works.

If somebody knows of a way in which VDR could turn off NPTL at runtime,
that would be even better. I don't believe simply doing

 setenv("LD_ASSUME_KERNEL", "2.4.1", 1);

at program start (from inside VDR) would be enough, or would it?

Klaus
--- vdr.c	2004/05/16 10:12:43	1.181
+++ vdr.c	2004/06/10 12:58:48
@@ -84,6 +84,17 @@
 
 int main(int argc, char *argv[])
 {
+#ifdef _CS_GNU_LIBPTHREAD_VERSION
+  // Check for NPTL and exit if present - VDR apparently doesn't run well with NPTL:
+  char LibPthreadVersion[128];
+  if (confstr(_CS_GNU_LIBPTHREAD_VERSION, LibPthreadVersion, sizeof(LibPthreadVersion) > 0)) {
+     if (strstr(LibPthreadVersion, "NPTL")) {
+        fprintf(stderr, "vdr: please turn off NPTL by setting 'export LD_ASSUME_KERNEL=2.4.1' before starting vdr");
+        return 1;
+        }
+     }
+#endif
+
   // Save terminal settings:
 
   struct termios savedTm;

Home | Main Index | Thread Index