public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Eric Botcazou <botcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/2] gcc/file-prefix-map: Allow remapping of relative paths
Date: Fri, 04 Nov 2022 17:21:30 +0000	[thread overview]
Message-ID: <31e522bea27d3439918ceca9b6eff01f6f2812b7.camel@linuxfoundation.org> (raw)
In-Reply-To: <2853801.e9J7NaK4W3@fomalhaut>

On Fri, 2022-11-04 at 10:12 +0100, Eric Botcazou wrote:
> > gcc/ChangeLog:
> > 
> >     * file-prefix-map.cc (remap_filename): Allow remapping of
> > relative paths
> 
> Small regression in Ada though, probably a missing guard somewhere:
> 
>                 === gnat tests ===
> 
> 
> Running target unix
> FAIL: gnat.dg/specs/coverage1.ads (test for excess errors)
> 
> In order to reproduce, configure the compiler with Ada enabled, build
> it, and 
> copy $[srcdir)/gcc/testsuite/gnat.dg/specs/coverage1.ads into the
> build 
> directory, then just issue:
> 
> gcc/gnat1 -quiet coverage1.ads -ftest-coverage -Igcc/ada/rts
> 
> raised STORAGE_ERROR : stack overflow or erroneous memory access

It took me a while to work out how to get ada to build. When I did I
found it was faulting due to a NULL filename being passed to lbasename:

Program received signal SIGSEGV, Segmentation fault.
lbasename (name=0x0) at gcc/libiberty/lbasename.c:82
82	  return unix_lbasename (name);
(gdb) bt
#0  lbasename (name=0x0) at gcc/libiberty/lbasename.c:82
#1  0x0000000000f3d566 in remap_filename (maps=0x0, filename=filename@entry=0x0) at gcc/gcc/file-prefix-map.cc:76
#2  0x0000000000f3d6df in remap_profile_filename (filename=filename@entry=0x0) at gcc/gcc/file-prefix-map.cc:158
#3  0x0000000000e59f59 in coverage_begin_function (lineno_checksum=lineno_checksum@entry=595732889, cfg_checksum=cfg_checksum@entry=2754642872)
    at gcc/gcc/coverage.cc:650
#4  0x00000000012263c0 in branch_prob (thunk=thunk@entry=false) at gcc/gcc/profile.cc:1400
#5  0x00000000013b1205 in tree_profiling () at gcc/gcc/tree-profile.cc:782
#6  (anonymous namespace)::pass_ipa_tree_profile::execute (this=<optimised out>) at gcc/gcc/tree-profile.cc:888
#7  0x00000000011ef30b in execute_one_pass (pass=0x36ebea0) at gcc/gcc/passes.cc:2644
#8  0x00000000011f0697 in execute_ipa_pass_list (pass=0x36ebea0) at gcc/gcc/passes.cc:3093
#9  0x0000000000e4c28d in ipa_passes () at gcc/gcc/cgraphunit.cc:2170
#10 symbol_table::compile (this=0x7ffff718f000) at gcc/gcc/cgraphunit.cc:2291
#11 0x0000000000e4ec08 in symbol_table::compile (this=0x7ffff718f000) at gcc/gcc/cgraphunit.cc:2271
#12 symbol_table::finalize_compilation_unit (this=0x7ffff718f000) at gcc/gcc/cgraphunit.cc:2543
#13 0x00000000012cfea0 in compile_file () at gcc/gcc/toplev.cc:471
#14 0x00000000009a727c in do_compile (no_backend=false) at gcc/gcc/toplev.cc:2125
#15 toplev::main (this=this@entry=0x7fffffffe21e, argc=<optimised out>, argc@entry=4, argv=<optimised out>, argv@entry=0x7fffffffe348) at gcc/gcc/toplev.cc:2277
#16 0x00000000009a8a8b in main (argc=4, argv=0x7fffffffe348) at gcc/gcc/main.cc:39

I can send the obvious patch to make it work as before and ignore the
NULL which fixes this. I'm not sure if it should really be passing NULL
around in the first place or not which is why I'm sharing the
backtrace.

Cheers,

Richard

  reply	other threads:[~2022-11-04 17:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 12:15 Richard Purdie
2022-08-17 12:15 ` [PATCH 2/2] libcpp: Avoid remapping filenames within directives Richard Purdie
2022-08-17 14:19   ` Richard Purdie
2022-11-01 19:32   ` Jeff Law
2022-11-02 10:52     ` Richard Purdie
2022-11-01 19:46 ` [PATCH 1/2] gcc/file-prefix-map: Allow remapping of relative paths Jeff Law
2023-01-19 13:06   ` Jakub Jelinek
2023-01-20 15:05   ` [PATCH] file-prefix-map: Fix up -f*-prefix-map= [PR108464] Jakub Jelinek
2023-01-23 15:39     ` Jakub Jelinek
2023-03-10  8:49     ` Patch ping - " Jakub Jelinek
2023-03-10  9:05       ` Richard Biener
2023-03-10 10:14         ` Richard Purdie
2022-11-04  9:12 ` [PATCH 1/2] gcc/file-prefix-map: Allow remapping of relative paths Eric Botcazou
2022-11-04 17:21   ` Richard Purdie [this message]
2022-11-07  8:01     ` Eric Botcazou
2022-11-07 16:21       ` Jeff Law
2022-11-07 16:36         ` Eric Botcazou

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=31e522bea27d3439918ceca9b6eff01f6f2812b7.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=botcazou@adacore.com \
    --cc=gcc-patches@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).