public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug driver/106624] [13 Regression] LTO plugin fails to build in parallel builds: xgcc: fatal error: cannot execute '/build/build/./prev-gcc/collect2': execv: Bad address since r13-2011-g53e3b2bf16a486
Date: Tue, 16 Aug 2022 12:16:09 +0000	[thread overview]
Message-ID: <bug-106624-4-yaZ0THvaMA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106624-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106624

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sergei Trofimovich <slyfox@gcc.gnu.org>:

https://gcc.gnu.org/g:2b403297b111c990c331b5bbb6165b061ad2259b

commit r13-2075-g2b403297b111c990c331b5bbb6165b061ad2259b
Author: Sergei Trofimovich <siarheit@google.com>
Date:   Tue Aug 16 12:35:07 2022 +0100

    driver: fix environ corruption after putenv() [PR106624]

    The bug appeared afte r13-2010-g1270ccda70ca09 "Factor out
    jobserver_active_p" slightly changed `putenv()` use from allocating
    to non-allocating:

        -xputenv (concat ("MAKEFLAGS=", dup, NULL));
        +xputenv (jinfo.skipped_makeflags.c_str ());

    `xputenv()` (and `putenv()`) don't copy strings and only store the
    pointer in the `environ` global table. As a result `environ` got
    corrupted as soon as `jinfo.skipped_makeflags` store got deallocated.

    This started causing bootstrap crashes in `execv()` calls:

        xgcc: fatal error: cannot execute '/build/build/./prev-gcc/collect2':
execv: Bad address

    The change restores memory allocation for `xputenv()` argument.

    gcc/

            PR driver/106624
            * gcc.cc (driver::detect_jobserver): Allocate storage xputenv()
            argument using xstrdup().

  parent reply	other threads:[~2022-08-16 12:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 12:14 [Bug bootstrap/106624] New: [13 Regression] LTO plugin fails to build in parallel builds: xgcc: fatal error: cannot execute '/build/build/./prev-gcc/collect2': execv: Bad address slyfox at gcc dot gnu.org
2022-08-15 12:14 ` [Bug bootstrap/106624] " slyfox at gcc dot gnu.org
2022-08-15 13:26 ` slyfox at gcc dot gnu.org
2022-08-15 13:47 ` marxin at gcc dot gnu.org
2022-08-15 19:50 ` slyfox at gcc dot gnu.org
2022-08-15 20:26 ` marxin at gcc dot gnu.org
2022-08-15 21:01 ` [Bug bootstrap/106624] [13 Regression] LTO plugin fails to build in parallel builds: xgcc: fatal error: cannot execute '/build/build/./prev-gcc/collect2': execv: Bad address since r13-2011-g53e3b2bf16a486 marxin at gcc dot gnu.org
2022-08-16  6:02 ` slyfox at gcc dot gnu.org
2022-08-16  7:58 ` rguenth at gcc dot gnu.org
2022-08-16 11:05 ` slyfox at gcc dot gnu.org
2022-08-16 11:27 ` marxin at gcc dot gnu.org
2022-08-16 11:50 ` [Bug driver/106624] " slyfox at gcc dot gnu.org
2022-08-16 12:16 ` cvs-commit at gcc dot gnu.org [this message]
2022-08-16 12:17 ` slyfox at gcc dot gnu.org
2023-01-24 10:52 ` cvs-commit at gcc dot gnu.org
2023-01-24 10:53 ` cvs-commit at gcc dot gnu.org
2023-01-24 10:55 ` cvs-commit at gcc dot gnu.org

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

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

  git send-email \
    --in-reply-to=bug-106624-4-yaZ0THvaMA@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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.
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).