The idea is to add a variant of the Unix.open_process{,_in,_out,_full} functions that work with a pair (program, args) directly, without going through the system shell, which introduces extra complexity (in particular, with respect to quoting).
I used the name Unix.open_process_args which is the one suggested in ocaml-batteries-team/batteries-included#858, but I am not completely sold on it.
One uses the usual "close" functions Unix.close_process{,_in,_out,_full} with the new functions as well.
The "old" functions Unix.open_process{,_in,_out,_full} are re-implemented in terms of the "new" functions, so I did not feel pressed to add new tests.
Addresses: MPR#7794.
Fixes: MPR#7253 (in large part), MPR#7796 (in full).
As shown in the PRs above there are several cases where do_at_exit
is called several times, causing functions registered with at_exit
to be called several times. Also, an at_exit function that raises
could prevent other at_exit functions from being run.
This commit doesn't try to prevent multiple calls to do_at_exit,
but makes sure that each function registered with at_exit is run
at most once. The idea is due to Nicolás Ojeda Bär.
The segfault happens when you use a wildcard '*' or '?'
in the argument of the caml program compiled on Windows
64bits.
The handle was corrupted because is cast from
intptr_t (64bits) to int (32bits).
In order to make sure that both `intptr_t` and `uintptr_t`
are available on MSVC we forced the inclusion of <stdint.h>
for versions that have it (starting from Visual Studio 2010
(MSVC version 1600)). For older versions, the typedefs may be
found in <stddef.h>; therefore we forced the inclusion of this
standard header in config.h.
In environments where the executables compiled to native code,
such as ocamlopt.opt, are always used in preference to the bytecode
versions then space can be saved by not installing the latter.
This patch provides a configure option to do such. It is relatively lightly
engineered; in particular, it won't complain if the native code executables
aren't themselves being built; but given this is an option for knowledgeable
users we think that it is reasonable.
1. Add Bigarray lines to library/stdlib.etex
2. Move intro from libbigarray.etex to stdlib/bigarray.mli
3. Note that 0-dimensional arrays are supported.
4. Move C interface description to cmds/intf-c.etex
5. Change wording in libbigarray.etex to reflect legacy status.
6. Add a label to libunix.etex (needed for link from libbigarray.etex)
7. Put the changes in Changes (for 4.07).
In flds, fldd, fsts, fstd instructions, using indexed addressing mode,
the offset from the index register must be a multiple of 4.
Otherwise, invalid asm is produced and rejected by the assembler.
The original code may not be quite ISO C conformant,
and causes alarms with Clang's address sanitizer.
The new code is patterned after struct caml_ba_array in <caml/bigarray.h>,
which is a solution to a similar problem (see MPR#5516).
Modern gcc have a `-Werror=stringop-truncation` warning that tells
us that the strncpy used to copy the CAML_DEBUG_SOCKET value from
the environment misses out the space for a terminating NUL.
Rather than silently truncate the path, this patch raises an
exception if the path is too long, and also fixes the off-by-one
in the strncpy invocation.
with feedback from Stephen Dolan