test/asynctest.c:232: error: INTEGER_OVERFLOW_L1
  ([-oo, 0] - 1):unsigned64 by call to `ASYNC_init_thread`.
Showing all 4 steps of the trace


test/asynctest.c:232:17: Call
230.       OSSL_ASYNC_FD fd;
231.   
232.       if (       !ASYNC_init_thread(1, 0)
                       ^
233.               || ASYNC_start_job(&job, &funcret, wake, NULL, 0)
234.                   != ASYNC_PAUSE

crypto/async/async.c:354:1: <LHS trace>
352.   }
353.   
354. > int ASYNC_init_thread(size_t max_size, size_t init_size)
355.   {
356.       async_pool *pool;

crypto/async/async.c:354:1: Parameter `init_size`
  352.   }
  353.   
  354. > int ASYNC_init_thread(size_t max_size, size_t init_size)
  355.   {
  356.       async_pool *pool;

crypto/async/async.c:386:12: Binary operation: ([-oo, 0] - 1):unsigned64 by call to `ASYNC_init_thread` 
  384.   
  385.       /* Pre-create jobs as required */
  386.       while (init_size--) {
                    ^
  387.           ASYNC_JOB *job;
  388.           job = async_job_new();

int ASYNC_init_thread(size_t max_size, size_t init_size)
{
    async_pool *pool;
    size_t curr_size = 0;
    if (init_size > max_size) {
        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_INVALID_POOL_SIZE);
        return 0;
    }
    OPENSSL_INIT_crypto_library_start(OPENSSL_INIT_ASYNC, NULL);
    if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ASYNC)) {
        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);
        return 0;
    }
    pool = OPENSSL_zalloc(sizeof *pool);
    if (pool == NULL) {
        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);
        return 0;
    }
    pool->jobs = sk_ASYNC_JOB_new_null();
    if (pool->jobs == NULL) {
        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);
        OPENSSL_free(pool);
        return 0;
    }
    pool->max_size = max_size;
    while (init_size--) {
        ASYNC_JOB *job;
        job = async_job_new();
        if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) {
            async_job_free(job);
            break;
        }
        job->funcargs = NULL;
        sk_ASYNC_JOB_push(pool->jobs, job);
        curr_size++;
    }
    pool->curr_size = curr_size;
    if (!async_set_pool(pool)) {
        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_FAILED_TO_SET_POOL);
        goto err;
    }
    return 1;
err:
    async_free_pool_internal(pool);
    return 0;
}
['static int test_ASYNC_get_wait_fd()\n{\n    ASYNC_JOB *job = NULL;\n    int funcret;\n    OSSL_ASYNC_FD fd;\n    if (       !ASYNC_init_thread(1, 0)\n            || ASYNC_start_job(&job, &funcret, wake, NULL, 0)\n                != ASYNC_PAUSE\n            || (fd = ASYNC_get_wait_fd(job)) < 0\n            || hasdata(fd) != 0\n            || ASYNC_start_job(&job, &funcret, save_current, NULL, 0)\n                != ASYNC_PAUSE\n            || hasdata(fd) != 1\n            || (ASYNC_clear_wake(job), 0)\n            || hasdata(fd) != 0\n            || (ASYNC_wake(job), 0)\n            || hasdata(fd) != 1\n            || ASYNC_start_job(&job, &funcret, save_current, NULL, 0)\n                != ASYNC_FINISH\n            || funcret != 1) {\n        fprintf(stderr, "test_ASYNC_get_wait_fd() failed\\n");\n        ASYNC_cleanup_thread();\n        return 0;\n    }\n    ASYNC_cleanup_thread();\n    return 1;\n}', 'int ASYNC_init_thread(size_t max_size, size_t init_size)\n{\n    async_pool *pool;\n    size_t curr_size = 0;\n    if (init_size > max_size) {\n        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_INVALID_POOL_SIZE);\n        return 0;\n    }\n    OPENSSL_INIT_crypto_library_start(OPENSSL_INIT_ASYNC, NULL);\n    if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ASYNC)) {\n        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);\n        return 0;\n    }\n    pool = OPENSSL_zalloc(sizeof *pool);\n    if (pool == NULL) {\n        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);\n        return 0;\n    }\n    pool->jobs = sk_ASYNC_JOB_new_null();\n    if (pool->jobs == NULL) {\n        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);\n        OPENSSL_free(pool);\n        return 0;\n    }\n    pool->max_size = max_size;\n    while (init_size--) {\n        ASYNC_JOB *job;\n        job = async_job_new();\n        if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) {\n            async_job_free(job);\n            break;\n        }\n        job->funcargs = NULL;\n        sk_ASYNC_JOB_push(pool->jobs, job);\n        curr_size++;\n    }\n    pool->curr_size = curr_size;\n    if (!async_set_pool(pool)) {\n        ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_FAILED_TO_SET_POOL);\n        goto err;\n    }\n    return 1;\nerr:\n    async_free_pool_internal(pool);\n    return 0;\n}']