Skip to content

next #151

Merged
merged 24 commits into from
Feb 17, 2024
Merged

next #151

merged 24 commits into from
Feb 17, 2024

Commits on Jan 10, 2024

  1. Configuration menu
    Copy the full SHA
    bcd42ce View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3732792 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fcf28d2 View commit details
    Browse the repository at this point in the history
  4. gpu-setup: Don't unlock to early during release

    Currently, the gpu lock file `pid` is released (removed) to early, so
    that there is a small race condition with a new GPU allocation:
    
    ```
       MXQ           job1                        job2
    * fork job1
                     * other initialization
                     * reserve gpu:
                     * * find slot without pid
                     * * change access to UID
                     * run user program
                     * exit
    * fork job2
                                                 *  other initialization
    * cleanup job 1:
    * * rm .../pid
                                                 * reserve gpu:
                                                 * * find slot without pid
                                                 * * change access to UID
    * * change access to root
    ```
    
    On release, keep the `pid` file until after the access mode has been
    changed back to root.
    donald committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    6003349 View commit details
    Browse the repository at this point in the history
  5. Makefile: Disable warning for Bison-generated source

    Bison-3.4.2 together with llvm 15.0.4 produce the warning
    
        parser.tab.c:1078:9: warning: variable 'yynerrs' set but not used
    
    Disable this warning for the parser.tab.c compilation.
    donald committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    5d0de79 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2024

  1. Configuration menu
    Copy the full SHA
    57cc235 View commit details
    Browse the repository at this point in the history
  2. mxq_reaper: Retry on spool file write errors

    If we can't write the spool file for any reason, do not write to stderr,
    as this is the users stderr of the mxq job. Just wait and retry until
    success.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    b4b4d87 View commit details
    Browse the repository at this point in the history
  3. sql: create_tables: Add default character set to tables

    Add default characer set option to the mxq tables, so that we don't
    depend on the default character set of the database or the server.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    9aee649 View commit details
    Browse the repository at this point in the history
  4. sql: Create indexes on group_jobs_inq and group_jobs_running

    A select on `(group_jobs_inq > 0 OR group_jobs_running > 0)` is done in
    the main loop on each daemon. Add two indexes to drastically reduce the
    load on the MySQL server.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    1da6ccc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    03dee12 View commit details
    Browse the repository at this point in the history
  6. mx_mysql: mx_mysql_statement_close*: Allow NULL

    Allow mx_mysql_statement_close* functions to be called with a pointer to
    a NULL value. This makes the daemon more robust when the functions are
    used as cleanup functions, e.g.
    
        __attribute__((cleanup(mx_mysql_statement_close)))
        struct mx_mysql_stmt *stmt = mx_mysql_statement_prepare(mysql,"...");
        if (!stmt) {
            fprintf(stderr, "mx_mysql_stmt_prepare: %s\n", mx_mysql_error());
            return;
        }
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    f0b38f1 View commit details
    Browse the repository at this point in the history
  7. mx_getopt: Remove a NULL pointer check

    The only caller of the static find_short_option() function doesn't call
    it with a NULL pointer value as the third argument:
    
        idx = find_short_option(optctl->options, &optctl->_unhandled_shortopts, &optctl->optarg);
    
    So it is not necessary for the function to check the pointer for NULL.
    
    The disadvantage of doing is, that the llvm static analyzer concludes
    from the check, that it was possible that the function would be called
    with a NULL pointer and questions a later access in the same function,
    which is unchecked:
    
        mx_getopt.c:158:16: warning: Dereference of null pointer (loaded from variable 'optarg') [core.NullDereference]
               *optarg = *name;
                ~~~~~~ ^
        1 warning generated.
    
    Remove the check.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    dbd4f12 View commit details
    Browse the repository at this point in the history
  8. mxqsub: Remove default time warning

    Remove the warning for the default runtime option in mxqsub. Users found
    the message "option '--runtime' or '-t' not used. Your job will get
    killed if it runs longer than the default of 15 minutes" annoying,
    especially as there's no equivalent warning for the default memory
    limit.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    e3d223c View commit details
    Browse the repository at this point in the history
  9. mx_util: Add mx_die()

    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    87f7e98 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1a0fe04 View commit details
    Browse the repository at this point in the history
  11. Makefile: Add -Werror

    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    1f1de79 View commit details
    Browse the repository at this point in the history
  12. tree: Handle mx_mysql_option_set_default_file errors

    After commit 2e80051 ("mx_mysql: Fix warning in
    mx_mysql_option_set_default_file"), mx_mysql_option_set_default_file()
    no longer outputs a warning by itself when the file is not readable.
    MySQL itself silently ignores unreadable config files.
    
    Make all callers handle the error.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    5518f3f View commit details
    Browse the repository at this point in the history
  13. mx_mysql: Add a unused_result warning

    All callers were made to handle errors returned by
    mx_mysql_option_set_default_file() in the previous commit. Now add the
    function attribute `warn_unused_result` to it, so that future callers
    will do, too.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    79c9787 View commit details
    Browse the repository at this point in the history
  14. mx_mysql: Refactor two functions into void functions

    mx_mysql_option_set_default_group() and mx_mysql_option_set_reconnect()
    can't fail, so make them void functions.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    94fb3bc View commit details
    Browse the repository at this point in the history
  15. mxqd: Make setup_cronolog() into void function

    Currently, setup_cronolog() returns on errors. However, in most error
    paths, it leaks one or more file descriptors.  The leaked descriptors
    trigger warnings in the GCC 13 static analyzer.
    
    As the only caller of this functions terminates the program on any error
    anyway, don't fix the file descriptor leaks, but terminate right after
    any error from inside the function.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    83cbbbd View commit details
    Browse the repository at this point in the history
  16. test_mx_util: Call mx_call_external with argv != NULL

    Newer Valgrind versions complain, when `execv()` is called with
    argv==NULL or with argv[0]==NULL.
    
    argv == NULL is not allowed by Posix, but the Linux kernel transforms
    that into an empty argument list. An empty argument list with
    argv[0]==NULL does not go against any specs, altough it might confuse
    programms and led to pkexec being exploitable (CVE-2021-4034)
    
    It is not wrong on Linux to call execv() or a wrapper function with
    argv==NULL, but avoid it anyway to prevent Valgrind warnings.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    67c431b View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    41b3f83 View commit details
    Browse the repository at this point in the history
  18. mxqkill: Update usage string

    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    2856013 View commit details
    Browse the repository at this point in the history
  19. mysql: Restore column group_flags

    Commit d25a77e ("mxq_job: Remove unused job_flags column") accidentally
    removed group_flags together with job_flags from the create_tables.sql
    file. Undo.
    donald committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    98cf93c View commit details
    Browse the repository at this point in the history