|
From: Sami R. <sam...@un...> - 2003-05-20 08:30:39
|
Hi, I have a C++ program which requires the Matlab (www.mathworks.com) libraries to work. This is the most usual c++ program, the only thing is that it requires matlab libraries in order to read .mat files. When I use valgrind on a (ripped off) version of my program which was not linked with the matlab lib, it works. When linked with the matlab libs it does not and the following error message appears when I run valgrind on my program: ==6422== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. ==6422== Copyright (C) 2002, and GNU GPL'd, by Julian Seward. ==6422== Using valgrind-1.9.6, a program instrumentation system for x86-linux. ==6422== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward. ==6422== Estimated CPU clock rate is 2787 MHz ==6422== For more details, rerun with: -v ==6422== Table 1. block_array is currupt mwmem.c:1010: Assert : Forced Assertion "Unaligned pointer found in cache" Aborted I tried to look in the source code of valgrind for this mwmem.c file, but couldn't find it. I'm then assuming that this files comes from the matlab libraries (difficult to be sure as nm does not work on the matlab .so libs) So, is there any chance to use valgrind with programs linked with matlab libraries or not ? Sami. -- http://informatik.unibas.ch/personen/romdhani_sami/ |
|
From: Nicholas N. <nj...@ca...> - 2003-05-20 12:01:15
|
On Tue, 20 May 2003, Sami Romdhani wrote: > Table 1. block_array is currupt > mwmem.c:1010: Assert : Forced Assertion "Unaligned pointer found in > cache" > Aborted > > I tried to look in the source code of valgrind for this mwmem.c file, > but couldn't find it. I'm then assuming that this files comes from the > matlab libraries (difficult to be sure as nm does not work on the matlab > .so libs) Try running Valgrind with the --alignment=8 option... many implementations of malloc() give back 8-byte aligned pointers, Valgrind by default (legitimately) gives back 4-byte aligned pointers, and this breaks some programs. N |
|
From: Sami R. <sam...@un...> - 2003-05-20 12:35:44
|
It works ! Thanks a lot ! On Tue, 2003-05-20 at 14:00, Nicholas Nethercote wrote: > On Tue, 20 May 2003, Sami Romdhani wrote: > > > Table 1. block_array is currupt > > mwmem.c:1010: Assert : Forced Assertion "Unaligned pointer found in > > cache" > > Aborted > > > > I tried to look in the source code of valgrind for this mwmem.c file, > > but couldn't find it. I'm then assuming that this files comes from the > > matlab libraries (difficult to be sure as nm does not work on the matlab > > .so libs) > > Try running Valgrind with the --alignment=8 option... many implementations > of malloc() give back 8-byte aligned pointers, Valgrind by default > (legitimately) gives back 4-byte aligned pointers, and this breaks some > programs. > > N > -- http://informatik.unibas.ch/personen/romdhani_sami/ |
|
From: Julian S. <js...@ac...> - 2003-05-20 17:30:52
|
Matlab assumes malloc etc give 8-byte aligned blocks. You can make V do this with --alignment=8. I should put this in the FAQ I guess. J On Tuesday 20 May 2003 9:30 am, Sami Romdhani wrote: > Hi, > > I have a C++ program which requires the Matlab (www.mathworks.com) > libraries to work. This is the most usual c++ program, the only thing is > that it requires matlab libraries in order to read .mat files. > > When I use valgrind on a (ripped off) version of my program which was > not linked with the matlab lib, it works. When linked with the matlab > libs it does not and the following error message appears when I run > valgrind on my program: > > ==6422== Memcheck, a.k.a. Valgrind, a memory error detector for > x86-linux. > ==6422== Copyright (C) 2002, and GNU GPL'd, by Julian Seward. > ==6422== Using valgrind-1.9.6, a program instrumentation system for > x86-linux. > ==6422== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward. > ==6422== Estimated CPU clock rate is 2787 MHz > ==6422== For more details, rerun with: -v > ==6422== > Table 1. block_array is currupt > mwmem.c:1010: Assert : Forced Assertion "Unaligned pointer found in > cache" > Aborted > > I tried to look in the source code of valgrind for this mwmem.c file, > but couldn't find it. I'm then assuming that this files comes from the > matlab libraries (difficult to be sure as nm does not work on the matlab > .so libs) > > So, is there any chance to use valgrind with programs linked with matlab > libraries or not ? > > Sami. |