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 EAA20461; Fri, 30 May 2003 04:36:43 +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 EAA20454 for ; Fri, 30 May 2003 04:36:41 +0200 (MET DST) Received: from mail.eecs.harvard.edu (bowser.eecs.harvard.edu [140.247.60.24]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h4U2aaT09095 for ; Fri, 30 May 2003 04:36:41 +0200 (MET DST) Received: by mail.eecs.harvard.edu (Postfix, from userid 32018) id 9433154C4A4; Thu, 29 May 2003 22:36:27 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.eecs.harvard.edu (Postfix) with ESMTP id 90A2A54C486; Thu, 29 May 2003 22:36:27 -0400 (EDT) Date: Thu, 29 May 2003 22:36:21 -0400 (EDT) From: Lex Stein To: caml-list@inria.fr Subject: [Caml-list] perplexing marshaling exception Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam: no; 0.00; stein:01 marshaling:01 unmarshaling:01 closures:01 callback:01 callbacks:01 'ed:99 pathnames:01 unmarshal:01 backtrace:01 linked:01 caml:01 executables:01 marshal:01 routines:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, I'm having a curious and perplexing problem with unmarshaling (Marshal module). I have two executables that differ in that one is built from a C main routine that calls into Caml closures via callback() and a second that is built from code that makes these same calls from Caml directly. Both of these programs call Caml routines that read/write records to Berkeley-DB (BDB) via a homegrown Caml interface to the BDB C library. Here's a diagram: 1: main program (C) | DB read/write (Caml) | BDB (C) 2: DB read/write (Caml) | BDB (C) In 1, the main program does very little that's interesting. The only values that it passes to its callbacks are copy_string()'ed pathnames representing the location of the database. In 2, these same strings are arguments to Caml source code calls to the same Caml routines that the C code calls in case 1. However, I get an error when I call from C (case 1) that I don't get in case 2. In case 1, in the DB read/write Caml code, when I try to unmarshal a string retrieved from BDB, I get: Fatal error: exception Failure("input_value: unknown custom block identifier") (Program not linked with -g, cannot print stack backtrace) In case 2, when I try to do this, I get no such error. (Also of interest is the claim that the program was not linked with -g. This just isn't true. However, this isn't my main concern). Any idea what's going on here? Why unmarshal is failing when I have a C main program? Much appreciated! Lex ------------------- 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