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 TAA15082; Fri, 26 Mar 2004 19:22:17 +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 TAA14192 for ; Fri, 26 Mar 2004 19:22:16 +0100 (MET) Received: from calmail-cl.berkeley.edu (mailfarm.Berkeley.EDU [128.32.61.106]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2QIMrKW029047 for ; Fri, 26 Mar 2004 19:22:54 +0100 Received: from [64.162.212.212] (HELO tallman.kefka.frap.net) by calmail-cl.berkeley.edu (CommuniGate Pro SMTP 4.1.8) with SMTP id 9912694 for caml-list@inria.fr; Fri, 26 Mar 2004 10:22:14 -0800 Received: by tallman.kefka.frap.net (sSMTP sendmail emulation); Fri, 26 Mar 2004 10:22:02 -0800 Date: Fri, 26 Mar 2004 10:22:02 -0800 From: Kenneth Knowles To: caml-list@inria.fr Subject: [Caml-list] segfault in Unix.gethostbyname Message-ID: <20040326182202.GA28843@tallman.kefka.frap.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i 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; knowles:99 segfault:01 segfault:01 ocaml-c:01 clue:01 gdb:01 ocamlrun:01 gdb:01 usr:01 usr:01 ocamlrun:01 3.07:01 sigsegv:01 nss:99 val:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 375 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(..) On my system, WINS has no other problems (ping, samba sharing, etc): $ ping dbdev PING dbdev (10.0.0.4) 56(84) bytes of data. 64 bytes from 10.0.0.4: icmp_seq=1 ttl=128 time=28.5 ms 64 bytes from 10.0.0.4: icmp_seq=2 ttl=128 time=28.0 ms Any ideas what could cause this? I'm about to dive into the winbind code for clues but that sounds awful. It is samba 3.02a (also with samba 2.2.8) and ocaml 3.07+2 Kenn p.s. This was a pain to track down because it first showed up as a segfault in my binding to the FreeTDS library and I figured I had just made any of a million possible mistakes in C. ------------------- 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