Re: [gnugo-devel] I stepped on a bug

From:

Felix C. Stegerman

Subject:

Re: [gnugo-devel] I stepped on a bug

Date:

Thu, 06 Oct 2005 17:01:50 +0200

User-agent:

Debian Thunderbird 1.0.7 (X11/20051001)

Gunnar FarnebÃ¤ck wrote:
> Felix wrote:
>
>>I can indeed reproduce the bug.
> That's good. Then we have a reasonable chance to track it down.
<snip>
> Ah, no, the backtrace we ask for is something different.
> Usually you would do like this:
> gdb gnugo
> run
> <play as usual until crash>
> bt
<snip>
> Now you should have a binary in interface/gnugo and can continue with
> the backtrace instructions, starting with "gdb interface/gnugo".
> /Gunnar
Ah, that kind of backtrace. I haven't used gdb (or any other debugger)
before, even though I'm an occasional C/C++/Perl programmer.
I've attached a log of the backtrace. I also attached a log of the
errors and warnings (everything sent to STDERR) during make.
I found that the compile log contained errors like this one:
owl.c:4867: warning: comparison is always true due to limited range of
data type
The same errors can be found in the debian build log for PPC:
http://buildd.debian.org/build.php?pkg=gnugo
I also compiled the same source on Mac OS X (running in MOL on the
same Mac Mini), which did not result in the same errors.
The problem seems to be signedness. I edited owl.c and changed char to
signed char on lines 221, 4639, 4727, 4728 and 4863. Then I recompiled
gnugo. After that a quick test seems to indicate the bug is gone.
This fix is probable a bit to simple, and I haven't read the entire
code (or even the entire file owl.c), but this should help you fix it.
I'd appreciate it if you'd let me know whether this signedness problem
is a bug in gnugo or in gcc. I'm not sure whether chars are meant to
be signed or unsigned by default
Regards,
Felix
--
Felix C. Stegerman <address@hidden>
"Any sufficiently advanced bug is indistiguishable from a feature."
-- R. Kulawiec