From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 17184BB81 for ; Wed, 8 Mar 2006 23:06:28 +0100 (CET) Received: from rouge.crans.org (rouge.crans.org [138.231.136.3]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k28M6RZH014193 for ; Wed, 8 Mar 2006 23:06:27 +0100 Received: from localhost (rouge.adm.crans.org [138.231.144.3]) by rouge.crans.org (Postfix) with ESMTP id 8BF1ABB93 for ; Wed, 8 Mar 2006 23:06:27 +0100 (CET) Received: from rouge.crans.org ([138.231.144.3]) by localhost (rouge [138.231.144.3]) (amavisd-new, port 10024) with LMTP id 32172-04-4 for ; Wed, 8 Mar 2006 23:06:27 +0100 (CET) Received: from [138.231.150.106] (sayan-ftp.wifi.crans.org [138.231.150.106]) by rouge.crans.org (Postfix) with ESMTP id 5BC4DBB8A for ; Wed, 8 Mar 2006 23:06:26 +0100 (CET) Message-ID: <440F556A.9010209@crans.org> Date: Wed, 08 Mar 2006 23:06:34 +0100 From: =?ISO-8859-1?Q?Li-Thiao-T=E9_S=E9bastien?= User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Caml interface with C on x86_64 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at crans.org X-Miltered: at nez-perce with ID 440F5563.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 camlparam:01 printf:01 printf:01 val:01 fflush:01 stdout:01 alloc:01 val:01 fflush:01 stdout:01 wosize:01 camlreturn:01 toplevel:01 uname:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hi, I am using OCaml on two different Debian systems, a P4 machine at home and an Opteron machine at work. The following C function works well on the P4 but crashes on the Opteron with "Signal -10" : value test_liste (value str) { // test function to return a list to caml CAMLparam1(str); CAMLlocal1(cons); printf("This is test_liste.\n"); printf(String_val(str)); fflush(stdout); cons = caml_alloc (2,0); Store_field (cons, 0, Val_int(3)); Store_field (cons, 1, Val_int(0)); if (Is_block(cons)) { printf("true\n");}; fflush(stdout); printf("cons has size %i \n",Wosize_val(cons)); fflush(stdout); CAMLreturn (Val_int(0)); } called from a custom toplevel system : external test_liste : string -> int list = "test_liste";; test_liste "oaue";; The function works with gcc-3.4 and gcc-4.0 on the P4 but crash with both on the opteron machine. Can anybody explain this error? P4 configuration : uname -a Linux 2.6.15-1-686-smp #1 SMP Tue Jan 3 10:19:10 UTC 2006 i686 GNU/Linux ocamlc -v The Objective Caml compiler, version 3.09.1 gcc-3.4 -v gcc version 3.4.6 20060302 (prerelease) (Debian 3.4.5-3) gcc -v Target: i486-linux-gnu gcc version 4.0.3 20060304 (prerelease) (Debian 4.0.2-10) Opteron configuration : uname -a Linux 2.6.14-2-amd64-k8-smp #1 SMP Sun Nov 27 02:29:11 UTC 2005 x86_64 GNU/Linux ocamlc -v The Objective Caml compiler, version 3.09.1 gcc-3.4 -v gcc version 3.4.6 20060302 (prerelease) (Debian 3.4.5-3) gcc -v Target: x86_64-linux-gnu gcc version 4.0.3 20060304 (prerelease) (Debian 4.0.2-10) -- Li-Thiao-Té Sébastien