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

--- Comment #21 from Susi Lehtola <jussilehtola at fedoraproject dot org> ---
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 more backtrace than what I've reported above; I guess gdb
doesn't debug libgfortran intrinsics by default. The procedure I used was

$ gfortran -g -Wall readvar2.f90 
$ export HOSTNAME=
$ gdb ./a.out
(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_value
        at /tmp/readvar2.f90:17
#1  0x4012c4 in main
        at /tmp/readvar2.f90:22
[Inferior 1 (process 152269) exited with code 02]

Reply via email to