[mvapich-discuss] RE: mpirun_rsh: Unable to get host entry

Mark Debbage mark.debbage at qlogic.com
Thu Jan 5 14:36:59 EST 2012


Here's an example showing compiler options that break this idiom. For your
information, the MVAPICH2 binaries in stock RHEL 6.2 are compiled this way and
have this problem.

[markdebbage at rock 121450]$ cat sillysprintf.c
#include <stdio.h>
#include <string.h>

int main()
{
  char s[1000];
  strcpy(s, "hello");
  sprintf(s, "%s, world\n", s);
  printf(s);
}

[markdebbage at rock 121450]$ gcc -O3 -Wp,-D_FORTIFY_SOURCE=2 sillysprintf.c -o
sillysprintf
[markdebbage at rock 121450]$ ./sillysprintf
, world

[markdebbage at rock 121450]$ gcc sillysprintf.c -o sillysprintf

[markdebbage at rock 121450]$ ./sillysprintf
hello, world

Mark.

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.




More information about the mvapich-discuss mailing list