- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get a status code of 151 and the array comes back with a size but with all elements showing undefined address. Only happens if /Qtrapuv is on. Can produce heap corruption warning too with more variables allocated.
UsingVS2005 SP1,Intel Fortran 10.1.0.24, Windows XP64 SP2
program
BugTestAutomaticArray implicit none integer status real*4, allocatable, automatic :: a(:) allocate(a(10), stat = status)a = 1.0
end
programI don't normally use automatic but it was an experiment to see why I am getting problems with OpenMP with random results after many weeks of debugging. OpenMPsets all local variables as automatic butin this case I don't get the allocation error but I do get some strange initial values.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thankyoufor your quick reponse.
Have you fixed theinitial failure to allocate or just the garbage after a failure ? Hopefully the first bug.
I agea it is good practice to check the status after alloactions but this code was intended to crash, so not checking in this case helped to ensure it did!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page