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

Re: [PATCH 2/2] Fix stack-use-after-scope error reported by ASAN by GCC 7.

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 6, 2017, 08:55 UTC
Message-ID
<alpine.DEB.2.20.1704061051130.4268@virtualbox>
In-Reply-To
<072afb58-6159-ddeb-b7dc-40a87e8c6ae7@suse.cz>
Hi Martin,
On Thu, 6 Apr 2017, Martin Liška wrote:
> Following patch fixes issues that can be seen with -fsanitize=address on
> GCC 7.
Good catch.

However, it may make more sense to switch to using the "args" field instead of the "argv" field: it is of type "struct argv_array" and is released automagically by finish_command().

In other words, you would use something like
@@ -600,7 +601,8 @@ static struct cmd2process
*start_multi_file_filter(struct hashmap *hashmap, cons
        process = &entry->process;

        child_process_init(process);
-       process->argv = argv;
+	argv_array_push(&process->args, cmd);

instead, making even for a nice LOC reduction.

Ciao,
Johannes
Previous: Jeff KingNext: Martin Liška
Message 3 of 4 in “Fix stack-use-after-scope error reported by ASAN by GCC 7.”
  1. 2/2 Fix stack-use-after-scope error reported by ASAN by GCC 7.Martin Liška, Apr 6, 2017
  2. Jeff KingApr 6, 2017
  3. Johannes SchindelinApr 6, 2017
  4. Martin LiškaApr 6, 2017

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.