The availability of socketbits.h?

Xu Qiang Qiang.Xu at fujixerox.com
Tue May 17 20:25:23 PDT 2005


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=0; 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 before it can be compiled and run successfully. The developers don't check their product before shipping out? I have compiled and installed quite a number 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




More information about the freebsd-questions mailing list