Subject: Re: select()/i386
To: Patrick Welche <prlw1@newn.cam.ac.uk>
From: David Brownlee <abs@anim.dreamworks.com>
List: netbsd-help
Date: 04/05/1999 01:26:22
That looks perfectly sane - what arch and OS version are you
using? Also, are you certain its coming from that select() call,
and not one somewhere else in the program :)
David/absolute
-=- "They're only red from all the thoughts unused inside my head" -=-
On Tue, 30 Mar 1999, Patrick Welche wrote:
> I was wondering if someone could give me some hints/tips debugging
>
> Program terminated with signal 11, Segmentation fault.
> #0 0x16235 in select ()
>
> This is actually in postgresql, fe-misc.c, pqWait():
>
> fd_set input_mask;
> fd_set output_mask;
> ...
> FD_ZERO(&input_mask);
> FD_ZERO(&output_mask);
> if (forRead)
> FD_SET(conn->sock, &input_mask);
> if (forWrite)
> FD_SET(conn->sock, &output_mask);
> if (select(conn->sock + 1, &input_mask, &output_mask,
> (fd_set *) NULL, (struct timeval *) NULL) < 0)
>
> Now, conn->sock=7, forRead=1, forWrite=0,
> input_mask ={fds_bits = {128, 0, 0, 0, 0, 0, 0, 0}}
> output_mask={fds_bits = { 0, 0, 0, 0, 0, 0, 0, 0}}
>
> So, all seems OK, so why the segfault? The only reference to select() I can
> find is a declaration in src/lib/libc/obj/LintSysNormal.c, so I don't know
> where to UTSL. From the sun os 6.5 man page, there is a suggestion that
> maybe &output_mask=(fd_set *)NULL might be handled differently to an
> output_mask set to zero - is this the case?
>
> Cheers,
>
> Patrick
>