[mythtv] [Preliminary patch[ Add profile groups

Geoffrey Hausheer ou401cru02 at sneakemail.com
Fri Sep 12 17:51:10 EDT 2003


On Fri, 12 Sep 2003 13:55:21 -0700, "Bruce Markey bjm-at-lvcm.com
|mythtv/1.0-Allow|" <2obvhk58d70t at sneakemail.com> said:
> Geoffrey Hausheer wrote:
> There was a problem similar to this in mythweather where a
> variable was created as equal to curCity but curCity was never
> initialized. It should have been 0 but was negative one billion.
> Explicitly initializing curCity fixed the segfault. 
> 
> It could be that "int oldrow = currentrow;" happens before
> currentrow has been set.
Of course this was my first thought too.  So I initialized it on
creation.  didn't help.  tracing through the code, it is seems like it
gets initialized before it gets used, but it is getting initialized to a
bad value.  worse, the value it is initialized to, is checked ahead of
time to make sure it is valid...
It is initialized as:
    if (resetpos)
    {
        activebutton = &(*(buttonList.begin()));
        currentrow = activebutton->row - 1;
        currentcolumn = activebutton->col - 1;
    }

in positionButtons, which is called in parseMenu, which checks that
buttonList is not empty before calling positionButtons.

So it seems likely that the element in the buttonList is bogus.  Anyhow,
once I'm back in front of my TV, a few well placed breakpoints should
identify the cause.

.Geoff


More information about the mythtv-dev mailing list