- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not sure if this deserves a bug report, but I'd like to pay attention to it here. CVF 6.6B (and 6.6A) generates a temporary copy of an ALLOCATABLE array on WRITE to a binary file. The following causes a stack overflow on WRITE:
Stack overflow does not occur if the array is static; it does not occur when the array triplet (1:1100000) is ommitted either.
(If you've downloaded XFTGDI from my web page, this will happen on XSaveBitmap for a moderately large bitmap)
Jugoslav
PROGRAM Test INTEGER(1), ALLOCATABLE:: bits(:) ALLOCATE(bits(1100000)) !INTEGER:: bits(1100000) OPEN(11,FILE="Test.bin",FORM="Binary") WRITE(11) bits(1:1100000) CLOSE(11) END PROGRAM
Stack overflow does not occur if the array is static; it does not occur when the array triplet (1:1100000) is ommitted either.
(If you've downloaded XFTGDI from my web page, this will happen on XSaveBitmap for a moderately large bitmap)
Jugoslav
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've seen that... Omitting the subscript range is, as you note, the obvious alternative. It's already on our list to look at for future improvements.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just found out the the problem also happens (in 6.6B) when doing a binary write of LARGE_STRUCTURE(1:N), even if the structure is allocated statically. Annoying!
Gabriel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An implied do-loop instead of array section is a workaround if I recall correctly.
Annoying :-(.
(I didn't test it on latest IVF though.)
Jugoslav
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page