|
From: Ed M. <em...@ph...> - 2006-05-25 20:51:34
|
I'm trying to use Valgrind on FreeBSD (via the FreeBSD port, which seems to be a snapshot from January 10, 2004). My kernel uses the KVA_PAGES option to allocate about 1.5GB of the address space to the kernel, so userland gets only addresses up to 0xa0000000 to work with instead of 0xc0000000. Initially Valgrind exits with an error "Executable is mapped outside of range" since the stage2 part wanted to be located at 0xb8000000. I discovered the with_kickstart_base environment variable used by the configure script and set it to 0x98000000, which at least gets stage2 to load. It's now failing in the mmap in load_ELF, which ends up setting info->init_eip to an invalid address and hence crashing in the call to ume_go(). Is there any information on getting Valgrind running in such an environment? -Ed Maste |
|
From: Ed M. <em...@ph...> - 2006-05-25 21:35:07
|
On Thu, May 25, 2006 at 04:51:22PM -0400, Ed Maste wrote: > I discovered the with_kickstart_base environment variable used by the > configure script and set it to 0x98000000, which at least gets stage2 > to load. Aha, the problem was that I needed to set with_map_base as well. For the benefit of future Google searches, in order to make valgrind work in an environment where addresses 0xa0000000 and up are in kernel, I set: with_map_base=0x90000000 with_kickstart_base=0x98000000 before running configure. -Ed Maste |
|
From: Avery P. <ape...@ni...> - 2006-05-25 21:50:15
|
On Thu, May 25, 2006 at 05:35:04PM -0400, Ed Maste wrote: > On Thu, May 25, 2006 at 04:51:22PM -0400, Ed Maste wrote: > > > I discovered the with_kickstart_base environment variable used by the > > configure script and set it to 0x98000000, which at least gets stage2 > > to load. > > Aha, the problem was that I needed to set with_map_base as well. For > the benefit of future Google searches, in order to make valgrind work > in an environment where addresses 0xa0000000 and up are in kernel, I > set: > > with_map_base=0x90000000 > with_kickstart_base=0x98000000 > > before running configure. Can you make configure autodetect these settings? That would make it better for all future users. Have fun, Avery |
|
From: Ed M. <em...@ph...> - 2006-05-25 22:27:28
|
On Thu, May 25, 2006 at 05:50:09PM -0400, Avery Pennarun wrote: > On Thu, May 25, 2006 at 05:35:04PM -0400, Ed Maste wrote: > > > Aha, the problem was that I needed to set with_map_base as well. For > > the benefit of future Google searches, in order to make valgrind work > > in an environment where addresses 0xa0000000 and up are in kernel, I > > set: > > > > with_map_base=0x90000000 > > with_kickstart_base=0x98000000 > > > > before running configure. > > Can you make configure autodetect these settings? That would make it better > for all future users. That would of course be the best solution. The maximum userland address topic has come up on the list before: http://sourceforge.net/mailarchive/message.php?msg_id=5954012 The suggestion there is to look at (on FreeBSD) proc/curproc/map and deduce the maximum address based on where the kernel placed the userland's stack, but this would involve some fudging to arrive at the actual address. -Ed Maste |
|
From: Dennis L. <pla...@in...> - 2006-05-26 09:41:32
|
Am Freitag, den 26.05.2006, 09:13 +1000 schrieb Nicholas Nethercote: > On Thu, 25 May 2006, Ed Maste wrote: > > The suggestion there is to look at (on FreeBSD) proc/curproc/map and deduce > > the maximum address based on where the kernel placed the userland's stack, > > but this would involve some fudging to arrive at the actual address. > > Julian recently committed a change to load Valgrind into the first 1GB of > memory, which should hopefully avoid this problem. You can try it by > checking out the current SVN code, or waiting until 3.2.0 which should be > out soon. > 3.2.0 will have FreeBSD support? |
|
From: Nicholas N. <nj...@cs...> - 2006-05-26 14:10:10
|
On Fri, 26 May 2006, Dennis Lubert wrote: >> Julian recently committed a change to load Valgrind into the first 1GB of >> memory, which should hopefully avoid this problem. You can try it by >> checking out the current SVN code, or waiting until 3.2.0 which should be >> out soon. > > 3.2.0 will have FreeBSD support? No. Nick |
|
From: Nicholas N. <nj...@cs...> - 2006-05-25 23:13:57
|
On Thu, 25 May 2006, Ed Maste wrote: >>> Aha, the problem was that I needed to set with_map_base as well. For >>> the benefit of future Google searches, in order to make valgrind work >>> in an environment where addresses 0xa0000000 and up are in kernel, I >>> set: >>> >>> with_map_base=0x90000000 >>> with_kickstart_base=0x98000000 >>> >>> before running configure. >> >> Can you make configure autodetect these settings? That would make it better >> for all future users. > > That would of course be the best solution. > > The maximum userland address topic has come up on the list before: > http://sourceforge.net/mailarchive/message.php?msg_id=5954012 > > The suggestion there is to look at (on FreeBSD) proc/curproc/map and deduce > the maximum address based on where the kernel placed the userland's stack, > but this would involve some fudging to arrive at the actual address. Julian recently committed a change to load Valgrind into the first 1GB of memory, which should hopefully avoid this problem. You can try it by checking out the current SVN code, or waiting until 3.2.0 which should be out soon. Nick |