[Bug c++/89868] -fsanitize=address inhibits C++ unhandled exception core dump

2019-03-29 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89868

--- Comment #6 from Jonny Grant  ---
(In reply to Andrew Pinski from comment #5)
> Actually it comes from the shell.
> 
> e.g. from bash:
>   if ((WIFSTOPPED (show->status) == 0) &&
>   (WIFCONTINUED (show->status) == 0) &&
>   WIFCORED (show->status))
> fprintf (stream, _("(core dumped) "));
> 
> As WIFCORED is set on status.
> 
> WIFCORED is really a define for WCOREDUMP.
> 
> http://man7.org/linux/man-pages/man2/waitpid.2.html
> 
> So basically the kernel does not communicate why a core is not dumped to the
> waiting (parent) process.

Hi Andrew
Thank you for tracking that down. It is a shame, there isn't a WCORETOOLARGE,
or WUNABLETOCOREDUMP etc..  I wonder really how big the core must be to be
unable to save

Could I ask, if you run the test case with Asan, do you see the same behaviour?

[Bug c++/89868] -fsanitize=address inhibits C++ unhandled exception core dump

2019-03-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89868

--- Comment #5 from Andrew Pinski  ---
Actually it comes from the shell.

e.g. from bash:
  if ((WIFSTOPPED (show->status) == 0) &&
  (WIFCONTINUED (show->status) == 0) &&
  WIFCORED (show->status))
fprintf (stream, _("(core dumped) "));

As WIFCORED is set on status.

WIFCORED is really a define for WCOREDUMP.

http://man7.org/linux/man-pages/man2/waitpid.2.html

So basically the kernel does not communicate why a core is not dumped to the
waiting (parent) process.

[Bug c++/89868] -fsanitize=address inhibits C++ unhandled exception core dump

2019-03-28 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89868

--- Comment #4 from Jonny Grant  ---
(In reply to Andrew Pinski from comment #3)
> (In reply to Jonny Grant from comment #2)
> > Ah that sounds possible. I imagine it is not GCC that would be the one that
> > controls the core dumping? Perhaps where ever that code is, it could just
> > say "Core too large (xyz MB) unable to dump".
> 
> That would be the kernel.

Hi Andrew
I had a look through kernel and /fs/binfmt_elf.c but couldn't spot where the
"Aborted (core dumped)" comes from, do you know by any chance?

[Bug c++/89868] -fsanitize=address inhibits C++ unhandled exception core dump

2019-03-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89868

--- Comment #3 from Andrew Pinski  ---
(In reply to Jonny Grant from comment #2)
> Ah that sounds possible. I imagine it is not GCC that would be the one that
> controls the core dumping? Perhaps where ever that code is, it could just
> say "Core too large (xyz MB) unable to dump".

That would be the kernel.

[Bug c++/89868] -fsanitize=address inhibits C++ unhandled exception core dump

2019-03-28 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89868

--- Comment #2 from Jonny Grant  ---
Ah that sounds possible. I imagine it is not GCC that would be the one that
controls the core dumping? Perhaps where ever that code is, it could just say
"Core too large (xyz MB) unable to dump".

[Bug c++/89868] -fsanitize=address inhibits C++ unhandled exception core dump

2019-03-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89868

--- Comment #1 from Jonathan Wakely  ---
I suspect the problem is that Asan makes the address space much much larger,
and so the core file is larger than the max core file size allowed on your
system.