From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pBI1JhrI015773 for ; Sun, 18 Dec 2011 02:19:44 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUBACM/7U7RVda2kWdsb2JhbABDhQymRAgiAQEBAQkLCwcUBCGCCwIPHQEbHgMSEA8CJgIkAREBBQFXny6CWwqLHUiCa4QXP4hxAgULgSSHO4IEgRYEkSWDWY14PYN7 X-IronPort-AV: E=Sophos;i="4.71,370,1320620400"; d="scan'208";a="135880529" Received: from mail-tul01m020-f182.google.com ([209.85.214.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 18 Dec 2011 02:19:42 +0100 Received: by obbwd18 with SMTP id wd18so1858984obb.27 for ; Sat, 17 Dec 2011 17:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=Bv4h8hBtdYcAfpfN9VVzBBvEHB8r5XXr3S2a2atZT7g=; b=pRGnfc7I9XZDwElyKqxOOKQG6P4HOU0E1Z6/alFqIeToqMzJN5Os/Mo6FtRGog14fU ax4FAskDU6VhVmJCzJ+f2pLurAPC+jFemVx1lpk+B48N+vyszGmBN+PvZbnuUQjoCV4g Zr/GT1x+RxCRnwGjhxFPE76ZS8NrzPdwm+2tE= MIME-Version: 1.0 Received: by 10.182.227.8 with SMTP id rw8mr7422477obc.42.1324171181047; Sat, 17 Dec 2011 17:19:41 -0800 (PST) Received: by 10.182.34.162 with HTTP; Sat, 17 Dec 2011 17:19:40 -0800 (PST) Date: Sun, 18 Dec 2011 03:19:40 +0200 Message-ID: From: Dmitry Grebeniuk To: caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 Subject: [Caml-list] bytecode: ./prog vs ocamlrun ./prog Hello. The OCaml manual states that executing bytecode program with "./prog" and "ocamlrun ./prog" should give the same result (in simple case, without options and environment modifications). However in my case the result is different: "./prog" executes well, but "ocamlrun ./prog" gives "Fatal error: unknown C primitive `unix_dup'". But I have no good minimal case (other small unix.cma-dependent programs run fine both ways), and I can't show the full sources due to my contract with employer. I suspect this issue can give me additional headache in the future, so I prefer to solve it now. How can I find the source of this problem? What I have checked for now: - host OS is linux (gentoo, fresh enough) - the host contains (and contained ever) only one OCaml installation (3.11.2), and I can't install more recent OCaml versions system-wide (and I want this program to work under system-wide 3.11.2 anywhere) - ocaml toplevel doesn't fail on "#load "unix.cma"" and on calls to functions of Unix module - this system doesn't provide ocamlobjinfo, so I can't read its output - the program is built with ocamlbuild, without custom myocamlbuild.ml and other C-specific options, however some libraries may use C bindings (I'll check this if it is important) - I've tried to set environment variable LD_DEBUG=libs and run both cases: "ocamlrun ./prog" output is pasted to http://paste.in.ua/3499/raw/ , "./prog" output is pasted to http://paste.in.ua/3500/raw/ , but I don't understand where the problem is, even after meditation on these logs What should I do to diagnose this problem?