Summary: | Segfault using shape intrinsic function with deferred-shape array | ||
---|---|---|---|
Product: | gcc | Reporter: | PierreC <pchwood> |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, tkoenig |
Priority: | P3 | Keywords: | wrong-code |
Version: | 4.4.1 | ||
Target Milestone: | --- | ||
Host: | x86_64 | Target: | |
Build: | Known to work: | ||
Known to fail: | 4.1.2, 4.2.1, 4.3.4, 4.4.4, 4.5.0 | Last reconfirmed: | 2010-03-27 17:59:38 |
Bug Depends on: | |||
Bug Blocks: | 32834 |
Description
PierreC
2010-03-26 11:22:49 UTC
With the function calls interchanged, the problem goes away. ie. with: write (*,*) shape(this%myarray) /= shape(array) ! SEGFAULT I can't see from the code yet why this is happening but can confirm the bug. Paul Valgrind shows: ==4509== Conditional jump or move depends on uninitialised value(s) ==4509== at 0x4EB51A3: _gfortran_shape_4 (shape_i4.c:47) ==4509== by 0x40091E: myfunc.1553 (hjfdf.f90:19) ==4509== by 0x400A87: MAIN__ (hjfdf.f90:10) ==4509== by 0x400AC2: main (hjfdf.f90:10) ==4509== ==4509== Use of uninitialised value of size 8 ==4509== at 0x4EB51E2: _gfortran_shape_4 (shape_i4.c:53) ==4509== by 0x40091E: myfunc.1553 (hjfdf.f90:19) ==4509== by 0x400A87: MAIN__ (hjfdf.f90:10) ==4509== by 0x400AC2: main (hjfdf.f90:10) ==4509== ==4509== Invalid write of size 4 ==4509== at 0x4EB51E2: _gfortran_shape_4 (shape_i4.c:53) ==4509== by 0x40091E: myfunc.1553 (hjfdf.f90:19) ==4509== by 0x400A87: MAIN__ (hjfdf.f90:10) ==4509== by 0x400AC2: main (hjfdf.f90:10) ==4509== Address 0x0 is not stack'd, malloc'd or (recently) free'd |