<div dir="ltr">Dominik,<br><br>On Wednesday, March 9, 2016 at 2:55:05 AM UTC-6, Dominik Mierzejewski wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi, Eric.
<br>
<br>On Tuesday, 08 March 2016 at 22:48, Eric Hermes wrote:
<br>[...]
<br>> This is why I am trying to build the cp2k_shell binaries in the first
<br>> place. Unfortunately, I cannot get cp2k_shell to run at all, let alone
<br>> within the framework of ASE. The problem is that the binary produces a
<br>> buffer overflow when run by itself with no arguments.
<br>
<br>Please try compiling with debugging information included (with gcc it's
<br>enough to add -g to compiler flags, but I don't know the equivalent
<br>for Intel compiler). Then, run the binary under gdb and post the output
<br>of 'where' command once it crashes.
<br>
<br>Regards,
<br>Dominik
<br>--
<br>Fedora <a href="http://fedoraproject.org/wiki/User:Rathann" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Ffedoraproject.org%2Fwiki%2FUser%3ARathann\46sa\75D\46sntz\0751\46usg\75AFQjCNEVbJI8uIQZqQ5a2A32BKj2MsEvQg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Ffedoraproject.org%2Fwiki%2FUser%3ARathann\46sa\75D\46sntz\0751\46usg\75AFQjCNEVbJI8uIQZqQ5a2A32BKj2MsEvQg';return true;">http://fedoraproject.org/wiki/<wbr>User:Rathann</a>
<br>RPMFusion <a href="http://rpmfusion.org" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Frpmfusion.org\46sa\75D\46sntz\0751\46usg\75AFQjCNGuXI6q1gR3iH1rL6kQDvuA2gqJwQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Frpmfusion.org\46sa\75D\46sntz\0751\46usg\75AFQjCNGuXI6q1gR3iH1rL6kQDvuA2gqJwQ';return true;">http://rpmfusion.org</a>
<br>"Faith manages."
<br> -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"
<br></blockquote><div> </div><div>Slight correction to my previous post: the compiled executable does not result in a buffer overflow when it is run by itself, but only when it is run with mpirun. I have tried compiling CP2K with both mvapich2-2.2b and openmpi-1.10.2, and the buffer overflow happens for both of these MPI implementations. Since it only crashes when run with mpirun, and I do not know how to debug an MPI process with gdb (since it crashes immediately, I can't exactly attach gdb to the process once it's running), I don't think I can easily debug the process with gdb.</div><div><br></div><div>That said, I did try compiling CP2K with the Intel compiler debugging options enabled. What this showed was that any attempt to print or write to the screen was what was causing the buffer overflow. Specifically, it points to line 185 in cp2k_shell.f90, which after preprocessing looks like this:<br></div><div><br></div><div><div class="prettyprint" style="border: 1px solid rgb(187, 187, 187); word-wrap: break-word; background-color: rgb(250, 250, 250);"><code class="prettyprint"><div class="subprettyprint"><div class="subprettyprint"> DO</div><div class="subprettyprint"> IF (para_env%mepos==para_env%source) THEN</div><div class="subprettyprint"> WRITE (sout,'("* READY")')</div><div class="subprettyprint"> CALL m_flush(sout)</div><div class="subprettyprint"> END IF</div></div></code></div><div><br></div>Line 185 is the one that contains the WRITE statement. I attempted debugging this issue by placing a simple 'print *, "Hello"' line above this on line 183, and after recompiling cp2k_shell.o and relinking cp2k_shell.popt, the resulting buffer overflow occurs at line 183 instead, with "Hello" not having been printed to the screen. I also tried explicitly writing to unit 6 with 'write (6, *) "Hello"', and this results in the same error.</div><div><br></div><div>Eric Hermes<br><br></div></div>