[Bug fortran/96486] get_environment_variable crashes for environment variables that are empty strings

2020-08-08 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #28 from Susi Lehtola --- Harald, Andreas, thanks for clarifying: yes, "crash" == Fortran runtime error. The program should run just fine, since the return array has the proper size given by get_environment_variable. Instead, it ends

[Bug fortran/96486] get_environment_variable crashes for environment variables that are empty strings

2020-08-07 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #23 from Susi Lehtola --- The expected result is that the program does not crash, since a zero-size character array is enough to fit an empty string.

[Bug fortran/96486] get_environment_variable crashes for environment variables that are empty strings

2020-08-07 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 Susi Lehtola changed: What|Removed |Added Summary|get_environment_variable|get_environment_variable

[Bug fortran/96486] get_environment_variable fails for zero-length values

2020-08-07 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #21 from Susi Lehtola --- to repeat: libgfortran crashes when you try to read an environment variable that is an empty string, in the case you have preallocated an array that is the proper size i.e. zero characters. I don't get any m

[Bug fortran/96486] get_environment_variable fails for zero-length values

2020-08-07 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #19 from Susi Lehtola --- (In reply to Steve Kargl from comment #17) > On Thu, Aug 06, 2020 at 08:33:12PM +0000, jussilehtola at fedoraproject dot > org wrote: > > https://gcc.gnu.org/bugzilla/show_bug.

[Bug fortran/96486] get_environment_variable fails for zero-length values

2020-08-06 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #16 from Susi Lehtola --- Yes, then I installed missing libgfortran debuginfos and the backtrace shortened to #0 0x401267 in zerolen_value at /tmp/readvar2.f90:17 #1 0x4012c4 in main at /tmp/readvar2.f90:22

[Bug fortran/96486] get_environment_variable fails for zero-length values

2020-08-06 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #13 from Susi Lehtola --- The gdb output is the same (gdb) r Starting program: /tmp/a.out Fortran runtime error: Zero-length string passed as value to get_environment_variable. Error termination. Backtrace: #0 0x401267 in zerolen_

[Bug fortran/96486] get_environment_variable fails for zero-length values

2020-08-05 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #10 from Susi Lehtola --- Compiled with -g, rerun gives $ ./a.out Fortran runtime error: Zero-length string passed as value to get_environment_variable. Error termination. Backtrace: #0 0x401267 in zerolen_value at /tmp/re

[Bug fortran/96486] get_environment_variable fails for zero-length values

2020-08-05 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #8 from Susi Lehtola --- (In reply to kargl from comment #5) > What gfortran version and operating system? I get > > % gfcx -o z b.f90 && ./z > STOP System variable unassigned > % gfcx -o z -g b.f90 && ./z > STOP System variable una

[Bug fortran/96486] get_environment_variable fails for zero-length values

2020-08-05 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #4 from Susi Lehtola --- $ export HOSTNAME=foo $ ./a.out $ $ export HOSTNAME= $ ./a.out Fortran runtime error: Zero-length string passed as value to get_environment_variable. Error termination. Backtrace: #0 0x7f25c93aadf1 in ???

[Bug fortran/96486] get_environment_variable fails for zero-length values

2020-08-05 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486 --- Comment #3 from Susi Lehtola --- program zerolen_value implicit none character(len=*), parameter :: name='HOSTNAME' character(len=:), allocatable :: value integer :: l, err call get_environment_variable(name,length=l,status=err) i

[Bug fortran/96486] New: get_environment_variable fails for zero-length variables

2020-08-05 Thread jussilehtola at fedoraproject dot org
Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jussilehtola at fedoraproject dot org Target Milestone: --- get_environment_variable checks for zero-length value strings before it checks the length of the result string. In the case of

[Bug ipa/60871] [4.9 Regression] internal compiler error: in possible_polymorphic_call_targets, at ipa-devirt.c:1510

2015-03-02 Thread jussilehtola at fedoraproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60871 Susi Lehtola changed: What|Removed |Added CC||jussilehtola@fedoraproject.