Operating System - HP-UX
1833034 Members
2268 Online
110049 Solutions
New Discussion

Re: C++ application aborts abnormally, /usr/lib/dld.sl: Call to mmap() failed

 
Asim M Akath
New Member

C++ application aborts abnormally, /usr/lib/dld.sl: Call to mmap() failed

Hi All,

I have gone through the thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=389887&admit=-682735245+1179312176153+28353475

When I try to run a C++ application on my HP UX 11.0 which #includes a proprietory library, in the header file say "myapp.h" it aborts abnormally with the following message:

/usr/lib/dld.sl: Call to mmap() failed - TEXT /usr/lib/dld.sl
/usr/lib/dld.sl: Not enough space
Abort(coredump)

So, I tried writing a simple C++ hello world program, but which #include "myapp.h"

//File: a.C
#include "myapp.h"
#include
using namespace std;
int main (int argc,char* argv[])
{
cout << "Hello" << endl;
return 0;
}

I compiled with this command:
$ aCC -AA -I. +abi_3_33_compat --g0 a.C

[Note that I need to use +abi_3_33_compat to avoid this warning:
Warning 1039: "/opt/cvs/orbacus/OOC/include/JTC/ThreadGroup.h", line 20 # Type class JTCThreadGroup has a configuration of non-virtual and virtual bases that generate a vtable layout that is binary incompatible with releases A.03.33 to A.03.50. To generate a compatible layout for these releases use +abi_3_33_compat.]

When I try to run with:
$ ./a.out

/usr/lib/dld.sl: Call to mmap() failed - TEXT /usr/lib/dld.sl
/usr/lib/dld.sl: Not enough space
Abort(coredump)


-- I get the same error message.

Can anybody help in this regard?

I am sure that the library code do not have any memory leakage.

But I am surprised with my GDB output:
$ gdb a.out
HP gdb 3.3 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
....
....
(gdb) run
Starting program: /usr/local/bcp/conversion/asim/try/a.out
Hello

Program exited normally.
(gdb)


Now why did the program exit abnormally, core dumping, and when i do a gdb, I get program exited normally?

I am confused.
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: C++ application aborts abnormally, /usr/lib/dld.sl: Call to mmap() failed

dld.sl: Call to mmap() failed - TEXT /usr/lib/dld.sl

This means you are out of shared memory. James was pointing to that in your thread link.
Try listing them with "ipcs -am".

>[Note that I need to use +abi_3_33_compat to avoid this warning:

Do NOT use +abi_3_33_compat unless you need to work with existing proprietory library code compiled with the broken compiler. Instead use +W1039 to suppress the warning.

>when i do a gdb, I get program exited normally?

When you use gdb, it maps the shlib text as private and so you don't run into the out of shared memory error.
Asim M Akath
New Member

Re: C++ application aborts abnormally, /usr/lib/dld.sl: Call to mmap() failed

Thanks Dennis, for the reply.

I actually tried running ipcs -am and ipcs -b just before and after i run my executable. I couldn't find any difference.

Can you advice me in detail how to go about this?
Dennis Handly
Acclaimed Contributor

Re: C++ application aborts abnormally, /usr/lib/dld.sl: Call to mmap() failed

>I actually tried running ipcs -am and ipcs -b just before and after i run my executable. I couldn't find any difference.

It may have nothing to do with your application. The problem is in the pigs that have used up (or fragmented) all of shared memory. You need to sum up the SEGSZ fields.