This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51972] New: [OOP] ALLOCATE misses memset/calloc, causing segfault
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Jan 2012 17:36:34 +0000
- Subject: [Bug fortran/51972] New: [OOP] ALLOCATE misses memset/calloc, causing segfault
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51972
Bug #: 51972
Summary: [OOP] ALLOCATE misses memset/calloc, causing segfault
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
Created attachment 26435
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26435
Test case
The test case is a reduced version of chapter07/strategy_surrogate_f2003,
available from http://www.cambridge.org/rouson under "Resources available".
When compiling and running the program, one might get:
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
#6 0x400AC5 in __lorenz_module_MOD___copy_lorenz_module_Lorenz at
test.F90:42
#7 0x401392 in __runge_kutta_2nd_module_MOD_integrate at test.F90:73
#8 0x40153F in MAIN__ at test.F90:84
And with valgrind:
Conditional jump or move depends on uninitialised value(s)
at 0x400AD8: __lorenz_module_MOD___copy_lorenz_module_Lorenz (test.F90:42)
by 0x4013B2: __runge_kutta_2nd_module_MOD_integrate (test.F90:73)
The issue is that there is MEMSET or CALLOC missing in "integrate". There is a
call to memset in "constructor" and "assign_lorenz".