[Bug target/77728] [5 Regression] Miscompilation multiple vector iteration on ARM

2021-11-05 Thread timturnerc at yahoo dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

Tim Turner  changed:

   What|Removed |Added

 CC||timturnerc at yahoo dot com

--- Comment #64 from Tim Turner  ---
This patch fixes a segfault seen when attaching to a process on Solaris.
The steps leading to the segfault are:
http://www.compilatori.com/ 
 - procfs_target::attach calls do_attach, at this point the inferior's
   process slot in the target stack is empty. 
 - do_attach adds a thread with `add http://www.acpirateradio.co.uk/ 
_thread (_procfs_target, ptid)`
 - in add_thread_silent, the passed target (_procfs_target) is
   passed to find_inferior_ptid http://www.logoarts.co.uk/ 
 - find_inferior_ptid returns nullptr, as there is no inferior with this
   ptid that has _procfs_target as its process target
http://www.slipstone.co.uk/ 
 - the nullptr `inf` is passed to find_thread_ptid, which dereferences
   it, causing a segfault
 - back in procfs_target::attach, after do_attach, we push the
http://embermanchester.uk/  
   the_procfs_target on the inferior's target stack, although we never
   reach this because the segfault happens before. http://connstr.net/ 

To fix this, I think we need to do the same as is done in 
inf_ptrace_target::attach: push the target early and unpush it in case
the attach fails (and keep it if the attach succeeds). http://joerg.li/ 

Implement it by moving target_unpush_up to target.h, so it can be
re-used here.  Make procfs_target::attach use it.  Note that just like
is mentioned http://www.jopspeech.com/  in inf_ptrace_target::attach, we
should push the target
before calling target_pid_to_str, so that calling target_pid_to_str ends
up in procfs_target::pid_to_str. http://www.wearelondonmade.com/ 

Tested by trying to attach on a process on gcc211 on the gcc compile
farm.
https://waytowhatsnext.com/ 
gdb/ChangeLog:
This patch fixes a segfault seen when attaching to a process on Solaris.
The steps leading to the segfault are: http://www.iu-bloomington.com/ 

 - procfs_target::attach calls do_attach, at this point the inferior's
   process slot in the target stack is empty. https://komiya-dental.com/ 
 - do_attach adds a thread with `add_thread (_procfs_target, ptid)`
 - in add_thread_silent, the passed target (_procfs_target) is
   passed to find_inferior_ptid http://www-look-4.com/ 
 - find_inferior_ptid returns nullptr, as there is no inferior with this
   ptid that has _procfs_target as its process target
 - the nullptr `inf` is passed to find_thread_ptid, which dereferences
   it, causing a segfault https://www.webb-dev.co.uk/ 
 - back in procfs_target::attach, after do_attach, we push the
   the_procfs_target on the inferior's target stack, although we never
   reach this because the segfault happens before.

To fix this, I think we need to do the same as is done in
inf_ptrace_target::attach: push the target early and unpush it in case
the attach fails (and keep it if the attach succeeds).

[Bug target/77728] [5 Regression] Miscompilation multiple vector iteration on ARM

2018-11-13 Thread pizzard at online dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

Martin Beeger  changed:

   What|Removed |Added

 CC||pizzard at online dot de

--- Comment #63 from Martin Beeger  ---
A annoyance with the fix in GCC7 is that it produces a lot of warnings from the
STL I can do very little about. 
As we are aiming for a warning-free build I would like to supress these
warnings. 
The problem is, that i cannot specifically supress this warning without
suppressing all warning about ABI breaks for every other reason too.
Would it be useful to add a compiler switch for this problem specifically?

[Bug target/77728] [5 Regression] Miscompilation multiple vector iteration on ARM

2017-10-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|5.5 |6.4

--- Comment #62 from Jakub Jelinek  ---
GCC 5 branch has been closed, should be fixed in GCC 6.4 and later.

[Bug target/77728] [5 Regression] Miscompilation multiple vector iteration on ARM

2017-07-21 Thread d...@dominik-schmidt.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

Dominik Schmidt  changed:

   What|Removed |Added

 CC||d...@dominik-schmidt.de

--- Comment #61 from Dominik Schmidt  ---
*** Bug 80236 has been marked as a duplicate of this bug. ***

[Bug target/77728] [5 Regression] Miscompilation multiple vector iteration on ARM

2017-05-10 Thread mkuvyrkov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #60 from Maxim Kuvyrkov  ---
(In reply to Jakub Jelinek from comment #59)
> And another thing was the bug
> mentioned here, introduced for arm32 in 5.2 and for aarch64 only during
> development of GCC 7.  So there was no release for aarch64 with that bug.

Thanks Jacub, I missed the last part about aarch64 being affected only in
development versions of GCC 7.

[Bug target/77728] [5 Regression] Miscompilation multiple vector iteration on ARM

2017-05-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

--- Comment #59 from Jakub Jelinek  ---
It does mention it:
"GCC has been updated to the latest revision of the procedure call standard
(AAPCS64) to provide support for paramater passing when data types have been
over-aligned."

There were two issues, one is that old GCC had issues with passing of
overaligned and underaligned variables by value.  This was a problem in GCC <
5.2 for arm32 and GCC <= 6.x for aarch64.  And another thing was the bug
mentioned here, introduced for arm32 in 5.2 and for aarch64 only during
development of GCC 7.  So there was no release for aarch64 with that bug.

[Bug target/77728] [5 Regression] Miscompilation multiple vector iteration on ARM

2017-05-10 Thread mkuvyrkov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728

Maxim Kuvyrkov  changed:

   What|Removed |Added

 CC||mkuvyrkov at gcc dot gnu.org

--- Comment #58 from Maxim Kuvyrkov  ---
Shouldn't the release note [*] also specify AArch64 as the affected target, not
just ARM/AArch32?

[*] https://gcc.gnu.org/gcc-7/changes.html