Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2005 11:27:32 +0800
From:      Xu Qiang <Qiang.Xu@fujixerox.com>
To:        Dan Nelson <dnelson@allantgroup.com>, Xu Qiang <Qiang.Xu@fujixerox.com>
Cc:        freebsd-questions@freebsd.org
Subject:   RE: The availability of socketbits.h?
Message-ID:  <20050518031812.34AF31D92E@imss.sgp.fujixerox.com>

next in thread | raw e-mail | index | archive | help
Dan Nelson wrote:
> It's usually caused by an incorrect pointer, or a stack overflow,
> where the program tries to read a memory address not available to it.
> In fact, I can see the problem right away.  command_list is a
> statically-initilized array (defined at command_list.h:55).  Note that
> there is no special "end-of-list" value at the end of the array.  The
> loop at command.c:1149 loops until command_list[i].comm_name is NULL,
> but since there's no explicit NULL entry at the end, the loop falls
> off the end of the array, where it eventually hits an unmapped page of
> memory and gets a bus error.
> =

> That for loop should really read:
> =

>   for(i=3D0; i<command_count; i++) {
> =

> , since command_count should already be set to COUNTOF(command_list)
> by a previous call to command_init().

Thank you, Dan. Your fix works!

Still, I wonder why the fix of Giorgos doesn't work, because it seems quite=
 right to me, too.

(Btw, I can't understand why this software has so many bugs to be fixed bef=
ore it can be compiled and run successfully. The developers don't check the=
ir product before shipping out? I have compiled and installed quite a numbe=
r of GNU softwares, never saw such a buggy one. Yet, I am a go game lover, =
and want to set up a local NNGS server. And this is the only available open=
 source go server software in the world. Alas!)

Regards,
Xu Qiang




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050518031812.34AF31D92E>