Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

A weird problem

A weird problem

A weird problem

This is a tricky one: I have to maintain 2 versions of an F90 code consisting of ~11000 lines. The only difference between those versions is as follows:

Main program of version A contains an IF block which checks existence or non-existence of a certain file, opens the file, reads it and checks its conten and finally closes the file again. Something like this:


ex = .false.
INQUIRE (file = installdir(1:length)//'some_file',exist=ex)
   PRINT*,' ERROR 1007: some_file missing'
   OPEN (33,FILE=installdir(1:length)//'some_file',STATUS='old',ACTION='read')
   READ (33,'(A)') TestString
   CLOSE (33)
   IF (TestString .NE. 'teststring') THEN
      PRINT*,' ERROR 1008: some_file invalid'

Now to the weird problem: Version B which does _NOT_ include the above statements crashes in a subroutine where arrays are allocated, some allocate statements return istat/=0. The above code has NOTHING to do with the array, in fact it has NOTHING to do with the remainder of the code at all.

Any help would be greatly appreciated.

RE: A weird problem

Hhhhmmm...sounds like some memory mishandling problem...when seemingly un-related issue like this one appears, it often indicates a memory mishandling, memory allocation problem...it is just that the extra code moves things around in memory so that the program behaves differently.

...you may want to compile for debugging and add some other compilation flags to look for memory leakage issues (array bounds, etc) and see what happens

...but sounds like you do have a real problem at hand

RE: A weird problem


Compiling options were not identical for both versions. The one that crashed used twice as much stack space as the one that didn't. The domain size together with the stack was too large for the 32bit environment applied.

Two more reasons for (a) the 64bit environment and (b) the Linux version of my code which fetches just as much stack space as needed ....

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close