VDR 1.5.12 & text2skin: how to compile?

Message ID a3ef07920712310839r2a0f50b9oa600c7237b4b4567@mail.gmail.com
State New
Headers

Commit Message

VDRU VDRU Dec. 31, 2007, 4:39 p.m. UTC
  On Dec 31, 2007 8:14 AM, Andrey Kuzmin <maillists@egodot.net> wrote:
> Hi,
>
> I've googled and tried all patches I could find to build text2skin
> against 1.5.10 (11 and 12 too), but still could not build text2skin plugin.
> Any how-to's or working patches?

I've used every version of the current vdr developer tree and haven't
needed an updated text2skin patch since 1.5.4.  Try the attached
patch.

Also, there appears to be a problem with text2skin although it still
works fine.  If anyone cares to have a look and possibly fix it,
that'd be great!

The problem:

Stopping: VDR
*** glibc detected *** ./vdr: double free or corruption (fasttop):
0x0b1ba848 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7c94ac5]
/lib/libc.so.6(cfree+0x90)[0xb7c98570]
./PLUGINS/lib/libvdr-text2skin.so.1.5.12(_ZN14cText2SkinI18nD0Ev+0x5f)[0xb746405f]
======= Memory map: ========
08048000-08183000 r-xp 00000000 03:03 833366
/usr/local/dvb/vdr.source/vdr-1.5.12/vdr
08183000-0818c000 rw-p 0013a000 03:03 833366
/usr/local/dvb/vdr.source/vdr-1.5.12/vdr
0818c000-0b973000 rw-p 0818c000 00:00 0          [heap]
  

Comments

Reinhard Nissl Dec. 31, 2007, 8:43 p.m. UTC | #1
Hi,

VDR User schrieb:

> Also, there appears to be a problem with text2skin although it still
> works fine.  If anyone cares to have a look and possibly fix it,
> that'd be great!
> 
> The problem:
> 
> Stopping: VDR
> *** glibc detected *** ./vdr: double free or corruption (fasttop):
> 0x0b1ba848 ***
> ======= Backtrace: =========
> /lib/libc.so.6[0xb7c94ac5]
> /lib/libc.so.6(cfree+0x90)[0xb7c98570]
> ./PLUGINS/lib/libvdr-text2skin.so.1.5.12(_ZN14cText2SkinI18nD0Ev+0x5f)[0xb746405f]
> ======= Memory map: ========
> 08048000-08183000 r-xp 00000000 03:03 833366
> /usr/local/dvb/vdr.source/vdr-1.5.12/vdr
> 08183000-0818c000 rw-p 0013a000 03:03 833366
> /usr/local/dvb/vdr.source/vdr-1.5.12/vdr
> 0818c000-0b973000 rw-p 0818c000 00:00 0          [heap]

The problem is that text2skin's i18n.c uses the old structure
tI18nPhrase which contains only 22 text entries, but iterates over
I18nLanguages()->Size() entries -- and in my case, Size() returns 23, so
cText2SkinI18n::Parse() will overwrite stack variables and finally cause
the above double free.

As a quick workaround, modify VDR's i18n.h, e. g. like that:

typedef const char *tI18nPhrase[4*22]; ///< obsolete - switch to 'gettext'!

Bye.
  
Andrey Kuzmin Jan. 1, 2008, 12:30 p.m. UTC | #2
> I've used every version of the current vdr
> developer tree and haven't
> needed an updated text2skin patch since 1.5.4. 
> Try the attached
> patch.

Hello!

Thanks for your quick response. Still no luck, please tell me, what
I'm missing:

1) wget ftp://ftp.cadsoft.de/vdr/Developer/vdr-1.5.12.tar.bz2
2) successfully applied your vdr-1.5.4-text2skin.diff to VDR
3) getting text2skin from CVS to PLUGINS/src folder:

cvs -d:pserver:anoncvs@text2skin.vdr-developer.org:/var/cvsroot login
cvs -d:pserver:anoncvs@text2skin.vdr-developer.org:/var/cvsroot co text2skin

4) sed -i Makefile -e 's/VDRVERSION/APIVERSION/'   in text2skin folder

5)
make REMOTE=LIRC CPUOPT=pentium-mmx PARALLEL=PARALLEL_64_MMX
make plugins  

getting build error:

make[1]: Entering directory `/ego/vdr/33/vdr-1.5.12/PLUGINS/src/text2skin'
g++ -Wall -Woverloaded-virtual -O2 -g -c -DHAVE_IMAGEMAGICK -DHAVE_FREETYPE -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"text2skin"' -I/usr/include/freetype2 -I../../../include -I../../../../DVB/linux/include -I../../../../DVB/include -I. -o text2skin.o text2skin.c
text2skin.c: In member function ‘virtual bool cText2SkinPlugin::Start()’:
text2skin.c:28: ??????: ???????????? ?????????????? ?? ‘char*’ ? ‘int’
text2skin.c:28: ??????:   ??? ????????????? 1 -?? ????????? ‘void cText2SkinStatus::SetLanguage(int)’
make[1]: *** [text2skin.o] ?????? 1
make[1]: Leaving directory `/ego/vdr/33/vdr-1.5.12/PLUGINS/src/text2skin'

*** failed plugins: text2skin



Error message is in russian, it's about type casting... My system is Ubuntu 7.10 with latest apt-get upgrade

Thanks!
  
Ville Aakko Jan. 2, 2008, 9:59 p.m. UTC | #3
Hi,

2008/1/1, Andrey Kuzmin <maillists@egodot.net>:
>
> getting build error:
>
> make[1]: Entering directory `/ego/vdr/33/vdr-1.5.12/PLUGINS/src/text2skin'
> g++ -Wall -Woverloaded-virtual -O2 -g -c -DHAVE_IMAGEMAGICK -DHAVE_FREETYPE -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"text2skin"' -I/usr/include/freetype2 -I../../../include -I../../../../DVB/linux/include -I../../../../DVB/include -I. -o text2skin.o text2skin.c
> text2skin.c: In member function 'virtual bool cText2SkinPlugin::Start()':
> text2skin.c:28: ??????: ???????????? ?????????????? ?? 'char*' ? 'int'
> text2skin.c:28: ??????:   ??? ????????????? 1 -?? ????????? 'void cText2SkinStatus::SetLanguage(int)'
> make[1]: *** [text2skin.o] ?????? 1
> make[1]: Leaving directory `/ego/vdr/33/vdr-1.5.12/PLUGINS/src/text2skin'
>
> *** failed plugins: text2skin

I don't know why it fails (I'm using VDR 1.5.12 with text2skin
currently, on Gentoo, so it is possible to compile it). but to get the
errors in English build by typing 'LANG=C make' (i.e. change the LANG
variable during compile). That way you'll may get more answers, I
don't know how many of the programmer guys here now Russian =)

Hope you get it to compile,

- Ville
  
Andrey Kuzmin Jan. 2, 2008, 10:11 p.m. UTC | #4
> I don't know why it fails (I'm using VDR 1.5.12 with text2skin
> currently, on Gentoo, so it is possible to compile it). but to get the
> errors in English build by typing 'LANG=C make' (i.e. change the LANG
> variable during compile). That way you'll may get more answers, I
> don't know how many of the programmer guys here now Russian =)

> Hope you get it to compile,

Thanks for hint! English error message is:

ake[1]: Entering directory `/ego/vdr/33/vdr-1.5.12/PLUGINS/src/text2skin'
g++ -Wall -Woverloaded-virtual -O2 -g -c -DHAVE_IMAGEMAGICK -DHAVE_FREETYPE -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"text2skin"' -I/usr/include/freetype2 -I../../../include -I../../../../DVB/linux/include -I../../../../DVB/include -I. -o text2skin.o text2skin.c
text2skin.c: In member function 'virtual bool cText2SkinPlugin::Start()':
text2skin.c:28: error: invalid conversion from 'char*' to 'int'
text2skin.c:28: error:   initializing argument 1 of 'void cText2SkinStatus::SetLanguage(int)'
make[1]: *** [text2skin.o] Error 1
make[1]: Leaving directory `/ego/vdr/33/vdr-1.5.12/PLUGINS/src/text2skin'

*** failed plugins: text2skin
  
oleg roitburd Jan. 3, 2008, 9:12 a.m. UTC | #5
2008/1/2, Andrey Kuzmin <maillists@egodot.net>:
>
>
> ake[1]: Entering directory `/ego/vdr/33/vdr-1.5.12/PLUGINS/src/text2skin'
> g++ -Wall -Woverloaded-virtual -O2 -g -c -DHAVE_IMAGEMAGICK
> -DHAVE_FREETYPE -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"text2skin"'
> -I/usr/include/freetype2 -I../../../include -I../../../../DVB/linux/include
> -I../../../../DVB/include -I. -o text2skin.o text2skin.c
> text2skin.c: In member function 'virtual bool cText2SkinPlugin::Start()':
> text2skin.c:28: error: invalid conversion from 'char*' to 'int'
> text2skin.c:28: error:   initializing argument 1 of 'void
> cText2SkinStatus::SetLanguage(int)'
> make[1]: *** [text2skin.o] Error 1
> make[1]: Leaving directory `/ego/vdr/33/vdr-1.5.12/PLUGINS/src/text2skin'
>
> *** failed plugins: text2skin
>
> Just another thing. Try do disable HAVE_FREETYPE in Makefile. Since
VDR-core uses truetype, it's not more relevant for text2skin

Ciao
Oleg
  
VDRU VDRU Jan. 4, 2008, 6:24 a.m. UTC | #6
On Dec 31, 2007 12:43 PM, Reinhard Nissl <rnissl@gmx.de> wrote:
> Hi,
>
> VDR User schrieb:
>
> > Also, there appears to be a problem with text2skin although it still
> > works fine.  If anyone cares to have a look and possibly fix it,
> > that'd be great!
> >
> > The problem:
> >
> > Stopping: VDR
> > *** glibc detected *** ./vdr: double free or corruption (fasttop):
> > 0x0b1ba848 ***
> > ======= Backtrace: =========
> > /lib/libc.so.6[0xb7c94ac5]
> > /lib/libc.so.6(cfree+0x90)[0xb7c98570]
> > ./PLUGINS/lib/libvdr-text2skin.so.1.5.12(_ZN14cText2SkinI18nD0Ev+0x5f)[0xb746405f]
> > ======= Memory map: ========
> > 08048000-08183000 r-xp 00000000 03:03 833366
> > /usr/local/dvb/vdr.source/vdr-1.5.12/vdr
> > 08183000-0818c000 rw-p 0013a000 03:03 833366
> > /usr/local/dvb/vdr.source/vdr-1.5.12/vdr
> > 0818c000-0b973000 rw-p 0818c000 00:00 0          [heap]
>
> The problem is that text2skin's i18n.c uses the old structure
> tI18nPhrase which contains only 22 text entries, but iterates over
> I18nLanguages()->Size() entries -- and in my case, Size() returns 23, so
> cText2SkinI18n::Parse() will overwrite stack variables and finally cause
> the above double free.
>
> As a quick workaround, modify VDR's i18n.h, e. g. like that:
>
> typedef const char *tI18nPhrase[4*22]; ///< obsolete - switch to 'gettext'!

Thanks for the info Reinhard!  I know several people who have been
asking about that problem and will forward what you've shared.  Btw,
do you know if anyone is working on fixing text2skin or?

Cheers
  

Patch

diff -ruN vdr-1.5.4.orig/font.c vdr-1.5.4/font.c
--- vdr-1.5.4.orig/font.c	2007-06-17 05:13:49.000000000 -0700
+++ vdr-1.5.4/font.c	2007-06-18 09:24:39.000000000 -0700
@@ -524,3 +524,8 @@ 
      }
   return s;
 }
+
+cFont *LoadFreetypeFont(const char *Name, int CharHeight)
+{
+  return (new cFreetypeFont(Name, CharHeight));
+}
diff -ruN vdr-1.5.4.orig/font.h vdr-1.5.4/font.h
--- vdr-1.5.4.orig/font.h	2007-06-17 05:11:31.000000000 -0700
+++ vdr-1.5.4/font.h	2007-06-18 09:24:39.000000000 -0700
@@ -98,4 +98,6 @@ 
       ///< Returns the given Line. The first line is numbered 0.
   };
 
+extern cFont *LoadFreetypeFont(const char *, int);
+
 #endif //__FONT_H