> I am having problems with the marshaller (I am getting a segfault in the > marshaller) on the AMD x86_64 (Opteron) running Fedora Core development > version (AKA Red Hat Raw Hide) and OCaml 3.07+2. > To figure out what is going on, I tried running some tests. > When I run test/Moretest/intext.byt, I get: > > ... > Test 223 passed. > Test 300 passed. > Uncaught exception: Failure("input_value_from_block: bad object") > Exit 2 > > When I run test/Moretest/intext.out, I get: > > ... > Test 223 passed. > Test 300 passed. > Test 401 FAILED. > > Do these indicate a bug? Or is this expected and I should look for the > source of my problems elsewhere? The second test failure is actually a nasty bug in the AMD64 port of OCaml, causing exceptions raised from C code to misbehave with ocamlopt. (ocamlc isn't affected.) The first test failure is either a bug in gcc or an unspecified behavior of C that I wasn't aware of. Basically, some stuff is computed with type 'unsigned int', stored in an 'unsigned long' variable, and compared against an 'unsigned int' constant. The gcc-generated code performs a sign extension 32 -> 64 bits on the unsigned int, causing the test to fail. This behavior also occurs with older versions of gcc on the Alpha. Digital Unix's Alpha cc compiler (the only other 64-bit C compiler I have at hand) doesn't do sign extension. A small example that reproduces the behavior is attached. I'll let the C language lawyers argue what the correct behavior is. At any rate, plase find attached a patch against 3.07pl2 that fixes the ocamlopt exception bug, and works around the undesired sign extension. With this patch, the "intext" regression test passes on your AMD64 machine. Let me know if that improves the situation with your other crashes. - Xavier Leroy