public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112587] New: -save-temps with p1689 dep output causes null ptr dereference
@ 2023-11-17 12:30 nickbegg at gmail dot com
  2023-11-17 12:32 ` [Bug c++/112587] " nickbegg at gmail dot com
  2023-11-17 12:33 ` nickbegg at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: nickbegg at gmail dot com @ 2023-11-17 12:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112587
           Summary: -save-temps with p1689 dep output causes null ptr
                    dereference
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickbegg at gmail dot com
  Target Milestone: ---

Whilst debugging a separate bug with a trivial module, GCC crashes with a null
ptr dereference. I have --save-temps on.

The problem seems to start here:

gcc/c-family/c-opts.cc:1340
  fatal_error (input_location, "%<-MF%> and %<-fdeps-file=%> cannot share an
output file %s: %m", fdeps_file);

The cc1plus process looks like it's not invoked with -fdeps-file, and thus
fdeps_file is null. Printing this diagnostic causes a crash. It seems to crash
before a bug report is written out.

This is the version -

GNU C++23 (GCC) version 14.0.0 20231117 (experimental) (x86_64-pc-linux-gnu)
(git rev ba3f5b8465ef7b278ea33ff94cd85b9638058635)

This is the cmdline used to launch gcc  (launched from cmake/ninja) -

/home/nick/gcc-trunk-debug-inst/bin/g++ -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_DEBUG 
-std=gnu++23 -Wall -Wextra -v -freport-bug -save-temps -MD -MT
CMakeFiles/moduleMin.dir/modA.mpp.o -MF CMakeFiles/moduleMin.dir/modA.mpp.o.d
-fmodules-ts -fmodule-mapper=CMakeFiles/moduleMin.dir/modA.mpp.o.modmap -MD
-fdeps-format=p1689r5 -x c++ -o CMakeFiles/moduleMin.dir/modA.mpp.o -c
/home/nick/src/moduleMin/modA.mpp

... and the cmdline to launch cc1plus which crashes -

 /home/nick/gcc-trunk-debug-inst/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/cc1plus
-fpreprocessed CMakeFiles/moduleMin.dir/modA.mpp.ii -quiet -dumpdir
CMakeFiles/moduleMin.dir/ -dumpbase modA.mpp.mpp -dumpbase-ext .mpp
-mtune=generic -march=x86-64 -Wall -Wextra -std=gnu++23 -version -freport-bug
-fmodules-ts -fmodule-mapper=CMakeFiles/moduleMin.dir/modA.mpp.o.modmap
-fdeps-format=p1689r5 -o CMakeFiles/moduleMin.dir/modA.mpp.s

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/112587] -save-temps with p1689 dep output causes null ptr dereference
  2023-11-17 12:30 [Bug c++/112587] New: -save-temps with p1689 dep output causes null ptr dereference nickbegg at gmail dot com
@ 2023-11-17 12:32 ` nickbegg at gmail dot com
  2023-11-17 12:33 ` nickbegg at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: nickbegg at gmail dot com @ 2023-11-17 12:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Nick Begg <nickbegg at gmail dot com> ---
Created attachment 56620
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56620&action=edit
preprocessed source

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/112587] -save-temps with p1689 dep output causes null ptr dereference
  2023-11-17 12:30 [Bug c++/112587] New: -save-temps with p1689 dep output causes null ptr dereference nickbegg at gmail dot com
  2023-11-17 12:32 ` [Bug c++/112587] " nickbegg at gmail dot com
@ 2023-11-17 12:33 ` nickbegg at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: nickbegg at gmail dot com @ 2023-11-17 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Nick Begg <nickbegg at gmail dot com> ---
Created attachment 56621
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56621&action=edit
Full output from invocation

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-17 12:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-17 12:30 [Bug c++/112587] New: -save-temps with p1689 dep output causes null ptr dereference nickbegg at gmail dot com
2023-11-17 12:32 ` [Bug c++/112587] " nickbegg at gmail dot com
2023-11-17 12:33 ` nickbegg at gmail dot com

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).