Some small bug in vdr 1.4.0

Message ID 44709617.20804@e-tobi.net
State New
Headers

Commit Message

Tobias Grimm May 21, 2006, 4:32 p.m. UTC
  Hi!

While checking some plugins with valgrind, I stumbled across this minor
bug in vdr:

The skinDescriptions array allocated in cMenuSetupOsd should be deleted
with delete[] instead of delete.

bye,

Tobias
  

Comments

Grégoire Favre May 24, 2006, 6:41 a.m. UTC | #1
On Sun, May 21, 2006 at 06:32:23PM +0200, Tobias Grimm wrote:

Hello,

> While checking some plugins with valgrind, I stumbled across this minor
> bug in vdr:

That's great, is there a "tutorial" for using valgrind ?

I have a "quiete patched" vdr which produce :
*** glibc detected *** corrupted double-linked list: 0x000000000071b510 ***

Thank you very much,
  
Tobias Grimm May 24, 2006, 5:42 p.m. UTC | #2
Gregoire Favre wrote:

>That's great, is there a "tutorial" for using valgrind ?
>  
>

See here:

http://www.cprogramming.com/debugging/valgrind.html
http://valgrind.org/

for the Debian vdr packages in my repository (sorry, german only) :
http://www.e-tobi.net/blog/articles/2006/04/30/speicherlecks-im-vdr-finden

Debugging a vdr plugin with valgrind is a little bit tricky, because the
symbols get lost, when VDR unloads the plugins. That's why I've built a
small patch for the Debian vdr debug package. With this patch, you can
force VDR to keep the plugin libs loaded with the options -k or
--keep-plugins.

I've attached the patch to this mail.

Don't forget to compile VDR and the plugins with debugging informaton (
-g  ) and without optimization (-O0)  - and don't strip the symbols from
the binary!

bye,

Tobias
  
Grégoire Favre May 26, 2006, 7:04 p.m. UTC | #3
On Wed, May 24, 2006 at 07:42:21PM +0200, Tobias Grimm wrote:

> Don't forget to compile VDR and the plugins with debugging informaton (
> -g  ) and without optimization (-O0)  - and don't strip the symbols from
> the binary!

Hello,

very very interesting !!!

(Un)fortunately, without -O3 my VDR don't crash anymore : -O2 is perfect !!!

Thank you very much,
  
Clemens Kirchgatterer May 26, 2006, 9:17 p.m. UTC | #4
Gregoire Favre <gregoire.favre@gmail.com> wrote:

> On Wed, May 24, 2006 at 07:42:21PM +0200, Tobias Grimm wrote:
> 
> > Don't forget to compile VDR and the plugins with debugging
> > informaton ( -g  ) and without optimization (-O0)  - and don't
> > strip the symbols from the binary!

> (Un)fortunately, without -O3 my VDR don't crash anymore : -O2 is
> perfect !!!

sounds as you are overrunning memory somewhere (off by one error). you
can ofcourse use valgrind and gdb even on optimized code, but they work
better when not optimizing.

clemens
  

Patch

--- vdr-1.4.0.orig/menu.c
+++ vdr-1.4.0/menu.c
@@ -2131,7 +2131,7 @@ 
 cMenuSetupOSD::~cMenuSetupOSD()
 {
   cFont::SetCode(I18nCharSets()[Setup.OSDLanguage]);
-  delete skinDescriptions;
+  delete[] skinDescriptions;
 }
 
 void cMenuSetupOSD::Set(void)