Re: mmap problem - HP UX

This is a discussion on Re: mmap problem - HP UX ; gelbeiche wrote: > I wrote a small C++ program, compiled it with aCC. > The program aborts with the following error: > > /usr/lib/dld.sl: Call to mmap() failed - TEXT /usr/lib/libCsup_v2.2 > /usr/lib/dld.sl: Permission denied > Abort(coredump) > > The ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: mmap problem

  1. Re: mmap problem

    gelbeiche wrote:
    > I wrote a small C++ program, compiled it with aCC.
    > The program aborts with the following error:
    >
    > /usr/lib/dld.sl: Call to mmap() failed - TEXT /usr/lib/libCsup_v2.2
    > /usr/lib/dld.sl: Permission denied
    > Abort(coredump)
    >
    > The permissions of libCsup_v2.2 are
    > -rw-rw-rw- 1 bea bea 217088 Sep 25 2002 /usr/lib/libCsup_v2.2
    >
    > Is the executable flag required for memory mapping ?
    > If yes why ?


    Given that this is a Shared Library, and dld was trying to
    map at least part of it as TEXT (from above), I have to assume
    that if you tusc this, you'll see that the mapping was done
    with PROT_EXECUTE (as you'd expect for a shared library text
    segment). And yes, if you map with PROT_EXECUTE the underlying
    file must be executable from the point of view of the file
    system. As to why -- well, why would you want to let people
    arbitrarily map in binaries and execute them when they don't
    have executable permission on the underlying file in the
    first place?

    > Does it mean libCsup_v2.2 was wrong installed ?


    I would imagine so -- it certainly shows as
    -r-xr-xr-x on the systems I have access to.

    > Where do I find a description of this library ?


    http://docs.hp.com/en/5185-4304/ch13s06.html

    Don

    >
    > Enough questions ;-) for now.


  2. Re: mmap problem

    Don Morris writes:

    > gelbeiche wrote:
    > > I wrote a small C++ program, compiled it with aCC.
    > > The program aborts with the following error:
    > > /usr/lib/dld.sl: Call to mmap() failed - TEXT /usr/lib/libCsup_v2.2
    > > /usr/lib/dld.sl: Permission denied
    > > Abort(coredump)
    > > The permissions of libCsup_v2.2 are
    > > -rw-rw-rw- 1 bea bea 217088 Sep 25 2002 /usr/lib/libCsup_v2.2
    > > Is the executable flag required for memory mapping ?
    > > If yes why ?

    >
    > Given that this is a Shared Library, and dld was trying to
    > map at least part of it as TEXT (from above), I have to assume
    > that if you tusc this, you'll see that the mapping was done
    > with PROT_EXECUTE (as you'd expect for a shared library text
    > segment). And yes, if you map with PROT_EXECUTE the underlying
    > file must be executable from the point of view of the file
    > system.

    I read the mmap man page and found your statement confirmed.
    I could not change the permissions by my self but had to
    ask a admin. He changed it to r-xr-xr-x and the program
    does not longer crash.
    However I thought the lib is installed by sam as depot file
    and I wondered *how* a lib can have wrong permissions.
    I do not think that someone changed the permissions manually
    to rw-rw-rw.

    > As to why -- well, why would you want to let people
    > arbitrarily map in binaries and execute them when they don't
    > have executable permission on the underlying file in the
    > first place?
    >
    > > Does it mean libCsup_v2.2 was wrong installed ?

    >
    > I would imagine so -- it certainly shows as
    > -r-xr-xr-x on the systems I have access to.
    >
    > > Where do I find a description of this library ?

    >
    > http://docs.hp.com/en/5185-4304/ch13s06.html
    >

    Really good link, thx.

+ Reply to Thread