|
| View previous topic :: View next topic |
| Author |
Message |
Arjan
Joined: 10 Apr 2006 Posts: 71 Location: Bilthoven, The Netherlands
|
Posted: Mon May 21, 2007 7:35 am Post subject: Program crashes at integer-assignment |
|
|
Hi!
My program crashes and I try to debug it in pgdbg. All makefiles have flag -g to generate debug info and flag -C for arraybound checking.
At the point in the subroutine where the program crashes, I try to pass the value of integer KTSTEP (with INTENT(IN) and entering the subroutine with value 6) to integer MTSTEP (with INTENT(OUT)). The "Locals" window from pgdbg shows that, just before the crash, indeed KTSTEP has the value 6. Concerning MTSTEP the "Locals" window is less optimistic:
mtstep = ERROR: cannot read value at address 0x4.
My impression is that this message in the "Locals" window reflects that (not surprisingly) INTENT(OUT)-variable MTSTEP has not been initialized. Then comes my program statement:
MTSTEP = KTSTEP
Stepping over this statement generates a crash with message:
! Signalled SIGSEV at 0x80889b9, function puf_initio, file puf_initio.f90, line 115
Can someone please hint me how to proceed? Can I set stronger compilation-flags for all sorts of checks? Does the fact that the "Locals" window told me about MTSTEP that "ERROR: cannot read value at address 0x4" contain a non-trivial message? If so, what can I do?
Thanks for any suggestion,
Regards,
Arjan |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 5001 Location: The Portland Group Inc.
|
Posted: Mon May 21, 2007 10:13 am Post subject: |
|
|
Hi Arjan,
If mtstep was unitialized, then the debugger would still print out a value, albeit garbage. My best guess is that you have an argument mismatch between the caller and callee, and MTSTEP doesn't have an associated caller variable. If this is indeed the case, then the best way to avoid this common error is to add interfaces for your rountines. This way the compiler can check for argument mismatches.
- Mat |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|