开发者

what does for_write_seq_lis do?

开发者 https://www.devze.com 2023-01-30 07:01 出处:网络
I am debugging a Fortran 90 pr开发者_StackOverflowogram with valgrind. I get errors having this in the trace

I am debugging a Fortran 90 pr开发者_StackOverflowogram with valgrind. I get errors having this in the trace

==93929== Use of uninitialised value of size 4
==93929==    at 0x7C3D4B: for__add_to_lf_table 
==93929==    by 0x8014A8: for__open_proc.
==93929==    by 0x7C7B0F: for__open_default 
==93929==    by 0x7F3648: for_write_seq_lis 
<rest of my application backtrace>

And I don't understand if it's my mistake or simply a quirk of the internal library. I'd like to know what these functions do, and any other relevant information.

I am compiling with ifort (IFORT) 11.1 20100806, valgrind 3.6.0 on macosx.

Edit: I was able to spot occurrences of valgrind errors when the associated(ptr) intrinsic is used, or when print * is used. In any case, I am just curious to know what those routines are responsible for. What's an lf table ?


My guess would be that the symbols with names beginning for_ are defined in the run-time libraries that the program uses, probably ones provided with the Intel compiler. I expect you figured that out for yourself Stefano. What they do is obscure, other than the obvious: implement various operations of Fortran.

What have you done to track down the origins of the error which makes valgrind complain that you have used an uninitialised value ? Did you try compiling with the option -check uninit ? Have you tried the Intel source checker on the code ?

EDIT: Aha. One of the peculiarities of Fortran is that between the time it is declared and the time it is first associated with a target, a pointer does not have an association status. It is neither associated nor not associated, and calls to ASSOCIATED may produce odd results; according to the standard they should not, for example, return either .true. or .false.. This may be the source of your problem, though the other symptoms you report do not point this way.

0

精彩评论

暂无评论...
验证码 换一张
取 消