<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Valgrind confused by a recursive internal subroutine. in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742821#M1812</link>
    <description>It turns out that the code I am testing seems to have triggered a compiler error (I just submitted a bug report). I am getting unusual segfaults that don't make sense with idb. Maybe there is some stack corruption, which could account for Valgrind's confusion as well. I will try again later when this gets worked out.&lt;BR /&gt;</description>
    <pubDate>Thu, 28 Dec 2006 07:02:09 GMT</pubDate>
    <dc:creator>joseph-krahn</dc:creator>
    <dc:date>2006-12-28T07:02:09Z</dc:date>
    <item>
      <title>Valgrind confused by a recursive internal subroutine.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742819#M1810</link>
      <description>I found that Valgrind can get confused by an internal, recursive subroutine compiled with Intel Fortran. Apparently, these routines can have a separate stack, which Valgrind gets confused with threading. The --max-stackframe option does not fix the problem. I think the problem might be that the recursive routines can access their own stack as well as the host-associated stack, but this is just a guess. I have not yet tried to isolate a test case, or tried varying compiler options.&lt;BR /&gt;&lt;BR /&gt;Has anyone else come across this problem? Valgrind can be quite useful, so it may be worth contributing some Fortran-specific enhancements that make it better able to deal with Intel Fortran code.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Dec 2006 23:36:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742819#M1810</guid>
      <dc:creator>joseph-krahn</dc:creator>
      <dc:date>2006-12-22T23:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Valgrind confused by a recursive internal subroutine.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742820#M1811</link>
      <description>There's no separate stack involved with recursive contained procedures. There is a context block passed to the contained procedure when it is called from its host procedure.</description>
      <pubDate>Wed, 27 Dec 2006 05:07:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742820#M1811</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2006-12-27T05:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Valgrind confused by a recursive internal subroutine.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742821#M1812</link>
      <description>It turns out that the code I am testing seems to have triggered a compiler error (I just submitted a bug report). I am getting unusual segfaults that don't make sense with idb. Maybe there is some stack corruption, which could account for Valgrind's confusion as well. I will try again later when this gets worked out.&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Dec 2006 07:02:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742821#M1812</guid>
      <dc:creator>joseph-krahn</dc:creator>
      <dc:date>2006-12-28T07:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Valgrind confused by a recursive internal subroutine.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742822#M1813</link>
      <description>My problem turns out to be a stack overflow. It seems that stack consumption for each level of recursion is significantly more than I would expect just by considering memory for local variables within the recursive subroutines. It works OK with an unlimited stack size, but I am surprised that a fairly simple recursion can be such a stack hog.&lt;BR /&gt;&lt;BR /&gt;The recursive routines have one argument, an array. If I convert that array to an allocatable, I still have the stack overflow problem. If I allocate one large 2D allocatable in the main routine, the stack problem goes away, but I then have to pick a fixed recursion limit. Maybe this is because large allocations are from heap, and small ones are from the stack?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Jan 2007 07:28:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742822#M1813</guid>
      <dc:creator>joseph-krahn</dc:creator>
      <dc:date>2007-01-04T07:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Valgrind confused by a recursive internal subroutine.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742823#M1814</link>
      <description>ALLOCATEs are always from the heap. Always. It could be that an array temp is being created for an operation. Try the new -heap-arrays option and see if it helps.</description>
      <pubDate>Thu, 04 Jan 2007 09:43:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742823#M1814</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2007-01-04T09:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Valgrind confused by a recursive internal subroutine.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742824#M1815</link>
      <description>OK, it seems that local arrays and temps are the ones using up the stack.&lt;BR /&gt;&lt;BR /&gt;It would be nice if the debugger could detect stack overflows. That would have saved a lot of time. At least now I know to look for a stack overflow if a segfault is followed by strange behavior in IDB.&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Jan 2007 03:49:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742824#M1815</guid>
      <dc:creator>joseph-krahn</dc:creator>
      <dc:date>2007-01-05T03:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Valgrind confused by a recursive internal subroutine.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742825#M1816</link>
      <description>&lt;P&gt;Would I be correct in assuming that your recursive subroutine's one argument isn't an array but it is a subset of an array? e.g. the outer most level passes the whole array, the next level passes a portion of the array, the next level a portion of the portion, etc...&lt;/P&gt;
&lt;P&gt;Depending on how the array is declared and portioned out your routine may be creating stack temporaries as you slice up the array going into the recursion. A different layout or technique can often be implemented that eliminates the stack temporaries. There was (or is) supposed to be a option to generate warnings when array stack temporaries are created on call statements. Steve might be able to comment on this.&lt;/P&gt;
&lt;P&gt;There is a runtime check for arg temp creation&lt;/P&gt;
&lt;P&gt;/check:arg_temp_created&lt;/P&gt;
&lt;P&gt;But a compile time warning option would be better IMHO.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2007 06:54:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Valgrind-confused-by-a-recursive-internal-subroutine/m-p/742825#M1816</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2007-01-05T06:54:31Z</dc:date>
    </item>
  </channel>
</rss>

