Mailing List archive

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

[vdr] Re: solved: segment faults from osdtelext plugin



C.Y.M wrote:
Darren Salt wrote:

I demand that Rainer Zocholl may or may not have written...


After replacing all obviously/known not thread save clib calls
with their thread save counterparts osdteletext now runs!


I would not waste any time to investigate which of those
calls are the minimum or why the seg faults are caused in detail.
There is no adavantage using non-thread save functions in a
multithreaded environment. The overhead is neglectable.

[snip patch]

I've gone through and recompiled vdr and the plugins which are installed
here, based on what you've done. Patches attached (note that vdr-remote
didn't need to be patched).



I have found a few more plugins that require "safe" threading fixes. Steamdev, Text2skin, and MP3. Attached are the following errors after poisoning.


Text2Skin:

/usr/include/dirent.h:155:23: attempt to use poisoned "readdir"
loader.c:19:31: attempt to use poisoned "readdir"
make[1]: *** [loader.o] Error 1


Here is a patch for text2skin after poisoning.

--- loader.c.orig	2004-12-04 15:42:24.000000000 -0800
+++ loader.c	2004-12-04 16:03:48.000000000 -0800
@@ -2,6 +2,7 @@
  * $Id: loader.c,v 1.12 2004/06/22 16:48:03 lordjaxom Exp $
  */
 
+#include <dirent.h>
 #include "loader.h"
 #include "data.h"
 #include "i18n.h"
@@ -10,13 +11,12 @@
 #include "text2skin.h"
 #include <vdr/plugin.h>
 #include <sys/types.h>
-#include <dirent.h>
 
 void cText2SkinLoader::Start(void) {
 	DIR *d = opendir(SkinPath());
 	if (d) {
-		struct dirent *ent;
-		while ((ent = readdir(d)) != NULL) {
+		struct dirent *ent, path;
+		while (!readdir_r(d, &path, &ent) && ent != NULL) {
 			char *path;
 			struct stat buf;
 			if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)

Home | Main Index | Thread Index