Mailing List archive

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

[vdr] Re: VDR 1.3.11 crashes with games plugin 0.6.1



I demand that Clemens Kirchgatterer may or may not have written...

>> Bernd Oefinger a écrit :
>>> I'm using version 0.6.1 of vdr-games plugin. It compiles without
>>> problems, VDR starts without problems and the menu entry "games" is
>>> displayed in OSD. When I select it to play games VDR crashes
>>> (segmentation fault).

> seems to be a compiler bug.

> Rolf Ahrenberg (THX), sent me the following patch:

> in launcher.cpp

>         while (menu[i].name) {
> -               games[i] = menu[i++].name;
> +              games[i] = menu[i].name;
> +              i++;
>         }

That's not a compiler bug. The original code is buggy: it relies on undefined
behaviour related to when i is incremented, which could be before or after
the write to games[i] (but, given that i is an integer of some sort, always
after reading menu[i].name).

gcc will warn about this kind of error if you use -Wall or -Wsequence-point.
Unfortunately, g++ (3.3.x) doesn't...

[snip]
-- 
| Darren Salt | d youmustbejoking,demon,co,uk | nr. Ashington,
| Debian,     | s zap,tartarus,org            | Northumberland
| RISC OS     | @                             | Toon Army
|   <URL:http://www.youmustbejoking.demon.co.uk/> (PGP 2.6, GPG keys)

See that buzzer, that's your sound card, that is.




Home | Main Index | Thread Index