!gcc-5.2.0/gcc/fortran/data.c:181:32: runtime error: null pointer passed as argument 2, which is declared to never be null ! source line "memcpy (&dest[start], rvalue->value.character.string, len * sizeof (gfc_char_t));" ! double check with "gcc_assert(rvalue->value.character.string)" immediately before ! esay fix "if(len) memcpy (&dest[start], rvalue->value.character.string, len * ! sizeof (gfc_char_t));" !Target: x86_64-unknown-linux-gnu CHARACTER, POINTER :: PTR DATA PTR / NULL() / end
Can you please check that it has not been fixed by r229153 for pr67939 (trunk 6.0) and r229555 (5.2.1)?
Traveling now, I cannot check it.
Still in gfortran 5.3.0 /home/vitti/gcc-5.3.0/gcc/fortran/data.c:191:32: runtime error: null pointer passed as argument 2, which is declared to never be null data.c:191 "memcpy (&dest[start], rvalue->value.character.string, len * sizeof (gfc_char_t));" Maybe len==0
And in 6.1.0 ../../gcc-6.1.0/gcc/fortran/data.c:191:32: runtime error: null pointer passed as argument 2, which is declared to never be null
Still in trunk: ../../gcc7/gcc/fortran/data.c:191:32: runtime error: null pointer passed as argument 2, which is declared to never be null here: memcpy (&dest[start], rvalue->value.character.string, len * sizeof (gfc_char_t)); Probably len==0 and preponing an if(len) should do the trick
I cannot reproduce this PR even with an instrumented compiler. How do you get the error?
Traveling now, back home end of March. Did you check the value of variable "len" maybe it's zero so it's not really a bug.
Just back from my travel. The sanitizer error message disappeared on trunk level 246252.