Bug 71046 - Unable to run CVS HEAD "Executable is mapped outside of range"
Summary: Unable to run CVS HEAD "Executable is mapped outside of range"
Status: RESOLVED WORKSFORME
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-22 16:30 UTC by Crispin Flowerday
Modified: 2004-01-21 15:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Crispin Flowerday 2003-12-22 16:30:24 UTC
While trying to run valgrind from the current CVS HEAD, I found it wouldn't run
on my system:

$ /opt/valgrind/bin/valgrind /bin/ls
Executable is mapped outside of range 0x80d3000-0xbffff000, was 0x8048000-0x8131920
failed to load /opt/valgrind/lib/valgrind/stage2: Cannot allocate memory

(I have add the "was %p-%p" to show where the mmap actually occured.)

System (debian sid): 

Linux 2.6.0 (hand compiled)
libc6 2.3.2.ds1-10 (debian package)

I you need any more information, e.g strace, I'll be happy to help.
Comment 1 Andrés Roldán 2003-12-29 15:44:29 UTC
Subject: Re:  New: Unable to run CVS HEAD "Executable is mapped
 outside of range"

I've tested this and I think it's related to a prelinked stage2 binary.

When I prelink (http://www.gentoo.org/doc/en/prelink-howto.xml) the system,
particulary /usr/lib/valgrind/stage2 (from valgrind-snapshot debian package), 
valgrind stops working.

If I undo the prelinking (prelink -u) on this file, valgrind will work again.

There may be some hardcoded address within the code of stage2 because what
prelink does is (roughly) to relocate symbols of an ELF file and hence, it 
does change the binary addresses somehow.

I don't know if this can be fixed or in the future, prelink and valgrind
cannot coexist together.

Thanks.


Crispin Flowerday <gnome@flowerday.cx> writes:

> ------- You are receiving this mail because: -------
> You are the assignee for the bug, or are watching the assignee.
>      
> http://bugs.kde.org/show_bug.cgi?id=71046     
>            Summary: Unable to run CVS HEAD "Executable is mapped outside of
>                     range"
>            Product: valgrind
>            Version: unspecified
>           Platform: unspecified
>         OS/Version: Linux
>             Status: UNCONFIRMED
>           Severity: normal
>           Priority: NOR
>          Component: general
>         AssignedTo: jseward@acm.org
>         ReportedBy: gnome@flowerday.cx
>
>
> While trying to run valgrind from the current CVS HEAD, I found it wouldn't run
> on my system:
>
> $ /opt/valgrind/bin/valgrind /bin/ls
> Executable is mapped outside of range 0x80d3000-0xbffff000, was 0x8048000-0x8131920
> failed to load /opt/valgrind/lib/valgrind/stage2: Cannot allocate memory
>
> (I have add the "was %p-%p" to show where the mmap actually occured.)
>
> System (debian sid): 
>
> Linux 2.6.0 (hand compiled)
> libc6 2.3.2.ds1-10 (debian package)
>
> I you need any more information, e.g strace, I'll be happy to help.

Comment 2 Jeremy Fitzhardinge 2003-12-29 18:34:28 UTC
Subject: Re: [Valgrind-users] Re:  New: Unable to run CVS HEAD
	"Executable is mapped outside of range"

On Mon, 2003-12-29 at 06:45, Andr
Comment 3 Jeremy Fitzhardinge 2004-01-06 01:33:36 UTC
Is this still a problem?  Is it caused by prelink, or is there something else wrong?
Comment 4 Crispin Flowerday 2004-01-06 11:02:07 UTC
Yes, this is still a problem, it fails with a completely clean build of valgrind, and although I did have the prelink program installed on my machine, I don't think I have run it in a very long time.

(Sorry for taking so long to get back, xmas hols and all that)
Comment 5 Crispin Flowerday 2004-01-16 11:07:42 UTC
Is there anything I can provide, in terms of extra information, that would help track down what the problem is here? I would really like to be able to run the CVS version (I get signal problems with 2.1.0, which are fixed in CVS).
Comment 6 Crispin Flowerday 2004-01-21 15:06:10 UTC
Ok, so I am officially confused, I did a fresh checkout of valgrind from CVS, and now it is working! The previous tree was completely up to date, so I really don't know what is going on.