Re: [OMPI users] Sending string causes memory errors

2016-03-06 Thread Gilles Gouaillardet
Thanks George, is valgrind able to mark memory as read only ? i checked quickly but could not find such a feature Cheers, Gilles On 3/7/2016 11:40 AM, George Bosilca wrote: Gilles, memchecker is intended to be used together with some suppression rules. For the receive the rationale of maki

Re: [OMPI users] Sending string causes memory errors

2016-03-06 Thread George Bosilca
Gilles, memchecker is intended to be used together with some suppression rules. For the receive the rationale of making the buffer unaccessible after the unpack was to ensure that nobody is touching the memory until we return from the receive. The buffer was supposed to be made available during t

Re: [OMPI users] Sending string causes memory errors

2016-03-06 Thread Gilles Gouaillardet
Folks, Here is attached a simplified C only version of the test program. it can be ran with two or one task. on rhel7, valgrind complains about an invalid read when accessing the recv buffer after MPI_Recv. this is pretty odd since : - the buffer is initialized *before* MPI_Recv is invoked - M

Re: [OMPI users] Sending string causes memory errors

2016-03-03 Thread Gilles Gouaillardet
Something is really weird here ... right after MPI_Recv, if i if (cstr[0] != 'H') cout << "bad first character" << endl; then valgrind complains ! i rewrote the program in C, but if i use subroutines for send(), then MPI_Send fail because of a NULL communicator ... if i manually inline send(),

Re: [OMPI users] Sending string causes memory errors

2016-03-03 Thread Jeff Squyres (jsquyres)
All of those valgrind reports below are from within your code -- not from within Open MPI. All Open MPI can do is pass the contents of your message properly; you can verify that it is being sent and received properly by checking the byte contents of your received array (e.g., assert that the st

Re: [OMPI users] Sending string causes memory errors

2016-03-03 Thread Florian Lindner
Hey, Am Donnerstag, 3. März 2016, 17:50:59 CET schrieb Gilles Gouaillardet: > Florian, > > which distro are you running on ? I'm running Arch. > if you are not using stock gcc and valgrind, can you tell which version you > are running ? > last but not least, how did you configure openmpi ? ope

Re: [OMPI users] Sending string causes memory errors

2016-03-03 Thread Florian Lindner
Am Mittwoch, 2. März 2016, 16:23:02 CET schrieb Jeff Squyres (jsquyres): > There's a bunch of places in OMPI where we don't initialize memory because we > know it doesn't matter (e.g., in padding between unaligned struct members), > but then that memory is accessed when writing the entire struct

Re: [OMPI users] Sending string causes memory errors

2016-03-03 Thread Gilles Gouaillardet
Florian, which distro are you running on ? if you are not using stock gcc and valgrind, can you tell which version you are running ? last but not least, how did you configure openmpi ? Cheers, Gilles On Thursday, March 3, 2016, Florian Lindner wrote: > I am still getting errors, even with you

Re: [OMPI users] Sending string causes memory errors

2016-03-03 Thread Florian Lindner
I am still getting errors, even with your script. I will also try to modified build of openmpi that Jeff suggested. Best, Florian % mpicxx -std=c++11 -g -O0 -Wall -Wextra -fno-builtin-strlen mpi_gilles.cpp && mpirun -n 2 ./a.out Stringlength = 64 1234567890123456789012345678901234567

Re: [OMPI users] Sending string causes memory errors

2016-03-03 Thread Gilles Gouaillardet
I was unable to reproduce this in my environment. here is a slightly modified version of your test program. buffers are 64 bytes aligned and the string (including the null terminator) is 64 bytes long, hopefully, strlen will not complain any more. Cheers, Gilles On 3/3/2016 12:51 AM, Florian

Re: [OMPI users] Sending string causes memory errors

2016-03-02 Thread Jeff Squyres (jsquyres)
There's a bunch of places in OMPI where we don't initialize memory because we know it doesn't matter (e.g., in padding between unaligned struct members), but then that memory is accessed when writing the entire struct down a file descriptor or memcpy'ed elsewhere in memory...etc. It gets even w

Re: [OMPI users] Sending string causes memory errors

2016-03-02 Thread Florian Lindner
Hello Gilles, Am Mittwoch, 2. März 2016, 23:36:56 CET schrieb Gilles Gouaillardet: > Florian, > > under the hood, strlen() can use vector instructions, and then read memory > above the end of the string. valgrind is extremely picky and does warn > about that. > iirc, there are some filter options

Re: [OMPI users] Sending string causes memory errors

2016-03-02 Thread Gilles Gouaillardet
Florian, under the hood, strlen() can use vector instructions, and then read memory above the end of the string. valgrind is extremely picky and does warn about that. iirc, there are some filter options not to issue these warnings, but I forgot the details. can you try to send "Bonjour" instead o

[OMPI users] Sending string causes memory errors

2016-03-02 Thread Florian Lindner
Hello, using OpenMPI 1.10.2 and valgrind 3.11.0 I try to use the code below to send a c++ string. It works fine, but running through valgrind gives a lot of memory errors, invalid read of size... What is going wrong there? Valgrind output, see below. Thanks! Florian // Compile with: mpicxx