crypto/async/async.c:352: error: MEMORY_LEAK
  memory dynamically allocated by call to `async_fibre_makecontext()` at line 352, column 29 is not reachable after line 352, column 29.
Showing all 88 steps of the trace


crypto/async/async.c:316:1: start of procedure ASYNC_init_thread()
314.   }
315.   
316. > int ASYNC_init_thread(size_t max_size, size_t init_size)
317.   {
318.       async_pool *pool;

crypto/async/async.c:319:5: 
317.   {
318.       async_pool *pool;
319. >     size_t curr_size = 0;
320.   
321.       if (init_size > max_size) {

crypto/async/async.c:321:9: Taking false branch
319.       size_t curr_size = 0;
320.   
321.       if (init_size > max_size) {
               ^
322.           ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_INVALID_POOL_SIZE);
323.           return 0;

crypto/async/async.c:326:10: Taking false branch
324.       }
325.   
326.       if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) {
                ^
327.           return 0;
328.       }

crypto/async/async.c:329:10: Taking false branch
327.           return 0;
328.       }
329.       if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ASYNC)) {
                ^
330.           return 0;
331.       }

crypto/async/async.c:333:5: 
331.       }
332.   
333. >     pool = OPENSSL_zalloc(sizeof *pool);
334.       if (pool == NULL) {
335.           ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);

crypto/mem.c:186:1: start of procedure CRYPTO_zalloc()
  184.   }
  185.   
  186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  187.   {
  188.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:188:5: 
  186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  187.   {
  188. >     void *ret = CRYPTO_malloc(num, file, line);
  189.   
  190.       FAILTEST();

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
    156.   #endif
    157.   
    158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    159.   {
    160.       void *ret = NULL;

crypto/mem.c:160:5: 
    158.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    159.   {
    160. >     void *ret = NULL;
    161.   
    162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:162:9: Taking false branch
    160.       void *ret = NULL;
    161.   
    162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    163.           return malloc_impl(num, file, line);
    164.   

crypto/mem.c:165:9: Taking false branch
    163.           return malloc_impl(num, file, line);
    164.   
    165.       if (num == 0)
                   ^
    166.           return NULL;
    167.   

crypto/mem.c:169:5: 
    167.   
    168.       FAILTEST();
    169. >     allow_customize = 0;
    170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:179:24: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:180:5: 
    178.   #else
    179.       osslargused(file); osslargused(line);
    180. >     ret = malloc(num);
    181.   #endif
    182.   

crypto/mem.c:183:5: 
    181.   #endif
    182.   
    183. >     return ret;
    184.   }
    185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
    182.   
    183.       return ret;
    184. > }
    185.   
    186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:191:9: Taking true branch
  189.   
  190.       FAILTEST();
  191.       if (ret != NULL)
                 ^
  192.           memset(ret, 0, num);
  193.       return ret;

crypto/mem.c:192:9: 
  190.       FAILTEST();
  191.       if (ret != NULL)
  192. >         memset(ret, 0, num);
  193.       return ret;
  194.   }

crypto/mem.c:193:5: 
  191.       if (ret != NULL)
  192.           memset(ret, 0, num);
  193. >     return ret;
  194.   }
  195.   

crypto/mem.c:194:1: return from a call to CRYPTO_zalloc
  192.           memset(ret, 0, num);
  193.       return ret;
  194. > }
  195.   
  196.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/async/async.c:334:9: Taking false branch
332.   
333.       pool = OPENSSL_zalloc(sizeof *pool);
334.       if (pool == NULL) {
               ^
335.           ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);
336.           return 0;

crypto/async/async.c:339:5: 
337.       }
338.   
339. >     pool->jobs = sk_ASYNC_JOB_new_null();
340.       if (pool->jobs == NULL) {
341.           ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);

crypto/async/async_locl.h:64:1: start of procedure sk_ASYNC_JOB_new_null()
  62.   };
  63.   
  64. > DEFINE_STACK_OF(ASYNC_JOB)
  65.   
  66.   struct async_pool_st {

crypto/stack/stack.c:99:1: start of procedure OPENSSL_sk_new_null()
    97.   }
    98.   
    99. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    100.   {
    101.       return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL);

crypto/stack/stack.c:101:5: Skipping OPENSSL_sk_new(): empty list of specs
    99.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    100.   {
    101.       return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL);
               ^
    102.   }
    103.   

crypto/stack/stack.c:102:1: return from a call to OPENSSL_sk_new_null
    100.   {
    101.       return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL);
    102. > }
    103.   
    104.   OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c)

crypto/async/async_locl.h:64:1: return from a call to sk_ASYNC_JOB_new_null
  62.   };
  63.   
  64. > DEFINE_STACK_OF(ASYNC_JOB)
  65.   
  66.   struct async_pool_st {

crypto/async/async.c:340:9: Taking false branch
338.   
339.       pool->jobs = sk_ASYNC_JOB_new_null();
340.       if (pool->jobs == NULL) {
               ^
341.           ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE);
342.           OPENSSL_free(pool);

crypto/async/async.c:346:5: 
344.       }
345.   
346. >     pool->max_size = max_size;
347.   
348.       /* Pre-create jobs as required */

crypto/async/async.c:349:12: Loop condition is true. Entering loop body
347.   
348.       /* Pre-create jobs as required */
349.       while (init_size--) {
                  ^
350.           ASYNC_JOB *job;
351.           job = async_job_new();

crypto/async/async.c:351:9: Skipping async_job_new(): empty list of specs
349.       while (init_size--) {
350.           ASYNC_JOB *job;
351.           job = async_job_new();
               ^
352.           if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) {
353.               /*

crypto/async/async.c:352:13: Taking false branch
350.           ASYNC_JOB *job;
351.           job = async_job_new();
352.           if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) {
                   ^
353.               /*
354.                * Not actually fatal because we already created the pool, just

crypto/async/async.c:352:29: 
350.           ASYNC_JOB *job;
351.           job = async_job_new();
352. >         if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) {
353.               /*
354.                * Not actually fatal because we already created the pool, just

crypto/async/arch/async_posix.c:35:1: start of procedure async_fibre_makecontext()
  33.   }
  34.   
  35. > int async_fibre_makecontext(async_fibre *fibre)
  36.   {
  37.       fibre->env_init = 0;

crypto/async/arch/async_posix.c:37:5: 
  35.   int async_fibre_makecontext(async_fibre *fibre)
  36.   {
  37. >     fibre->env_init = 0;
  38.       if (getcontext(&fibre->fibre) == 0) {
  39.           fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);

crypto/async/arch/async_posix.c:38:9: Taking true branch
  36.   {
  37.       fibre->env_init = 0;
  38.       if (getcontext(&fibre->fibre) == 0) {
                ^
  39.           fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {

crypto/async/arch/async_posix.c:39:9: 
  37.       fibre->env_init = 0;
  38.       if (getcontext(&fibre->fibre) == 0) {
  39. >         fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {
  41.               fibre->fibre.uc_stack.ss_size = STACKSIZE;

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
    156.   #endif
    157.   
    158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    159.   {
    160.       void *ret = NULL;

crypto/mem.c:160:5: 
    158.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    159.   {
    160. >     void *ret = NULL;
    161.   
    162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:162:9: Taking false branch
    160.       void *ret = NULL;
    161.   
    162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    163.           return malloc_impl(num, file, line);
    164.   

crypto/mem.c:165:9: Taking false branch
    163.           return malloc_impl(num, file, line);
    164.   
    165.       if (num == 0)
                   ^
    166.           return NULL;
    167.   

crypto/mem.c:169:5: 
    167.   
    168.       FAILTEST();
    169. >     allow_customize = 0;
    170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:179:24: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:180:5: 
    178.   #else
    179.       osslargused(file); osslargused(line);
    180. >     ret = malloc(num);
    181.   #endif
    182.   

crypto/mem.c:183:5: 
    181.   #endif
    182.   
    183. >     return ret;
    184.   }
    185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
    182.   
    183.       return ret;
    184. > }
    185.   
    186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/async/arch/async_posix.c:40:13: Taking true branch
  38.       if (getcontext(&fibre->fibre) == 0) {
  39.           fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {
                    ^
  41.               fibre->fibre.uc_stack.ss_size = STACKSIZE;
  42.               fibre->fibre.uc_link = NULL;

crypto/async/arch/async_posix.c:41:13: 
  39.           fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {
  41. >             fibre->fibre.uc_stack.ss_size = STACKSIZE;
  42.               fibre->fibre.uc_link = NULL;
  43.               makecontext(&fibre->fibre, async_start_func, 0);

crypto/async/arch/async_posix.c:42:13: 
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {
  41.               fibre->fibre.uc_stack.ss_size = STACKSIZE;
  42. >             fibre->fibre.uc_link = NULL;
  43.               makecontext(&fibre->fibre, async_start_func, 0);
  44.               return 1;

crypto/async/arch/async_posix.c:43:13: Skipping makecontext(): method has no implementation
  41.               fibre->fibre.uc_stack.ss_size = STACKSIZE;
  42.               fibre->fibre.uc_link = NULL;
  43.               makecontext(&fibre->fibre, async_start_func, 0);
                    ^
  44.               return 1;
  45.           }

crypto/async/arch/async_posix.c:44:13: 
  42.               fibre->fibre.uc_link = NULL;
  43.               makecontext(&fibre->fibre, async_start_func, 0);
  44. >             return 1;
  45.           }
  46.       } else {

crypto/async/arch/async_posix.c:50:1: return from a call to async_fibre_makecontext
  48.       }
  49.       return 0;
  50. > }
  51.   
  52.   void async_fibre_free(async_fibre *fibre)

crypto/async/async.c:352:29: Taking false branch
350.           ASYNC_JOB *job;
351.           job = async_job_new();
352.           if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) {
                                   ^
353.               /*
354.                * Not actually fatal because we already created the pool, just

crypto/async/async.c:360:9: 
358.               break;
359.           }
360. >         job->funcargs = NULL;
361.           sk_ASYNC_JOB_push(pool->jobs, job);
362.           curr_size++;

crypto/async/async.c:361:9: 
359.           }
360.           job->funcargs = NULL;
361. >         sk_ASYNC_JOB_push(pool->jobs, job);
362.           curr_size++;
363.       }

crypto/async/async_locl.h:64:1: start of procedure sk_ASYNC_JOB_push()
  62.   };
  63.   
  64. > DEFINE_STACK_OF(ASYNC_JOB)
  65.   
  66.   struct async_pool_st {

crypto/stack/stack.c:219:1: start of procedure OPENSSL_sk_push()
    217.   }
    218.   
    219. > int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    220.   {
    221.       return (OPENSSL_sk_insert(st, data, st->num));

crypto/stack/stack.c:221:5: Skipping OPENSSL_sk_insert(): empty list of specs
    219.   int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    220.   {
    221.       return (OPENSSL_sk_insert(st, data, st->num));
               ^
    222.   }
    223.   

crypto/stack/stack.c:222:1: return from a call to OPENSSL_sk_push
    220.   {
    221.       return (OPENSSL_sk_insert(st, data, st->num));
    222. > }
    223.   
    224.   int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data)

crypto/async/async_locl.h:64:1: return from a call to sk_ASYNC_JOB_push
  62.   };
  63.   
  64. > DEFINE_STACK_OF(ASYNC_JOB)
  65.   
  66.   struct async_pool_st {

crypto/async/async.c:362:9: 
360.           job->funcargs = NULL;
361.           sk_ASYNC_JOB_push(pool->jobs, job);
362. >         curr_size++;
363.       }
364.       pool->curr_size = curr_size;

crypto/async/async.c:349:12: Loop condition is true. Entering loop body
347.   
348.       /* Pre-create jobs as required */
349.       while (init_size--) {
                  ^
350.           ASYNC_JOB *job;
351.           job = async_job_new();

crypto/async/async.c:351:9: Skipping async_job_new(): empty list of specs
349.       while (init_size--) {
350.           ASYNC_JOB *job;
351.           job = async_job_new();
               ^
352.           if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) {
353.               /*

crypto/async/async.c:352:13: Taking false branch
350.           ASYNC_JOB *job;
351.           job = async_job_new();
352.           if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) {
                   ^
353.               /*
354.                * Not actually fatal because we already created the pool, just

crypto/async/async.c:352:29: 
350.           ASYNC_JOB *job;
351.           job = async_job_new();
352. >         if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) {
353.               /*
354.                * Not actually fatal because we already created the pool, just

crypto/async/arch/async_posix.c:35:1: start of procedure async_fibre_makecontext()
  33.   }
  34.   
  35. > int async_fibre_makecontext(async_fibre *fibre)
  36.   {
  37.       fibre->env_init = 0;

crypto/async/arch/async_posix.c:37:5: 
  35.   int async_fibre_makecontext(async_fibre *fibre)
  36.   {
  37. >     fibre->env_init = 0;
  38.       if (getcontext(&fibre->fibre) == 0) {
  39.           fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);

crypto/async/arch/async_posix.c:38:9: Taking true branch
  36.   {
  37.       fibre->env_init = 0;
  38.       if (getcontext(&fibre->fibre) == 0) {
                ^
  39.           fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {

crypto/async/arch/async_posix.c:39:9: 
  37.       fibre->env_init = 0;
  38.       if (getcontext(&fibre->fibre) == 0) {
  39. >         fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {
  41.               fibre->fibre.uc_stack.ss_size = STACKSIZE;

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
    156.   #endif
    157.   
    158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    159.   {
    160.       void *ret = NULL;

crypto/mem.c:160:5: 
    158.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    159.   {
    160. >     void *ret = NULL;
    161.   
    162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:162:9: Taking false branch
    160.       void *ret = NULL;
    161.   
    162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    163.           return malloc_impl(num, file, line);
    164.   

crypto/mem.c:165:9: Taking false branch
    163.           return malloc_impl(num, file, line);
    164.   
    165.       if (num == 0)
                   ^
    166.           return NULL;
    167.   

crypto/mem.c:169:5: 
    167.   
    168.       FAILTEST();
    169. >     allow_customize = 0;
    170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:179:24: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:180:5: 
    178.   #else
    179.       osslargused(file); osslargused(line);
    180. >     ret = malloc(num);
    181.   #endif
    182.   

crypto/mem.c:183:5: 
    181.   #endif
    182.   
    183. >     return ret;
    184.   }
    185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
    182.   
    183.       return ret;
    184. > }
    185.   
    186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/async/arch/async_posix.c:40:13: Taking true branch
  38.       if (getcontext(&fibre->fibre) == 0) {
  39.           fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {
                    ^
  41.               fibre->fibre.uc_stack.ss_size = STACKSIZE;
  42.               fibre->fibre.uc_link = NULL;

crypto/async/arch/async_posix.c:41:13: 
  39.           fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {
  41. >             fibre->fibre.uc_stack.ss_size = STACKSIZE;
  42.               fibre->fibre.uc_link = NULL;
  43.               makecontext(&fibre->fibre, async_start_func, 0);

crypto/async/arch/async_posix.c:42:13: 
  40.           if (fibre->fibre.uc_stack.ss_sp != NULL) {
  41.               fibre->fibre.uc_stack.ss_size = STACKSIZE;
  42. >             fibre->fibre.uc_link = NULL;
  43.               makecontext(&fibre->fibre, async_start_func, 0);
  44.               return 1;

crypto/async/arch/async_posix.c:43:13: Skipping makecontext(): method has no implementation
  41.               fibre->fibre.uc_stack.ss_size = STACKSIZE;
  42.               fibre->fibre.uc_link = NULL;
  43.               makecontext(&fibre->fibre, async_start_func, 0);
                    ^
  44.               return 1;
  45.           }

crypto/async/arch/async_posix.c:44:13: 
  42.               fibre->fibre.uc_link = NULL;
  43.               makecontext(&fibre->fibre, async_start_func, 0);
  44. >             return 1;
  45.           }
  46.       } else {

crypto/async/arch/async_posix.c:50:1: return from a call to async_fibre_makecontext
  48.       }
  49.       return 0;
  50. > }
  51.   
  52.   void async_fibre_free(async_fibre *fibre)
