From: Romain Beauxis <toots@rastageeks.org>
To: caml-list@inria.fr
Subject: Uncaught Unix_error.
Date: Thu, 18 Jun 2009 14:16:38 +0200 [thread overview]
Message-ID: <200906181416.39314.toots@rastageeks.org> (raw)
Hi all !
We have had a strange bug report on our code. Somehow, an Unix.Unix_error
exception was not caught while it ought to be. See:
http://savonet.rastageeks.org/ticket/269
We have precisely characterized the issue in the code, and we would like to
understand its possible origin.
If we look at the code for raising exceptions in otherlib/unixsupport.c, we
have:
if (unix_error_exn == NULL) {
unix_error_exn = caml_named_value("Unix.Unix_error");
if (unix_error_exn == NULL)
invalid_argument("Exception Unix.Unix_error not initialized, please
link unix.cma");
}
This code fetches the pointer to the named_value representing an
Unix.Unix_error, and assigns it to a static variable.
However, the threads module also registers an exception of the same name,
probably because both modules are mutually exclusive.
We believe that the issue is raised because the module that uses Unix.read is
compiled with one of unix or threads and the application using that module
with the other one.
In this case, it should be possible that the static value representing the
exception is initialized with a wrong pointer and never updated afterwards.
We were unable yet to reproduce the issue on a minimal code, it was caused by
a portmap scan on the telnet server, which uses Unix.read calls to read from
the network socket.
We don't really know if this is a known issue, or if there is something to do
about this from our side, so we wanted to report it here...
Romain
next reply other threads:[~2009-06-18 12:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 12:16 Romain Beauxis [this message]
2009-06-18 13:17 ` [Caml-list] " Stéphane Glondu
2009-06-18 13:28 ` Romain Beauxis
2009-06-18 14:41 ` David Baelde
2009-06-18 16:47 ` Jake Donham
2009-06-18 19:21 ` Stéphane Glondu
2009-06-18 20:16 ` David Baelde
2009-06-19 13:23 ` Romain Beauxis
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=200906181416.39314.toots@rastageeks.org \
--to=toots@rastageeks.org \
--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