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 UAA17352; Fri, 26 Mar 2004 20:00:18 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 UAA17708 for ; Fri, 26 Mar 2004 20:00:17 +0100 (MET) Received: from orcaware.com (bdsl.66.12.233.174.gte.net [66.12.233.174]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2QJ0rKW000612 for ; Fri, 26 Mar 2004 20:00:54 +0100 Received: from orcaware.com (localhost.localdomain [127.0.0.1]) by orcaware.com (8.12.8/8.12.8) with ESMTP id i2QJ04dq031895; Fri, 26 Mar 2004 11:00:04 -0800 Message-ID: <40647DB3.39AD0635@orcaware.com> Date: Fri, 26 Mar 2004 11:00:03 -0800 From: Blair Zajac X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en,x-ns1rfacHe4WNh5,x-ns2U100btwUq5f MIME-Version: 1.0 To: Kenneth Knowles CC: caml-list@inria.fr Subject: Re: [Caml-list] segfault in Unix.gethostbyname References: <20040326182202.GA28843@tallman.kefka.frap.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; blair:01 zajac:01 blair:01 orcaware:01 caml-list:01 segfault:01 knowles:99 segfault:01 ocaml-c:01 clue:01 gdb:01 ocamlrun:01 gdb:01 usr:01 usr:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 378 Kenneth Knowles wrote: > > Hi all, > > I get a segfault from Unix.gethostbyname whenever I have wins enabled in my > nsswitch.conf, but with wins removed everything is fine. I'm hoping someone > with more unix/ocaml-C experience will have a clue. This was actually working a > week ago, but I had to "flatten and reinstall" my system. > > $ grep wins /etc/nsswitch.conf > hosts: files wins dns > > $ gdb ocamlrun > (gdb) run /usr/local/bin/ocaml unix.cma > Starting program: /usr/local/bin/ocamlrun /usr/local/bin/ocaml unix.cma > Objective Caml version 3.07+2 > > # Unix.gethostbyname "dbdev";; > > Program received signal SIGSEGV, Segmentation fault. > 0x080536c3 in string_set () > (gdb) bt > #0 0x080536c3 in string_set () > #1 0x4034b971 in _nss_wins_gethostbyname2_r () from /lib/libnss_wins.so.2 > #2 0x403cb42c in bLoaded () from /lib/libnss_wins.so.2 > #3 0x4039bb5b in ?? () from /lib/libnss_wins.so.2 > #4 0x00000294 in ?? () > > Now I can see it is some kind of string error, and it occurs in the WINS > library, but I'm sure it traces back somehow to the ocaml String_val(..) I believe you're running into a problem where the Samba code is binding to the string_set symbol in Ocaml and not in the Samba library. You'll find a string_set in Ocaml's byterun/str.c. Probably the easiest solution is to get CVS HEAD of ocaml which has renamed many function names to have "caml_" prepended, thus avoiding this issue. Best, Blair -- Blair Zajac Plots of your system's performance - http://www.orcaware.com/orca/ ------------------- 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