caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] changing link order results in segfault
@ 2004-09-30 22:43 Eric Stokes
  0 siblings, 0 replies; only message in thread
From: Eric Stokes @ 2004-09-30 22:43 UTC (permalink / raw)
  To: caml-list

Hello, I have run into a problem which I thought I should bring to the 
attention of the list.
Please keep in mind, I'm not an expert in the compiler, or the runtime 
(I've not even read the code), so
please go easy on me :-)

I'm working on a project which uses Shawn Wagner's xmlrpc library, with 
the ocaml-http library
(an http server library), and I've noticed that a strange thing happens 
when I change the order in
which these libraries are linked into my executable. All this is with 
ocamlopt, I have not tried ocamlc.

If I link to ocaml-http first, and then to xmlrpc, everything is fine, 
the program runs and works correctly.
However, if I change the order of the link, if I link xmlrpc first, and 
then ocaml-http, the program segfaults
before it ever gets to my code. This behavior is consistent on linux 
intel, and darwin ppc.

I spent quite a while debugging this, so here are some thoughts for you 
all to correct :P

xmlrpc uses two libraries of note, netclient, and ocaml-http. 
Interestingly, both netclient, and ocaml-http define
a module called http_client. xmlrpc itself is split into two archives, 
one implementing the protocol and depending
on a web server, and the other using ocaml-http to build a servlet. The 
part implementing the client
uses netclient exclusively, it does not require ocaml-http. The part 
which builds the servlet uses the http_daemon
module of ocaml-http, but not the http_client module. My program links 
to both parts, and so requires the
http_client module, however there are two archives which implement a 
module with that name. It seems that
the last module with the right name on the link command line is the one 
who's code is actually used, regardless
of their type signatures (which are very different for the two 
http_client modules).

I'd be happy to provide more information upon request.

	-Eric Stokes

-------------------
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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-09-30 22:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-30 22:43 [Caml-list] changing link order results in segfault Eric Stokes

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).