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

Jade Lovelace <gcc at jade dot fyi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcc at jade dot fyi

--- Comment #23 from Jade Lovelace <gcc at jade dot fyi> ---
(In reply to Sunil Dora from comment #22)
> Created attachment 60800 [details]
> gcc-13.3_Driver-Enable-very-long-gcc-command.patch
> 
> I have implemented the changes suggested by Andrew, and the feature is
> working fine in all GCC branches up to 13.3. However, in GCC 14 and the
> master branch, it causes a segmentation fault.
> 
> Patch: gcc-13.3_Driver-Enable-very-long-gcc-command.patch 
> --
> (This patch can be applied directly to the GCC 13.3 branch).

Hello! I have reviewed this patch as this bug is affecting us at work and we
would like to be able to use it (and possibly get it into nixpkgs).

The cause of the segfault is a mistake in `getenv_extended`, in which instead
of returning early if `getenv` returns nullptr, it instead calls `strncmp`,
which dereferences a null pointer and crashes.

Adding a line:
  if (string == nullptr) return nullptr;

should fix it.

I would also appreciate if you ping this fixed patch onto the mailing list, as
we would strongly prefer to not integrate patches into nixpkgs which are not
approved in principal by upstream. Thanks!

Reply via email to