Software Archive
Read-only legacy content

Debugger can't see values of allocatable array located in array of derived types

Jonathan_O_
Beginner
711 Views

Dear experts,

I'm developing a code and I have problems with the debugger. I have created a simple test example (attached) to illustrate the issue. 

I have a module/class that contains a derived type (doe) the derived type contains an allocatable array (x) that is allocated when the instance of the "class" is constructed. In my main program I declare an allocatable array of instances of the doe class. I allocate a number (in this case 2) instances of the doe class in the array doe1. This all works fine.

I have two sub-routines. In the first one (test_sub1) I send in only one of the instances in the array at a time. In the other one (test_sub2) I send in the entire array of instances. In the first case if I try to look at the array doe_in%x it works fine but in the second case if I try to look at the same array doe_in(1)%x  the debugger says it's an "unidentified pointer/array".

I tried calling test_sub1 from the test_sub2 to see if I could look at the array in test_sub1. This works fine. I also tried writing SHAPE(doe_in(1)%x) to see if the information needs is there and it seems to be.

I want to add that I'm fairly new to Fortran programming so what I have presented here might not be the conventional way of doing things. Please do comment if you can see a better way of doing this.

Any help on this issue would be greatly appreciated. 

Many thanks,

Jonathan

0 Kudos
10 Replies
Steven_L_Intel1
Employee
711 Views

I don't see a problem with your code and I can reproduce the problem. I am moving this to our Debugger Solutions forum where you can get help from debugger experts.

0 Kudos
Georg_Z_Intel
Employee
711 Views

Hello Jonathan,

which compiler & debugger do you use? With 15.0.2 Fortran compiler (and the provided gdb-ia) I get this:

(gdb) p doe_in(1)%x
Cannot access memory at address 0x15

Which is not exactly the same as you reported but that might be due to "dangling" pointers. I agree to Steve and think this is wrong handling in GDB. I let our debugger team take a look at this (DPD200568105) and keep you updated on the progress.

Best regards,

Georg Zitzlsberger

 

 

0 Kudos
Jonathan_O_
Beginner
711 Views

Hello Georg,

I'm using:
Microsoft Visual Studio Professional 2013 Version 12.0.31101.00 Update 4
- Intel Parallel Studio XE 2015 Composer Edition for Fortran Windows* Package ID: w_fcompxe_2015.1.148

I hope that answers your question. 

Thanks to both of you for the quick responses.

-Jonathan

 

 

 

0 Kudos
Georg_Z_Intel
Employee
711 Views

Thank you Jonathan!

I guess we have the same problem on different solutions/platforms because I was trying gdb-ia on Linux before. Nevertheless, I filed another ticket for engineering for the Fortran Evaluation Extensions (DPD200568108).

Best regards,

Georg Zitzlsberger

0 Kudos
Jonathan_O_
Beginner
711 Views

Thanks for the update.

Will there be an update in this thread if the problem is resolved or how can I find the ticket you were talking about? Also, is there a work around that I can try in the meanwhile or do you expect the problem to be resolved fairly soon?

Many thanks for your quick responses,
Jonathan

0 Kudos
Georg_Z_Intel
Employee
711 Views

Hello Jonathan!

Yes, I'll update this thread once there is some progress. The DPD* numbers can also be looked up at IDZ once they're fixed/implemented, like:
https://software.intel.com/en-us/articles/intel-composer-xe-2015-compilers-fixes-list

I've asked the debugger engineer to look for a workaround. If he can provide me one, I'll let you know. Right now I'm not confident.

Best regards,

Georg Zitzlsberger

0 Kudos
Mark_D_5
Beginner
711 Views

Hi,

are there any updates on this issue, are there possible workarounds?

Thanks

0 Kudos
Georg_Z_Intel
Employee
711 Views

Hello Jonathan!

Unfortunately there is no known workaround. Fortunately I've seen the fix being committed just today. So, the next update (Intel(R) Parallel Studio XE 2016 Update 2) should have it, if it passes validation. It'll be out sometime beginning February 2016.

Best regards,

Georg Zitzlsberger

0 Kudos
Georg_Z_Intel
Employee
711 Views

Hi all,

just FYI because it's not directly the problem of this thread:

DPD200568105 will be fixed with 17.0 (available later this year).

Best regards,

Georg Zitzlsberger

0 Kudos
de_Vicente__Angel
711 Views

Hi,

sorry to hijack the thread, but this question is somewhat similar to a question I posted yesterday. I tried twice to post it in the "Debug Solutions Users Forum", but for some reason it doesn't appear here.

I was asking about "Access to array data accessed through pointer with gdb-ia?" and the link given was https://software.intel.com/en-us/node/630366

I would be grateful if an admin can move that question to this Forum and/or let me know why I cannot post in this forum.

Thanks and apologies again,

Ángel de Vicente

0 Kudos
Reply