1819931 Members
3159 Online
109607 Solutions
New Discussion юеВ

Call to mmap() failed

 
S S Babu
New Member

Call to mmap() failed

Hi,

I get an error when I tried to do a call to a Subroutine or Function and the error says Call to mmap() failed - TEXT .../.../lib12.so.2

I tried checking the Swap Space also, but it says only 37 %. I could not find any solution for this problem for a very long time. So, can some one say any suggestion.

Any help is very much appreciated.
and thanx in advance for that.

Cheers.
4 REPLIES 4
Ashwani Kashyap
Honored Contributor

Re: Call to mmap() failed

If your swap usage is not 100% then the next step to look at is memeory . Some processes might be leaking memory and not releasing the shared memory segments .
Jeff Schussele
Honored Contributor

Re: Call to mmap() failed

Hi,

I suspect you probably have a problem with one or more of the arguments on this call.
Could be the the address, length, protection or other flags.
Could be as simple as you're requesting a size that cannot be provided contigously or is larger than a kernel parm (max?siz) will allow.
Double check all the args to the call &
man 2 mmap
for further details.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
G. Vrijhoeven
Honored Contributor

Re: Call to mmap() failed

Hi,

I suspect Jeff is right and you are experiencing kernel parameter boundries.
maxdsize/maxssize/maxtsize, I think maxtsize is the one. With glance/gpm you can look into the process.

Gideon
A. Clay Stephenson
Acclaimed Contributor

Re: Call to mmap() failed

The mmap() system call can fail for several reasons. Believe it or not, nfiles or maxfiles can even trigger it or it can be a result of too small a setting for maxtsiz, maxdsiz, or maxssiz. Because you are getting -- TEXT -- I would increase maxtsiz (or maxtsiz_64bit if this is a 64-bit process). It can also be caused by incorrect permissions settings on the shared library. The real key to the problem is to capture errno -- hopefully the disciplined programmer who wrote your code bubbled that value up so that all you have to do is echo ${?} immediately after your program crashes. You then do a man 2 mmap and see what conditions can set that errno value and that should go a long way towards solving your problem.
If it ain't broke, I can fix that.