git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] run-command: do not pass child process data into callbacks

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 1, 2016, 17:43 UTC
Message-ID
<xmqqd1re856r.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<56D54129.4090007@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 29 quoted lines
> Am 29.02.2016 um 22:57 schrieb Stefan Beller:
>> The expected way to pass data into the callback is to pass them via
>> the customizable callback pointer. The error reporting in
>> default_{start_failure, task_finished} is not user friendly enough, that
>> we want to encourage using the child data for such purposes.
>> 
>> Furthermore the struct child data is cleaned by the run-command API,
>> before we access them in the callbacks, leading to use-after-free
>> situations.
>
> Thanks. The code changes match what I had prototyped. But please squash
> in this documentation change:
>
> diff --git a/run-command.h b/run-command.h
> index c6a3e42..3d1e59e 100644
> --- a/run-command.h
> +++ b/run-command.h
> @@ -191,9 +191,8 @@ typedef int (*task_finished_fn)(int result,
>   * (both stdout and stderr) is routed to stderr in a manner that output
>   * from different tasks does not interleave.
>   *
> - * If start_failure_fn or task_finished_fn are NULL, default handlers
> - * will be used. The default handlers will print an error message on
> - * error without issuing an emergency stop.
> + * start_failure_fn and task_finished_fn can be NULL to omit any
> + * special handling.
>   */
>  int run_processes_parallel(int n,
>  			   get_next_task_fn,
Thanks for careful reading.
Previous: Johannes SixtNext: Stefan Beller
Message 5 of 6 in “run-command: do not pass child process data into callbacks”
  1. run-command: do not pass child process data into callbacksStefan Beller, Feb 29, 2016
  2. Stefan BellerFeb 29, 2016
  3. Junio C HamanoFeb 29, 2016
  4. Johannes SixtMar 1, 2016
  5. Junio C HamanoMar 1, 2016
  6. [PATCHv2] run-command: do not pass child process data into callbacksStefan Beller, Mar 1, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.