Commit Graph

  • f4f7aafa32
    Feature-gated `-exec/{}` as "exec". Added feature `mode-flags` to enable/disable collect-noallocate collect-preallocate memfile-total-jemalloc.png features that involve runtime flags. master Avril 2023-03-02 17:12:32 +0000
  • 5c673ae3c4
    -exec/{} feature is ready to merge exec Avril 2023-03-02 17:02:14 +0000
  • 9aba1f43a1
    Fixed `-exec` to use real `dup()`"d file instead of copying to a new pipe Avril 2023-03-02 16:58:41 +0000
  • 31cfee9989
    Fixed -exec{}: dup()"d file descriptor was being closed before the process could access it. Fixed -exec (hack ver.): Ditto. Avril 2023-03-02 16:42:18 +0000
  • 582bfc0dad
    Made -exec (stdin ver) work via piping hack (XXX: We need to find how to pass file directly.) (TODO: -exec{} still doesn"t work: `No such file or directory` error when accessing /dev/fd/{fd} *and* /proc/{pid}/{fd}?? Idk why... Avril 2023-03-02 08:50:51 +0000
  • bc121420b8
    Chenged return type of `spawn_from_sync()` to be an iterator of `Result<Option<i32>>` so the caller can decide what to do if the child terminates without an exit code. Also changed to `eyre::Result<>` to report the specific failure and child process" index. Avril 2023-03-01 06:37:53 +0000
  • 79721444ba
    Implemented `-exec/{}` implementation functionality. Avril 2023-02-28 15:57:05 +0000
  • 715fa4d5a8
    Added simple fatal error message verbosity levels controllable by environment variable at runtime (`RUST_VERBOSE =~ /1|v|verbose/i`), and compile-time (`NO_RT_ERROR_CTL`, `DEFAULT_ERROR =~ /1|v|verbose/i`.) Default is simple error messages at compile and runtime. Avril 2022-10-12 17:42:27 +0100
  • f918d5f6e1
    Prepared or replacing return type from directly normal operation `Options` to `enum Mode`, which will facilitate returning a `--help` or other special mode case. We can use `impl From<Options> for Mode` and work with this to make the migration of return types easier. Avril 2022-08-13 00:31:51 +0100
  • 227abc0d7d
    args: Added visitor-pattern argument parsing. Fixed bug in `try_parse_for!()` which `continue`d on the wrong branch. Improved specific and general error messages regarding arguments. Parsing for `-exec/{}` works! A correct `Options` struct is produced, edge-and error- cases are handled correctly with informative messages (TODO: Implement `--help`.) Avril 2022-08-13 00:21:10 +0100
  • 177bf3c4ff
    main: Added `parse_args()`: Parses args, converts error to eyre::Report, and adds section for suggestion (TODO: Implement `--help`) and section on which args existed. Avril 2022-08-12 21:58:25 +0100
  • 1e9224d53c
    args: Added `parse_args()`: Attempt to parse the program args into `Options` struct. Added `ArgParseError`, error describing why parsing arguments failed. Added `EXEC_MODE_STRING_TERMINATOR` the terminator used when deciding when to stop parsing an arglist for `-exec/{}`. Added `program_name()`, returns the current executable"s name as a UTF8 string, if the executable"s name was not a UTF8 string, then it is lossily converted to one and invalid characters are replaced. Avril 2022-08-11 23:18:37 +0100
  • 0b84adc84f
    Added fmt::Display impl for ExecMode that quotes/escapes command or args if needed uses the `POSITIONAL_ARG_STRING` for positional arguments. Avril 2022-08-11 22:39:06 +0100
  • 682cd8ec15
    args::Option::ExecMode Started argument parsed data structure for `-ecec <command> [<args>...]` (Stdin) `-exec{} <command> [<args>|{}...]` (Positional `"/prof/self/fds/{}" (3++)`). Avril 2022-08-11 00:21:16 +0100
  • 6220233d97
    Preparation for adding the command-line option `-exec` and `-exec{}`. Avril 2022-08-07 09:11:11 +0100
  • 14f32d6262
    Explicitly closes `stdout` before process exits. Avril 2022-06-04 06:08:09 +0100
  • bc2357c6b6
    Attempted to add new feature flag: `memfile-size-output`: Which will pre- or post- set the size of `stdout` to the correct buffer size, allowing consumers of `collect`"s stdout pipe to know the size just like a file. However, `ftruncate()` always fails on stdout. Before re-enabling the feature, we must find out how to set the size of a pipe, if/when you even can, and what syscall(s) you need to do it with. Avril 2022-05-22 23:21:33 +0100
  • b2bf26f245
    Bumped minor version. Avril 2022-05-22 14:53:02 +0100
  • ab56c93532
    Bumped minor version. Avril 2022-05-22 14:48:56 +0100
  • 395799587b
    Removed `stackalloc` dependancy. Avril 2022-05-22 14:37:05 +0100
  • 289db974cd
    TODO: Find out how to set the length of stdout if possible, so that the consumer of `collect` in a pipeline need only use one syscall splice() to read all the collected data at once, like a file. Avril 2022-05-21 04:26:21 +0100
  • b47a27c60f
    (partial-merge from (probably) now-defunct branch `hugetlb`.) Avril 2022-05-21 04:14:32 +0100
  • 35c6cabce3
    memfile::hp: Changed `get_masks()` to return an iterator of `SizedMask` instead of just `Mask` to retain the size of the huge-page itself in bytes (for `ftruncate()` calls, and `mmap()` calls.) hugetlb Avril 2022-05-21 04:11:28 +0100
  • dbf2dbffde
    Removed `hugetlb` feature flag: It cannot be used for our use-case. Avril 2022-05-21 03:26:00 +0100
  • 8ea3a23e27
    Using huge-pages for this is folly from the start: For one, we never actually map the fallocate()"d memory. And two... hugetlbfs does not support write()s in any way, splice()s, send_file()s... It only supports read(), and mmap() (its primary use-case...); which isn"t relevant for us. Avril 2022-05-21 03:20:04 +0100
  • 872ea74421
    It seems creating HUGETLB memory files either just doesn"t work or changes their behaviour so that any (or at least, small arbitrary) writing or fallocate()ing to them fails... Read up on MFD_HUGETLB more then re-do a test like `memfd_create_wrapper()` to find out why... and if it depends on the MAP_HUGE_ mask, and if so, find one that works... (We know when masks are invalid, since the error message is different. The masks collected via `get_masks()` *are* valid for this system, they just prevent the fd from being any way useful.) Avril 2022-05-20 19:37:56 +0100
  • bdfd0a6268
    memfile::hp: Added `PartialEq` impl for `c_int` (checks `MAP_HUGE` from `.raw()`), and `c_uint` (checks `memfd_create()` useable constant from `.mask()`.) Avril 2022-05-18 17:33:01 +0100
  • 573845a667
    memfile::hp: Added `get_masks()`: Returns an iterator over all `MAP_HUGE` masks found on system. Avril 2022-05-18 01:23:43 +0100
  • 9b4bb475c0
    Added extension methods for flattening `eyre::Result<eyre:Result<T>>`s and related constructs. Avril 2022-05-17 14:00:53 +0100
  • e7b96af012
    memfile::hp: Added test for `Mask`"s `.raw()` (`MAP_HHUGE_` flag generation.) Avril 2022-05-16 22:43:33 +0100
  • c4f73ccfa0
    memfile::hp: `find_size_bytes()` fixed and tested; should change function to return `eyre::Result<usize>` instead of `Option<usize>` considering how many different failure-paths exist. Avril 2022-05-12 21:55:04 +0100
  • 9c18a5b940
    memfile::hp: Added `Mask`: Converts bytes into a suitable `MAP_HUGE_` constant via its `.raw()` method, and a suitable flag for `memfd_create()` via its `.mask()` method. Avril 2022-05-11 00:27:59 +0100
  • b882f0ae97
    Completed `hp::find_size_bytes()`, and added const-generated lookup table for non "k" seperators. Avril 2022-05-02 21:28:10 +0100
  • d46efebbf7
    Added huge-page mask calculation algorithm to comment of module file `memfile::hp`. safe-memfd Avril 2022-05-02 00:50:36 +0100
  • b1a64475f6
    Merge branch 'master' into safe-memfd: memfile: Merged `RawFile::try_link_from()`: Analogue to `try_link_to()`. Avril 2022-05-02 00:26:09 +0100
  • c6032467fa
    memfile: Added `RawFile::try_link_from()`: Analogue to `try_link_to()`. Instrumented and added panicking versions of both functions. Added `clone_from()` impl that uses `try_link_from()` (i.e. `dup2()`) Avril 2022-05-02 00:25:43 +0100
  • 59363848a2
    Started: `memfile::hp`: `MFD_HUGETLB` can be used when a size is known to exceed into the boundary of a hugepage. Currently in the process of writing function to collect all possible hugepage sizes and generate the correct flag masks for `memfd_create(, MFD_HUGETLB | ...)` for each one; and the smallest one that contains the known size can be used for the `memfd_create()` call (if the size fits any at all.) Avril 2022-04-30 22:46:01 +0100
  • bbed62e738
    Version bump (revision): v1.0.2 Avril 2022-04-28 23:09:43 +0100
  • 2c839da13b
    Bumped stackalloc version: Use PLT for trampoline: Causing random linker errors on some machines. Avril 2022-04-28 23:08:09 +0100
  • 0262ca88d9
    Added TODOs for specific bugs (and impl related ideas for how to go about preventing/warning in the event of `mode-memfd` system OOM) ; moved some RawFd-related functions into a submodule Avril 2022-04-28 21:53:08 +0100
  • 8dd7ddaed8
    Version bump v1.0.1 Avril 2022-04-27 21:58:16 +0100
  • 9ecd0ea3d8
    Fixed silly bug preventing building on rust-stable. Avril 2022-04-27 21:57:29 +0100
  • 1e207ca453
    Create LICENSE Avril 2022-04-27 21:33:04 +0100
  • 9125199d80
    Added Cargo keywords (tags) Avril 2022-04-27 21:20:26 +0100
  • 225a0a08f0
    Fix README Avril 2022-04-27 21:16:58 +0100
  • 8fe92b0951
    Version 1.0.0! Avril 2022-04-27 21:13:16 +0100
  • f05c1466c7
    Added README.md Avril 2022-04-27 21:00:16 +0100
  • 8390072309
    Reached version 1.0.0! Avril 2022-04-27 17:43:05 +0100
  • 515a63c3a2
    Fixed bug with `memfile` feature not setting stream length properly without `memfile-preallocate` Avril 2022-04-25 09:51:09 +0100
  • 23d022b5fe
    Added working memfile implementation Avril 2022-04-25 09:37:14 +0100
  • 0628853b43
    Working memfile implementation Avril 2022-04-25 08:21:40 +0100
  • edb57c7c95
    memfile: Disambiguated memfile errors resulting in `fallocate()` sizes being too large or the call itself failing. Avril 2022-04-24 13:27:05 +0100
  • b3dbb30deb
    Fix imports for when feature `memfile` is disabled. Avril 2022-04-24 09:28:41 +0100
  • ed957bcec8
    feature memfile: added `RawFile::open_mem()` Avril 2022-04-24 09:18:05 +0100
  • 65c297b228
    Started adding `memfile` feature: Use a `memfd_create()`d in-memory temporary file. Avril 2022-04-24 07:46:14 +0100
  • 80a2d65262
    Made spantrace capture optional at the compilation level. Avril 2022-04-13 07:37:42 +0100
  • 3af34dc78f
    Better documented `jemalloc` feature. Avril 2022-04-13 04:20:44 +0100
  • cc37f604f1
    Fixed tracing causing huge unneeded bottleneck in non `bytes` builds. Avril 2022-04-13 04:09:06 +0100
  • bea5cda4a1
    Fixed not copying to buffer when not using feature `bytes`. Avril 2022-04-10 23:27:05 +0100
  • 1cdd5b2187
    Made `bytes` an optional feature. Avril 2022-04-09 20:32:28 +0100
  • 4cf1c88a3f
    Update gitignore Avril 2022-04-08 04:04:21 +0100
  • a5ad02a6de Working primitive, slow, prototype. Avril 2022-04-08 04:02:49 +0100
  • 2aa8c832de
    initial commit: must figure out how splice() works before we continue here. Avril 2022-04-08 03:00:46 +0100