From: Alessandro Baretta <alex@baretta.com>
To: Ocaml <caml-list@inria.fr>
Subject: [Caml-list] Problems with Dynlink and -pack?
Date: Thu, 12 Sep 2002 11:45:22 +0200 [thread overview]
Message-ID: <3D806232.9010204@baretta.com> (raw)
I have written a program that takes as a parameter the name
of an object file, links it dynamically through Dynlink, and
computes functions defined by the imported module. Now, I
have observed this curious behavior, which _might_ be a bug.
Yet, before filing a bug report I'd like some feedback so
that I can be sure that it is not due to some mistake I made
in using Dynlink.
This is what I do:
$ ocamlfind ocamlc -g -package afo -passopt -pack -o
*auto_ddt_csv.cmo* tab_csv_utils.cmo auto_ddt.cmo
auto_ddt_csv.cmo is the object file I dynamically link in a.out.
$ ./a.out -mod auto_ddt_csv.cmo
Fatal error: exception Invalid_argument("Array.get")
By using Epeire/Ocamldebug I have been able to discover that
the exception is raised by a standard library module within
the following call:
let _ = try Dynlink.loadfile "null_data_origin.cmo"
with Dynlink.Error(e) ->
prerr_string
("ERROR: " ^ Dynlink.error_message e ^ "\n")
Of course, Dynlink previously is initialized and the
appropriate interfaces are successfully added with
Dynlink.add_interfaces.
Up to this point I was quite convinced that there must be
some bug in my code. However, I made the following test. I
recompiled a.out and statically linked tab_csv_utils.cmo. I
then executed a.out specifying auto_ddt.cmo as a parameter.
This time Dynlink succeeded in linking the specified module.
The only difference between the two runs seems to be that in
the first case, the dynamically linked object file has been
manufactured using the -pack option of ocamlc, while in the
second run, the dynamically linked module was generated
directly from a source file.
This looks like a bug to me, and I'm ready to file a bug
report, but is it really? Or have I overlooked something
obvious?
Alex
-------------------
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
reply other threads:[~2002-09-12 9:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D806232.9010204@baretta.com \
--to=alex@baretta.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox