-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Open
Labels
Description
Regression happens with -O0
(which is default):
$ flang 0727_0008.f90 -O0 && ./a.out
Segmentation fault (core dumped)
Passes with -O1
and higher.
Compiling with -g
and running valgrind:
$ flang 0727_0008.f90 -O0 -g && ./a.out
Segmentation fault (core dumped)
$ valgrind ./a.out
==3413688== Memcheck, a memory error detector
==3413688== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==3413688== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==3413688== Command: ./a.out
==3413688==
==3413688== Invalid read of size 2
==3413688== at 0x10ABAC: test01_ (0727_0008.f90:30)
==3413688== by 0x10A54C: _QQmain (0727_0008.f90:1)
==3413688== by 0x10CC11: main (0727_0008.f90:94)
==3413688== Address 0x1 is not stack'd, malloc'd or (recently) free'd
==3413688==
==3413688==
==3413688== Process terminating with default action of signal 11 (SIGSEGV)
==3413688== Access not within mapped region at address 0x1
==3413688== at 0x10ABAC: test01_ (0727_0008.f90:30)
==3413688== by 0x10A54C: _QQmain (0727_0008.f90:1)
==3413688== by 0x10CC11: main (0727_0008.f90:94)
==3413688== If you believe this happened as a result of a stack
==3413688== overflow in your program's main thread (unlikely but
==3413688== possible), you can try to increase the size of the
==3413688== main thread stack using the --main-stacksize= flag.
==3413688== The main thread stack size used in this run was 8388608.
==3413688==
==3413688== HEAP SUMMARY:
==3413688== in use at exit: 0 bytes in 0 blocks
==3413688== total heap usage: 2 allocs, 2 frees, 48 bytes allocated
==3413688==
==3413688== All heap blocks were freed -- no leaks are possible
==3413688==
==3413688== For lists of detected and suppressed errors, rerun with: -s
==3413688== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
From valgrind report, line 30 does this:
if (any(ib.ne.(/'12345678','12345678','12345678','12345678'/))) write(6,*) "NG"
From my experiments, this seems to be related to creating temporary array of strings to be used with any
.
Commit range:
Last good commit: 727e9f5
First known bad commit: bf51a4d
In my workspace I eventually reverted a103b9b and regression went away.
@jeanPerier , since this was your commit, assigning it to you.