Bug#750729: openyahtzee: incorrect total score and total of lower section
Olly Betts
olly at survex.com
Fri Jun 6 10:59:41 UTC 2014
On Fri, Jun 06, 2014 at 12:20:35PM +0200, Markus Koschany wrote:
> perhaps you gain a little more insight here but after your last NMU the
> total score and the total of the lower section are incorrectly
> calculated.
I did see ridiculous totals while testing an earlier version of the
patch, before I went through and fixed all the printf formats to match
the passed types. Fixing those seemed to make the go away, but testing with
the uploaded NMU I'm seeing this again. Sorry I managed to miss this.
> Do you know by any chance the cause for it? I guess it has
> something to do with an uninitialized value or a conflict between short
> and long int type variables.
Running under valgrind suggests it is an uninitialised value - the first
report I see is here:
==28836== Conditional jump or move depends on uninitialised value(s)
==28836== at 0x6703E4E: vfwprintf (vfprintf.c:1649)
==28836== by 0x679E360: __vswprintf_chk (vswprintf_chk.c:62)
==28836== by 0x5B67CC5: wxVsnprintf(wchar_t*, unsigned long, wxString const&, __va_list_tag*) (in /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0.0.0)
==28836== by 0x5B2CB7B: DoStringPrintfV(wxString&, wxString const&, __va_list_tag*) (in /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0.0.0)
==28836== by 0x5B2D24B: wxString::DoPrintfWchar(wchar_t const*, ...) (in /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0.0.0)
==28836== by 0x156C68: ??? (in /usr/games/openyahtzee)
==28836== by 0x15E437: ??? (in /usr/games/openyahtzee)
==28836== by 0x15FF49: ??? (in /usr/games/openyahtzee)
==28836== by 0x5A6191D: wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const (in /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0.0.0)
==28836== by 0x5BD4C41: wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (in /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0.0.0)
==28836== by 0x5BD4FA5: wxEvtHandler::SearchDynamicEventTable(wxEvent&) (in /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0.0.0)
==28836== by 0x5BD502D: wxEvtHandler::TryHereOnly(wxEvent&) (in /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0.0.0)
I think I see where the problem is - in wx2.8, wxString::ToLong() will
put a value into the pointer to long if it returns false, but in wx3.0 it
won't. Just testing a fix.
Cheers,
Olly
More information about the Pkg-games-devel
mailing list