[Bug debug/93380] Variable Length Array Evaluation will be wrong or cause GDB to crash due to GCC

2020-01-27 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93380

--- Comment #3 from Andrew Pinski  ---
(In reply to Robert Dumitru from comment #2)
> Hi Andrew, 
> 
> Thank you for your pointing out that. I will report the issue to ARM as well.
> However, regarding 1 and 2: 
> 
> 1. I understand this looks like a gdb bug, but my investigation pointed me
> to consider that what gdb does is correct- at least partially. It tries to
> read the memory to find the size of the array. If the memory is not
> initialised with the correct value, the size can be huge - hence - virtual
> memory exhausted bug.   
> I will try and check with a newer gdb. Maybe gdb should know the expression
> can not be evaluated before right instructions are executed? 

But there should be a limit inside GDB to know the size is most likely bogus.

[Bug debug/93380] Variable Length Array Evaluation will be wrong or cause GDB to crash due to GCC

2020-01-27 Thread robert.dumitru at cyberthorstudios dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93380

--- Comment #2 from Robert Dumitru  
---
Hi Andrew, 

Thank you for your pointing out that. I will report the issue to ARM as well.
However, regarding 1 and 2: 

1. I understand this looks like a gdb bug, but my investigation pointed me to
consider that what gdb does is correct- at least partially. It tries to read
the memory to find the size of the array. If the memory is not initialised with
the correct value, the size can be huge - hence - virtual memory exhausted bug. 
I will try and check with a newer gdb. Maybe gdb should know the expression can
not be evaluated before right instructions are executed? 

2. I checked with gcc 9.2.1 20191025 and the this still happens.

[Bug debug/93380] Variable Length Array Evaluation will be wrong or cause GDB to crash due to GCC

2020-01-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93380

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||wrong-debug
 Target|cortex a9 - Renesas RZ A1   |arm
 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2020-01-22
  Component|c++ |debug
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
Four things:
1) the GDB internal error is a GDB bug and should be reported there.  It might
be already fixed in a newer version of gdb.
2) GCC 7.x is no longer supported, can you try out a newer version of GCC like
say GCC 9.2.0?
3) Since you recieved the toolchain from ARM, please report the issue back to
them.
4) GCC 7.2.1 is a pre-release version of GCC 7.3.0.