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 NAA03251; Mon, 12 Jul 2004 13:35:04 +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 NAA03135 for ; Mon, 12 Jul 2004 13:35:03 +0200 (MET DST) Received: from [128.93.8.158] (macaque.inria.fr [128.93.8.158]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6CBZ2EV005890 for ; Mon, 12 Jul 2004 13:35:02 +0200 Mime-Version: 1.0 (Apple Message framework v618) In-Reply-To: <20040711185802.8039.qmail@web53203.mail.yahoo.com> References: <20040711185802.8039.qmail@web53203.mail.yahoo.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <86A9CD32-D3F7-11D8-B633-00039310CAE8@inria.fr> Content-Transfer-Encoding: 7bit From: Damien Doligez Subject: Re: [Caml-list] Toplevel crashes when trying to call external functions Date: Mon, 12 Jul 2004 13:35:07 +0200 To: caml-list Caml X-Mailer: Apple Mail (2.618) X-Miltered: at nez-perce with ID 40F27766.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 crashes:01 camlparam:01 camllocal:01 val:01 solver:01 val:01 solver:01 endl:01 camlreturn:01 mng:99 camlparam:01 mng:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Jul 11, 2004, at 20:58, Andy Yang wrote: > value zchaff_InitManager(void) > { > CAMLparam0(); > CAMLlocal1(val); > void* solver = SAT_InitManager(); > val = copy_int32((int)solver); > cout<<"solver = "< CAMLreturn ( val ); > } > > void zchaff_ReadCnf(value mng, value filename) > { > CAMLparam2(mng, filename); > SAT_Manager solver = (void*)Int32_val(mng); > cout<<"solver = "< assert(solver != NULL); > char * fn = String_val(filename); > cout<<"file = "< read_cnf(solver, fn); > CAMLreturn0; > } This code looks OK. How did you declare these two functions on the OCaml side of things? > Thus I should follows ocaml's Tag rules. However, the > problem still exists. Tracing with gdb, I noticed that > the toplevel still crashes in function obj_tag. Sounds like the toplevel is trying to pretty-print one of your values. -- Damien ------------------- 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