[mpich-discuss] buffer overflow

Md. Amjad Hossain mhossai2 at kent.edu
Mon Oct 27 20:24:15 CDT 2014


Thanks. I found the problem and solved.

On Mon, Oct 27, 2014 at 7:49 PM, <discuss-request at mpich.org> wrote:

> Send discuss mailing list submissions to
>         discuss at mpich.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.mpich.org/mailman/listinfo/discuss
> or, via email, send a message with subject or body 'help' to
>         discuss-request at mpich.org
>
> You can reach the person managing the list at
>         discuss-owner at mpich.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of discuss digest..."
>
>
> Today's Topics:
>
>    1. Re:  buffer overflow (Seo, Sangmin)
>    2. Re:  MPI process killed and SIGUSR1 (Wesley Bland)
>    3.  Problems in MPICH 3.1.3 installation in OSX 10.10        with ifort
>       compiler and Xcode 6.1 (Alejandro de la Calle)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 27 Oct 2014 12:52:13 +0000
> From: "Seo, Sangmin" <sseo at anl.gov>
> To: "<discuss at mpich.org>" <discuss at mpich.org>
> Subject: Re: [mpich-discuss] buffer overflow
> Message-ID: <7F837F15-3997-4DD9-9A36-915D94358C95 at anl.gov>
> Content-Type: text/plain; charset="Windows-1252"
>
> Hi Amjad,
>
> As the error message, "25 bytes received but buffer size is 24?, says,
> your buffer size is smaller than the message size. You need to increase
> your buffer which is the memory pointed to by the first argument of
> MPI_Recv.
>
> Best regards,
> Sangmin
>
>
> On Oct 27, 2014, at 12:27 AM, Md. Amjad Hossain <mhossai2 at kent.edu> wrote:
>
> > Hi,
> >
> > I am sending and receiving a user defined (struct) data type using
> MPI_Send and MPI_Recv function. I am getting following buffer overflow
> error.
> >
> > Fatal error in MPI_Recv: Message truncated, error stack:
> > MPI_Recv(187).....................: MPI_Recv(buf=0x7fff2248b930,
> count=1, dtype=USER<struct>, src=0, tag=1, MPI_COMM_WORLD,
> status=0x7fff2248b970) failed
> > MPIDI_CH3U_Receive_data_found(131): Message from rank 0 and tag 1
> truncated; 25 bytes received but buffer size is 24
> >
> >
> > If I just send one byte less, everything is working properly. Could
> anyone please let me know which buffer it is and how can I increase the
> buffer size to avoid the error?
> >
> > Regards
> > Amjad
> > _______________________________________________
> > discuss mailing list     discuss at mpich.org
> > To manage subscription options or unsubscribe:
> > https://lists.mpich.org/mailman/listinfo/discuss
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 27 Oct 2014 09:50:14 -0500
> From: Wesley Bland <wbland at anl.gov>
> To: "discuss at mpich.org" <discuss at mpich.org>
> Subject: Re: [mpich-discuss] MPI process killed and SIGUSR1
> Message-ID: <1468A5AA-0D18-4ED9-9CEF-4D6625D6564C at anl.gov>
> Content-Type: text/plain; charset="utf-8"
>
> Is this still related to your FT problems or is this a separate problem?
>
> Thanks,
> Wesley
>
> > On Oct 27, 2014, at 6:52 AM, Roy, Hirak <Hirak_Roy at mentor.com> wrote:
> >
> > Hi Wesley,
> >
> > Here is my server.c and client.c.
> > I have explicitly added ?assert(0);? in client.c.
> > However my receive hangs in server and does not complete.
> >
> > Could you please enlighten on this more.
> >
> > Thanks,
> > Hirak
> >
> >
> > #include <sys/types.h>
> > #include <unistd.h>
> > #include "mpi.h"
> > #include <stdio.h>
> > #include <assert.h>
> > #include <stdlib.h>
> > #include <fcntl.h>
> >
> >
> > int main (int argc, char* argv[])
> > {
> >
> >   MPI_Init (&argc, &argv);
> >   MPI_Errhandler_set(MPI_COMM_WORLD,MPI_ERRORS_RETURN);
> >
> >   char portname[MPI_MAX_PORT_NAME];
> >   MPI_Open_port(MPI_INFO_NULL, portname);
> >   MPI_Publish_name("RandomSession", MPI_INFO_NULL, portname);
> >   printf ("Successfully published portname : %s\n", portname);
> >   MPI_Comm newComm ;
> >   MPI_Comm_accept (portname, MPI_INFO_NULL, 0, MPI_COMM_SELF, &newComm);
> >   printf ("Successfully connected to client\n");
> >   MPI_Errhandler_set(newComm, MPI_ERRORS_RETURN);
> >
> >   printf ("Waiting on receive\n");
> >   int val = 0 ;
> >   MPI_Status status;
> >   int errcode = MPI_Recv(&val, 1, MPI_INT, 0, 99, newComm, &status);
> >   int errclass ;
> >   MPI_Error_class(errcode, &errclass);
> >   if (errclass == MPI_SUCCESS) {
> >     printf ("Received a message with tag 99\n");
> >     MPI_Comm_disconnect (&newComm);
> >     printf ("Disconnected client\n");
> >   } else {
> >     printf ("Receive error\n");
> >   }
> >
> >
> >   MPI_Unpublish_name("RandomSession", MPI_INFO_NULL, portname);
> >   MPI_Close_port(portname);
> >   MPI_Finalize();
> >
> > }
> >
> >
> > #include <sys/types.h>
> > #include <unistd.h>
> > #include "mpi.h"
> > #include <stdio.h>
> > #include <assert.h>
> > #include <stdlib.h>
> > #include <fcntl.h>
> >
> >
> > int main (int argc, char* argv[])
> > {
> >   MPI_Init (&argc, &argv);
> >   MPI_Errhandler_set(MPI_COMM_WORLD,MPI_ERRORS_RETURN);
> >
> >   char portname[MPI_MAX_PORT_NAME];
> >   if (MPI_Lookup_name("RandomSession", MPI_INFO_NULL, portname) ==
> MPI_SUCCESS) {
> >     printf ("Successfully got portname : %s\n", portname);
> >     MPI_Comm newComm ;
> >     MPI_Comm_connect (portname, MPI_INFO_NULL, 0, MPI_COMM_SELF,
> &newComm);
> >     printf ("Successfully connected to server\n");
> >     MPI_Errhandler_set(newComm, MPI_ERRORS_RETURN);
> >
> >     assert (0);
> >     int val = 0 ;
> >     MPI_Send(&val, 1, MPI_INT, 0, 99, newComm);
> >     printf ("Send a message with tag 99\n");
> >     MPI_Comm_disconnect (&newComm);
> >     printf ("Disconnected client\n");
> >   }
> >   MPI_Finalize();
> > }
> > MPICH Version:        3.0.4
> > MPICH Release date:   Wed Apr 24 10:08:10 CDT 2013
> > MPICH Device:         ch3:sock
> > MPICH configure:      --prefix
> /home/jlevitt/local/mpich-3.0.4/linux_x86_64 --disable-f77 --disable-fc
> --disable-f90modules --disable-cxx --enable-fast=nochkmsg
> --enable-fast=notiming --enable-fast=ndebug --enable-fast=O3
> --with-device=ch3:sock CFLAGS=-O3 -fPIC CXXFLAGS=-O3 -fPIC
> > MPICH CC: /u/prod/gnu/gcc/20121129/gcc-4.5.0-linux_x86_64/bin/gcc -O3
> -fPIC   -O3
> > MPICH CXX:      no -O3 -fPIC
> > MPICH F77:      no
> > MPICH FC: no
> > _______________________________________________
> > discuss mailing list     discuss at mpich.org <mailto:discuss at mpich.org>
> > To manage subscription options or unsubscribe:
> > https://lists.mpich.org/mailman/listinfo/discuss <
> https://lists.mpich.org/mailman/listinfo/discuss>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mpich.org/pipermail/discuss/attachments/20141027/84de5126/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Mon, 27 Oct 2014 23:49:30 +0000
> From: Alejandro de la Calle <alejandrodelacallenegro at gmail.com>
> To: discuss at mpich.org
> Subject: [mpich-discuss] Problems in MPICH 3.1.3 installation in OSX
>         10.10   with ifort compiler and Xcode 6.1
> Message-ID: <24999AA0-4FFA-4798-AD22-4571F0F9884C at gmail.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi there,
>
> I am trying to build mpich 3.1.3. in a Mac OSX 10.10 Yosemite with Xcode
> 6.1 and intel compilers icc and ifort version 15.0.0 20140716. I get an
> error when I am building the installation. The error is the following:
>
>  GEN      lib/libpmpi.la
> ifort: command line warning #10006: ignoring unknown option
> '-force_load,src/mpl/.libs/libmpl.a'
> ifort: command line warning #10006: ignoring unknown option
> '-force_load,/Users/alejandrodelacallenegro/Downloads/mpich-3.1.3/src/openpa/src/.libs/libopa.a'
> ifort: command line warning #10006: ignoring unknown option
> '-force_load,src/mpi/romio/.libs/libpromio.a'
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
> object: lib/.libs/libpmpi.a(initthread.o) malformed object (section
> contents at offset 0 with a size of 1056, overlaps Mach-O headers at offset
> 0 with a size of 768)
>
> I do not understand where the error come from, from the compiler or from
> libtool. I have also attached the outputs of the configuration and the
> build steps.
>
> Thanks for your time,
>
> Alex
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: configuration.txt
> URL: <
> http://lists.mpich.org/pipermail/discuss/attachments/20141027/3e1e9143/attachment.txt
> >
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: make.txt
> URL: <
> http://lists.mpich.org/pipermail/discuss/attachments/20141027/3e1e9143/attachment-0001.txt
> >
>
> ------------------------------
>
> _______________________________________________
> discuss mailing list
> discuss at mpich.org
> https://lists.mpich.org/mailman/listinfo/discuss
>
> End of discuss Digest, Vol 24, Issue 32
> ***************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20141027/8db8d44c/attachment.html>
-------------- next part --------------
_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list