two bugs (sockets & procs), 1 fix.

From: Harvey J. Stein <hjstein_at_MATH.HUJI.AC.IL>
Date: Mon, 18 Sep 1995 09:07:21 +0200

There's a bug in the socket code in STk 2.2.0. The problem is that it
doesn't close all sockets it creates. If you open alot of sockets in
a long running program, this can lead to leaving tons of sockets in
the close-wait state. My linux box certainly wasn't happy with this... :).

The problem is that the handles are dupped, but one of the copies is
fdopened twice (as opposed to each copy being fdopened once). Since
only the streams are kept around, this leads to one inaccessible open
stream per socket opened.

The fix is to edit Src/socket.c. Change:

  if(!((fs = fdopen(s, "r")) && (ft = fdopen(s, "w")))) {


  if(!((fs = fdopen(s, "r")) && (ft = fdopen(t, "w")))) {

(i.e. - The second call to fdopen should open t, not s).

The second bug is that run-process kills STk when the process exits.
I believe this has been reported before, but I think it was reported for
an older version, so I'd like to report that it still happens in STk
2.2.0 under Linux kernel 1.2.8.

For example:

lsc:/tmp$ snow
Welcome to the STk interpreter version 2.2 [Linux-1.X-ix86]
Copyright (C) 1993,1994,1995 Erick Gallesio - I3S - CNRS / ESSI <>
STk> (run-process "ls")
#<process PID=1828>
STk> ftp.log mdw rm.lst tar-error
htstatus.g00071 new.lst rmscript
in.lst old.lst skip.lst


Dr. Harvey J. Stein
Berger Financial Research
Received on Mon Sep 18 1995 - 09:08:14 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST