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 AAA30408; Fri, 1 Oct 2004 00:43:59 +0200 (MET DST) 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 AAA26283 for ; Fri, 1 Oct 2004 00:43:58 +0200 (MET DST) Received: from plover.csun.edu (plover.csun.edu [130.166.1.24]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i8UMhuXX015874 for ; Fri, 1 Oct 2004 00:43:57 +0200 Received: from puffin.csun.edu (puffin.csun.edu [130.166.1.21]) by plover.csun.edu (MOS 3.5.4-GR) with ESMTP id BHT13826 for ; Thu, 30 Sep 2004 15:43:55 -0700 (PDT) Received: from [130.166.10.117] (s010n117.csun.edu [130.166.10.117]) by puffin.csun.edu (MOS 3.4.7-GR) with ESMTP id CHS69967 (AUTH eric) for ; Thu, 30 Sep 2004 15:43:53 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v619) Content-Transfer-Encoding: 7bit Message-Id: <3450D9C8-1332-11D9-BF0C-000A95A1E69A@csun.edu> Content-Type: text/plain; charset=US-ASCII; format=flowed To: caml-list@inria.fr From: Eric Stokes Subject: [Caml-list] changing link order results in segfault Date: Thu, 30 Sep 2004 15:43:53 -0700 X-Mailer: Apple Mail (2.619) X-Junkmail-Status: score=0/50, host=puffin.csun.edu X-Miltered: at nez-perce with ID 415C8C2C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; segfault:01 runtime:01 xmlrpc:01 ocaml-http:01 ocamlopt:01 ocamlc:01 ocaml-http:01 xmlrpc:01 segfaults:01 darwin:01 debugging:01 netclient:01 netclient:01 linked:01 compiler:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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