On Sunday 13 March 2011 12:15:07 Jason wrote:
> On Friday 11 March 2011 11:46:09 Cactus wrote:
> > On Mar 9, 12:35 am, Fredrik Johansson <fredrik.johans...@gmail.com>
> > 
> > wrote:
> > > Hi,
> > > 
> > > On my system, valgrind detects an invalid read in mpn_mul when the
> > > operands have certain sizes. For example, it happens when both operand
> > > lengths are 2601 limbs. I'm attaching a test .c program and valgrind
> > > output.
> > > 
> > > I just re-ran "make check" to be sure no MPIR tests were failing.
> > > System is an Intel Pentium T4400, 64 bit Ubuntu, and MPIR compile
> > > flags included "-O2 -m64 -march=core2 -mtune=core2"
> > > 
> > > Fredrik
> > > 
> > >  vlog.txt
> > > 
> > > 5KViewDownload
> > > 
> > >  mpnbug.c
> > > 
> > > < 1KViewDownload
> > 
> > Valgrind doesn't run on Windows so I cannot look into these issues.
> > 
> > But I have tried to use nedmalloc - a respected third party memoory
> > allocator - with MPIR on Windows and it too reports bad allocations
> > somewhere in large multiplies.
> > 
> > Is anyone who works on Linux going to look into this?
> > 
> >     Brian
> 
> I'll give it a go , and see what I can come up with
> 
> Jason

The clue is in the "Invalid read of size 8" it's not a bug , it's by design. 
The core2 code uses SSE for the copyi.asm and if the copy is on an =8 mod 16 
byte boundary then it is safe to read 8 bytes before (SSE requires 16 byte 
alignment) , there is no way to get a segfault as the extra 8 bytes must 
always be in the same page.To check it just delete the copyi.asm file and the 
errors go away. I dont really know valgrind , is there a way to set the byte 
granularity to 16 bytes?


Jason

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to 
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.

Reply via email to