"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mikhail <mp39590@gmail.com>
Subject:
Re: crash in 'got log' (no reliable way to reproduce)
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Sat, 1 Apr 2023 18:07:58 +0300

Download raw body.

Thread
On Sat, Apr 01, 2023 at 01:45:03PM +0200, Omar Polo wrote:
> 
> So I guess the issue is here.  We should guard
> got_object_blob_close(blob2) like with do with blob1.
> 
> diff /home/op/w/got
> commit - e9e0377f452e9d3f600011e0714cc6c779f10bab
> path + /home/op/w/got
> blob - a51a450a06ab2800d2fe4a200fc31cc59364dac6
> file + got/got.c
> --- got/got.c
> +++ got/got.c
> @@ -3707,9 +3707,10 @@ done:
>  	if (blob1)
>  		got_object_blob_close(blob1);
>  	if (fd2 != -1 && close(fd2) == -1 && err == NULL)
>  		err = got_error_from_errno("close");
> -	got_object_blob_close(blob2);
> +	if (blob2)
> +		got_object_blob_close(blob2);
>  	if (f1 && fclose(f1) == EOF && err == NULL)
>  		err = got_error_from_errno("fclose");
>  	if (f2 && fclose(f2) == EOF && err == NULL)
>  		err = got_error_from_errno("fclose");

30 runs are ok, previously it was crashing like ~1 time out of 10

thank you!