From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id A9060BB81 for ; Mon, 12 Dec 2005 01:39:00 +0100 (CET) Received: from mailx.valdosta.edu (mailx.valdosta.edu [168.18.130.251]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jBC0cwvD022283 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 12 Dec 2005 01:39:00 +0100 Received: from blazemail.valdosta.edu (VO44216.valdosta.edu [168.18.130.208]) by mailx.valdosta.edu (8.13.4/8.13.4) with ESMTP id jBC0cuIb029838 for ; Sun, 11 Dec 2005 19:38:56 -0500 (EST) (envelope-from jtbryant@valdosta.edu) Disposition-Notification-To: jtbryant@valdosta.edu Received: from luminis (luminis [168.18.130.219]) by blazemail.valdosta.edu (iPlanet Messaging Server 5.2 HotFix 2.04 (built Feb 8 2005)) with SMTP id <0IRD000UU0GVBW@blazemail.valdosta.edu> for caml-list@yquem.inria.fr; Sun, 11 Dec 2005 19:38:55 -0500 (EST) Date: Sun, 11 Dec 2005 19:38:55 -0500 (EST) From: Jonathan T Bryant Subject: Closer on the Mysterious bug To: caml-list@yquem.inria.fr Message-id: <4559609.1134347935847.JavaMail.jtbryant@valdosta.edu> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7BIT X-PMX-Version: 5.1.1.222179, Antispam-Engine: 2.1.0.0, Antispam-Data: 2005.12.11.31 X-Miltered: at nez-perce with ID 439CC6A3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bug:01 bug:01 segfault:01 freezes:01 gdb:01 segfault:01 comming:01 fdset:01 fdlist:01 ocaml:01 ocaml:01 3.08.3:01 fdset:01 fdlist:01 val:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Everyone, Now I've fixed the Unix_error(12, "accept, "") bug: I thought passing 0 to select made in wait indefinitely, so I inadvertently created a race condition. I set it to 0 on all of the calls and that bug disappeared. Also, I'm catching all of the exceptions and printing out a message when I do, but they are closing as (or, for that matter, when) expected. All that's left is the segfault. It still occurs at random times: sometimes before any connections are established, sometimes after all the connections have terminated, and sometimes right in the middle. Sometimes it even freezes for a moment (about 2 sec) before it crashes. GDB says the segfault is comming from fdset_to_fdlist(), which leads me to Unix.select. Here's the source of that C function since not everybody will have the same version of OCaml as me (OCaml 3.08.3): static value fdset_to_fdlist(value fdlist, fd_set *fdset) { value l; value res = Val_int(0); Begin_roots2(l, res); for (l = fdlist; l != Val_int(0); l = Field(l, 1)) { int fd = Int_val(Field(l, 0)); if (FD_ISSET(fd, fdset)) { value newres = alloc_small(2, 0); Field(newres, 0) = Val_int(fd); Field(newres, 1) = res; res = newres; } } End_roots(); return res; } Any ideas? BTW, If you need to look at my updated code, it's available at http://jonboy.isa-geek.com/ --Jonathan ----------------------- --Jonathan Bryant jtbryant@valdosta.edu AIM: JonBoy3182 OAS AAS LLS ZG214