View previous topic :: View next topic |
Author |
Message |
StamK
Joined: 12 Oct 2016 Posts: 159
|
Posted: Tue Nov 21, 2017 12:01 pm Post subject: Bug with GET_STORAGE |
|
|
I am posting this in the 64bit forum although the 64bit version of GET_STORAGE works well but NOT the 32bit. The returned address is always -1 with a particular combination of calls (only in 32bit, 64bit works fine). This happens both in the 8.10 and 8.20 version
Fortran Exe -> Qt 5.6.1 MSVC 2015 DLL -> Fortran DLL
In the Fortran DLL we have the GET_STORAGE call.
Before I submit the full code to support (including Qt!), is there anything to suggest that the GET_STORAGE somehow starts from an out of bounds memory address and thinks there is no more space available?
Thanks |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7932 Location: Salford, UK
|
Posted: Tue Nov 21, 2017 1:31 pm Post subject: |
|
|
The first argument of GET_STORAGE@ should be a 32 bit integer variable for 32 bit code and a 64 bit integer variable for 64 bit code.
It should be possible to post just 2 or 3 lines of code that illustrates the way in which you are calling this routine. |
|
Back to top |
|
|
StamK
Joined: 12 Oct 2016 Posts: 159
|
Posted: Tue Nov 21, 2017 2:40 pm Post subject: |
|
|
I conveniently forgot to mention that the code works fine if run as a standalone program, it is the combination with the Qt 5.6.1 MSVC 2015 that causes this issue (and only in the 32bit world).
Code: | INTEGER(KIND=7) IA
INTEGER*4 BYTES, NB
NB = 16 * ((BYTES+15)/16)
CALL GET_STORAGE@ (IA, NB)
|
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7932 Location: Salford, UK
|
Posted: Tue Nov 21, 2017 4:14 pm Post subject: |
|
|
This looks OK to me but I don't think that you need to round up the number of bytes for GET_STORAGE@. On the face of it, it looks like you are running out of memory on the global heap.
Item 368 in cwplus.enh describes a function that may be relevant. |
|
Back to top |
|
|
|