From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id GAA01746; Mon, 23 Sep 2002 06:41:28 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id GAA02671 for caml-list@pauillac.inria.fr; Mon, 23 Sep 2002 06:41:27 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA20484 for ; Fri, 20 Sep 2002 15:56:35 +0200 (MET DST) Received: from students.mimuw.edu.pl (zodiac.mimuw.edu.pl [193.0.96.128]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g8KDuYD12346 for ; Fri, 20 Sep 2002 15:56:34 +0200 (MET DST) Received: by students.mimuw.edu.pl (Postfix, from userid 2733) id 2A1DA179C0; Fri, 20 Sep 2002 15:47:21 +0200 (CEST) Date: Fri, 20 Sep 2002 15:47:21 +0200 From: Cezary Kaliszyk To: caml-list@inria.fr Subject: [Caml-list] Ocaml 3.06 bug Message-ID: <20020920134721.GA19681@zodiac.mimuw.edu.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline User-Agent: Mutt/1.3.27i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Concerning Ocaml version 3.06 on i686/Linux There is a bug in the Unix library, which makes my program exit with no warning message. It happens when I call Unix.write two times on a descriptor closed by the other side. When I connect to the server and close the connection during 5 seconds (ie using telnet) the server somehow exits the 'while true do'. The first write is ok, the second exits the program. Putting a "try .. with _ -> ()" inside the loop doesn't correct it. It works the same way when compiled with ocamlc and ocamlopt. The maximally simplifided server code producing the error: open Unix;; let addr =3D ADDR_INET (inet_addr_any, 1717);; let sock =3D socket PF_INET SOCK_STREAM 0;; bind sock addr; listen sock 10; while true do let (desc,caller) =3D accept sock in sleep 5; let _ =3D write desc "asd" 0 3 in let _ =3D write desc "qwe" 0 3 in () done;; --=20 --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Dalsze informacje znajdują się na http://www.gnupg.org/ iD8DBQE9iyboYfPl1pqp6/URAgiqAKC/LMNKxBOU8erK39T2ca75J4DWzgCg4yM8 25SdlawKwPd29Zc0eKiAdxE= =pBkg -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners