caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Testsuite fileio.ml test fails depending on stdlib location
@ 2016-08-30  4:13 Pierre Métras
  0 siblings, 0 replies; only message in thread
From: Pierre Métras @ 2016-08-30  4:13 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 3877 bytes --]

Hello,

I'm trying to port OCaml 4.0.3 environment to Minix3 platform. The compiler
test suite is invaluable to check that everything is working correctly.
Minix3 does not have native threads and the tests have to be adapted to use
vmthreads only. I've been hitting a wall for a few days because the
fileio.ml test was failing:

 ... testing 'fileio.ml': ocamlcThread 19 killed on uncaught exception
Sys_blocked_io
Thread 20 killed on uncaught exception Sys_blocked_io
cmp: EOF on /tmp/testio30da35


The test is compiled and then run with commands, from OCaml testsuite
directory:


$ ../byterun/ocamlrun ../ocamlc -g -nostdlib -I ../stdlib   -w a -vmthread
-I ../otherlibs/threads -I ../otherlibs/unix unix.cma threads.cma -I
../testsuite/lib tests/lib-threads/fileio.ml -o program

$ ../byterun/ocamlrun -b -I ../stdlib -I ../otherlibs/threads -I
../otherlibs/unix program tests/lib-threads/fileio.ml
256-byte chunks, 256-byte chunks
passed
4096-byte chunks, 4096-byte chunks
passed
65536-byte chunks, 65536-byte chunks
passed
256-byte chunks, 4096-byte chunks
passed
4096-byte chunks, 256-byte chunks
passed
4096-byte chunks, 65536-byte chunks
passed
263-byte chunks, 4011-byte chunks
passed
613-byte chunks, 1027-byte chunks
passed
0...8192 byte chunks
passed
line per line
Thread 19 killed on uncaught exception Sys_blocked_io
Raised by primitive operation at unknown location
Called from file "tests/lib-threads/fileio.ml", line 68, characters 6-38
Re-raised at file "tests/lib-threads/fileio.ml", line 53, characters 4-149
Called from file "thread.ml", line 131, characters 8-14
Thread 20 killed on uncaught exception Sys_blocked_io
Raised by primitive operation at file "pervasives.ml", line 415, characters
4-749
Called from file "tests/lib-threads/fileio.ml", line 68, characters 23-38
Re-raised at file "tests/lib-threads/fileio.ml", line 53, characters 4-149
Called from file "thread.ml", line 131, characters 8-14
cmp: EOF on /tmp/testio2ce820
FAILED
truncated line
passed


Being unable to understand why it was failing, I installed OCaml on my
system. Now I can compile it directly with the system compiler and run it
like:


$ ocamlc -g  -w a -vmthread unix.cma threads.cma -I ../testsuite/lib
tests/lib-threads/fileio.ml -o program

$ ./program tests/lib-threads/fileio.ml
256-byte chunks, 256-byte chunks
passed
4096-byte chunks, 4096-byte chunks
passed
65536-byte chunks, 65536-byte chunks
passed
256-byte chunks, 4096-byte chunks
passed
4096-byte chunks, 256-byte chunks
passed
4096-byte chunks, 65536-byte chunks
passed
263-byte chunks, 4011-byte chunks
passed
613-byte chunks, 1027-byte chunks
passed
0...8192 byte chunks
passed
line per line
passed
truncated line
passed


The problem occurs when the thread is reading from the pipe and the
resource returns an EAGAIN error and fails when accessed another time.
I've copied the ocaml-4.0.3 directory to a Linux environment, recompiling
it and running the testsuite from the freshly compiled version and I've
observed the same behavior.

I've found that the difference in behavior is caused by the -nostdlib -I
../stdlib flags. I don't understand why when the compiler uses the stdlib
at the default system location the resulting program runs and why it
generates an error if I ask the compiler to use the same stdlib file from
another directory.

And the program deadlocks when I compile it with:

$ ../byterun/ocamlrun ../ocamlc -g -nostdlib -I /usr/local/lib/ocaml -w a
-vmthread -I ../otherlibs/threads -I ../otherlibs/unix unix.cma threads.cma
-I ../testsuite/lib tests/lib-threads/fileio.ml -o program


Can someone share some lights on why OCaml is so sensible to stdlib
location? Is there a dynamic library failing to load without reporting an
error?

Thanks
--
Pierre Métras

[-- Attachment #2: Type: text/html, Size: 9041 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-30  4:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-30  4:13 [Caml-list] Testsuite fileio.ml test fails depending on stdlib location Pierre Métras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).