caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Kenneth Knowles <kknowles@berkeley.edu>
To: Blair Zajac <blair@orcaware.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] segfault in Unix.gethostbyname
Date: Fri, 26 Mar 2004 11:27:07 -0800	[thread overview]
Message-ID: <20040326192707.GB18128@tallman.kefka.frap.net> (raw)
In-Reply-To: <40647DB3.39AD0635@orcaware.com>


Aha, I remember that discussion.  Before my reinstall I had the CVS of ocaml,
and this time I'm using a release.  I didn't realize that fix wasn't in the new
releases (have been using CVS version for a long time).

Thanks a bunch.

Kenn

On Fri, Mar 26, 2004 at 11:00:03AM -0800, Blair Zajac wrote:
> 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 <blair@orcaware.com>
> 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


      reply	other threads:[~2004-03-26 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-26 18:22 Kenneth Knowles
2004-03-26 18:30 ` Thomas Fischbacher
2004-03-26 19:24   ` Kenneth Knowles
2004-03-26 19:00 ` Blair Zajac
2004-03-26 19:27   ` Kenneth Knowles [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040326192707.GB18128@tallman.kefka.frap.net \
    --to=kknowles@berkeley.edu \
    --cc=blair@orcaware.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).