Re: Trouble with compiling hivex on ! (amd64-linux || i386-linux)
On Wed, Jul 21, 2010 at 04:20:31PM +0200, Hilko Bengen wrote:
> Hi Richard,
I'm CCing this to debian-ocaml-maint, because the first of these seems
to be a generic OCaml / OCaml-autoconf problem.
> it seems that I got more than I bargained for: Debian's autobuilders
> failed to build my hivex package on all architectures except amd64-linux
> and i386-linux:
>
> <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589809>
>
> The first class of errors seems to affect architectures where there is
> no native OCaml compiler available. I believe that the root cause of the
> compile error is that the configure.ac check for caml_raise_with_args()
> always tries to use the native compiler. I don't know anything about
> OCaml and how it builds bytecode programs, but I was able to build the
> test program using the bytecode compiler, too:
>
> ocamlc -c conftest.c
> ocamlc -c conftest_ml.ml
> ocamlc conftest.o conftest_ml.cmo -o conftest
>
> Should the non-"opt" compiler perhaps be used instead for the check?
It *should* do this already ... This is possibly a bug in the
OCaml autoconf macros.
> The second error seems to be easy to solve: ENOKEY doesn't seem to be
> defined on kfreebsd-* and Hurd. Could you use another errno value? (I
> believe that the "Required key not available" message refers to
> cryptographic keys.)
Uck.
Unfortunately changing this requires changing the ABI, which we can't
do. I wonder if adding something like
#ifndef ENOKEY
#define ENOKEY (some suitable unused errno)
#endif
would be adequate to fix this. Of course we'd have to choose some
errno which both exists on FreeBSD and Hurd, and cannot already be
returned from a hivex call.
> There is a third class of errors that the bug reporter missed: The sparc
> and powerpc architectures for which there is a native compiler fail one
> of the OCaml tests:
>
> ,----
> | make check-TESTS
> | make[3]: Entering directory `/build/buildd-hivex_1.2.2+git20100712-2-sparc-cOybM0/hivex-1.2.2+git20100712/ocaml'
> | PASS: t/hivex_005_load
> | PASS: t/hivex_010_open
> | PASS: t/hivex_020_root
> | 01 non-existent file
> | 02 closed handle
> | 03 write to read-only file
> | 04 node_get_child node not found
> | PASS: t/hivex_100_errors
> | PASS: t/hivex_110_gc_handle
> | PASS: t/hivex_200_write
> | Fatal error: exception Hivex.Error("node_values", 9, "Bad address")
> | FAIL: t/hivex_300_fold
> | ===================
> | 1 of 7 tests failed
> | ===================
> | make[3]: *** [check-TESTS] Error 1
> `----
>
> I haven't looked at the tests, but one thing these architectures have in
> common is that they are big-endian architectures. Maybe the failing test
> is related to that?
This looks like an actual bug. It could be a missing endian
(ntohl / htonl) call in the C library.
I don't have a huge amount of time to look at this right now, owing to
RHEL 6 crunch. If you can't work out solutions, I suggest filing bugs
for each one at https://bugzilla.redhat.com/
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
Reply to: