git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Palmer Dabbelt <palmer@sifive.com>
To: szeder.dev@gmail.com
Cc: git@vger.kernel.org, peff@peff.net, e@80x24.org,
	chriscool@tuxfamily.org, gitster@pobox.com,
	jonathantanmy@google.com, tboegi@web.de, bwilliams.eng@gmail.com,
	jeffhost@microsoft.com
Subject: Re: [PATCH v2 5/5] fetch: Make --jobs control submodules and remotes
Date: Wed, 14 Aug 2019 11:33:15 -0700 (PDT)	[thread overview]
Message-ID: <mhng-0d288d1c-02fc-4280-bd8f-b7f611af3e8a@palmer-si-x1c4> (raw)
In-Reply-To: <20190814083245.GP20404@szeder.dev>

On Wed, 14 Aug 2019 01:32:45 PDT (-0700), szeder.dev@gmail.com wrote:
> On Mon, Aug 12, 2019 at 02:34:48PM -0700, Palmer Dabbelt wrote:
>> diff --git a/builtin/fetch.c b/builtin/fetch.c
>> index 67d001f3f78b..41498e9efb3b 100644
>> --- a/builtin/fetch.c
>> +++ b/builtin/fetch.c
>> @@ -114,6 +114,20 @@ static int git_fetch_config(const char *k, const char *v, void *cb)
>>  	return git_default_config(k, v, cb);
>>  }
>>
>> +static int parse_jobs_arg(const struct option *opt, const char *arg, int unset)
>> +{
>> +	int jobs;
>> +
>> +	jobs = atoi(arg);
>> +	if (jobs < 1)
>> +		die(_("There must be a positive number of jobs"));
>> +
>> +	max_children_for_submodules = jobs;
>> +	max_children_for_fetch = jobs;
>> +
>> +	return 0;
>> +}
>> +
>>  static int parse_refmap_arg(const struct option *opt, const char *arg, int unset)
>>  {
>>  	BUG_ON_OPT_NEG(unset);
>> @@ -142,12 +156,13 @@ static struct option builtin_fetch_options[] = {
>>  		    N_("fetch all tags and associated objects"), TAGS_SET),
>>  	OPT_SET_INT('n', NULL, &tags,
>>  		    N_("do not fetch all tags (--no-tags)"), TAGS_UNSET),
>> -	OPT_INTEGER('j', "jobs", &max_children_for_submodules,
>> +	{ OPTION_CALLBACK, 'j', "jobs", NULL, N_("jobs"),
>> +		    N_("number of parallel tasks to run while fetching"),
>> +		    PARSE_OPT_OPTARG, &parse_jobs_arg },
>
> These changes result segmentation faults in the tests '--quiet
> propagates to parallel submodules' and 'fetching submodules respects
> parallel settings' in 't5526-fetch-submodules.sh'.
>
> If the number of jobs is specified as '-j 2' or '--jobs 7', i.e. as an
> unstuck argument of the option, as opposed to '-j2' or '--jobs=7',
> then 'arg' in the parse_jobs_arg() callback is NULL, which then causes
> the segfault somewhere inside that atoi() call.

Thanks, I'll fix that in the v3.

      parent reply	other threads:[~2019-08-14 18:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 21:34 [PATCH v2 0/5] fetch: Extend --jobs to multiple remotes Palmer Dabbelt
2019-08-12 21:34 ` [PATCH v2 1/5] fetch: Rename max_children to max_children_for_submodules Palmer Dabbelt
2019-08-12 21:34 ` [PATCH v2 2/5] fetch: Add the "--fetch-jobs" option Palmer Dabbelt
2019-08-13 14:44   ` Eric Wong
2019-08-12 21:34 ` [PATCH v2 3/5] fetch: Add the fetch.jobs config key Palmer Dabbelt
2019-08-12 21:34 ` [PATCH v2 4/5] fetch: Add the --submodule-fetch-jobs option Palmer Dabbelt
2019-08-12 21:34 ` [PATCH v2 5/5] fetch: Make --jobs control submodules and remotes Palmer Dabbelt
2019-08-13 20:16   ` Johannes Schindelin
2019-08-13 22:06     ` Palmer Dabbelt
2019-08-13 22:00   ` Junio C Hamano
2019-08-13 22:06     ` Palmer Dabbelt
2019-08-14  8:32   ` SZEDER Gábor
2019-08-14 15:54     ` Junio C Hamano
2019-08-14 18:33     ` Palmer Dabbelt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mhng-0d288d1c-02fc-4280-bd8f-b7f611af3e8a@palmer-si-x1c4 \
    --to=palmer@sifive.com \
    --cc=bwilliams.eng@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=e@80x24.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=jonathantanmy@google.com \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.com \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).