|
From: Tom H. <to...@co...> - 2005-03-20 14:52:37
|
In message <loo...@po...>
Benny Cheung <bwl...@gm...> wrote:
> I am trying to use the latest stable version of Valgrind to debug
> my parallel program, which tends to use quite a lot of (virtual)
> memory. The 0x60000000 - 0x90000000 region is allocated using mmap().
How do you know what address the region will be mapped at? If you're
trying to use MAP_FIXED to force it then be aware that valgrind will
fail attempts to map memory at some high addresses as only part of the
address space is available for your program - some is reserved for
valgrind to use.
> My program works to finish for a small problem size without invoking
> the debugger, but having problems on large problem size. However,
> when Valgrind is invoked, I get this error no matter the problem size
> is small or large:
>
> ==21397== TRANSLATE: 0x2129C1D0 redirected to 0x2112C68C
> ==21397== TRANSLATE: 0x1B8E4C30 redirected to 0x52BFF040
> start
> ==21397== TRANSLATE: 0x21295080 redirected to 0x2112CCBC
> The file has 4 lines
> ==21397== TRANSLATE: 0x21295200 redirected to 0x2112D1E8
> ID is 0
> ID 0: Hostname is GD033A
> rsh -l benny GD034A "./sor1022 dsmid 1 port 17767 " &
> rsh -l benny GD035A "./sor1022 dsmid 2 port 17767 " &
> rsh -l benny GD036A "./sor1022 dsmid 3 port 17767 " &
> ==21397==
> ==21397== Process terminating with default action of signal 11 (SIGSEGV)
> ==21397== Bad permissions for mapped region at address 0x1B8E9444
> ==21397== at 0x80548B6: comm_init() (dsmcomm.cpp:903)
> ==21397== by 0x8049405: main (dsminit-sor.cpp:121)
> =
>
> The faulting statement is just an initialization of some array structures:
>
> for (i = 0; i < BUFFSLOT; i++)
> multbuff[i].ref = 0;
>
> At running this statement, the region 0x60000000 - 0x90000000 has not been
> mmap() yet.
>
> I'd like to ask is the address 0x1B8E9444 relocated to some place after
> 0x52BFF040 and then got the error? How to avoid this problem, and is it
> possible to manually instruct address redirection destination?
What makes you think 0x1B8E9444 is relocated? As far as I can see
valgrind is saing that your programs tried to write to that location
but that it was mapped read-only.
If you're talking about the TRANSLATE line for 0x1B8E4C30 then that
is a function intercept and is nothing to do with any data access in
your program.
You need to look at how/when multibuff is allocated and what sort of
memory it is pointing at.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|