[BUG] Socket assumes connection in Linux

Stephan Rudlof sr at evolgo.de
Sat Mar 31 14:52:46 UTC 2001


Patrick,

could you post this patch marked (prefix of subject) as
	[BUG][FIX][VM][UNIX]
again?

Preferable with the patch file attached (in addition to the description in the
body).

This enhances the probability to attract the attention it needs to have
(Ian?)...

Greetings,

Stephan

Patrik Nordebo wrote:
> 
> On Thu, Mar 29, 2001 at 10:11:25AM -0500, ajh18 at cornell.edu wrote:
> > Patrik, thanks for looking at this socket problem.  If you have a chance
> > please look at the socket semaphore corruption problem also.  I posted a
> > bug report about this on March 26 and its entitled "[BUG] Socket
> > semaphore corrupted (Unix VM)".  I wish I could help but I am not
> > familiar with platform specifics.  Smalltalk has happily sheltered me
> > from those details for many years.
> 
> This problem appears to be a VM problem, because AFAICT, the Unix
> socket implementation never signals the semaphore, but it still
> remains at 1.
> 
> BTW, Squeak is constantly segfaulting for me if I quit it after having
> opened a socket. It seems to me that this should be happening to
> everyone running Squeak on Linux/Unix, but I haven't seen anyone
> mention it. I missed it while I was writing my fix because I was tired
> and I wasn't looking for it.
> 
> This happens because when the asynchronous I/O system shuts down it
> first sets the pointer to the private socket structure to 0, then
> tries to close the socket in the private socket structure. This should
> never ever work. Reversing the order of these two operations appears to
> cure the problem.
> 
> Patch:
> --- sqUnixSocket_orig.c Wed Mar 28 05:58:18 2001
> +++ sqUnixSocket.c      Sat Mar 31 07:20:39 2001
> @@ -502,8 +502,8 @@
>    for (i= 0; i < lastSocket+1; i++)
>      if (sockets[i])
>        {
> -       aioDisable(sockets[i]);
>         close(sockets[i]->s);
> +       aioDisable(sockets[i]);
>        }
>  }

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list