1748182 Members
3431 Online
108759 Solutions
New Discussion юеВ

"bad mmap(2)", errno 12

 
SOLVED
Go to solution
Senthil Kumar .A_1
Honored Contributor

"bad mmap(2)", errno 12

Hi Forumer's,


Please find the error message i get when the program tries to spawn another process. The process fails to fork with the following error and exits.

DM master dm_die: "bad mmap(2)", errno 12

Please could anyone throw some light on this.

Points will be aptly awarded.

Regards beyond your fathomable reach,
Senthil
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
8 REPLIES 8
Alessandro Pilati
Esteemed Contributor

Re: "bad mmap(2)", errno 12

Senthil,
when you do a fork, mmap is called to make a mapping between the new process' address space and a file.
Your error seems to indicate that the value of off+len ( 2 parameters of the function mmap ) exceeds the offset maximum established in the open file description associated with "fildes"criptor.

I'm not completely sure of this, but I think that errno 12 is EOVERFLOW error of the mmap() function ( seen man page ).

Senthil, your error is the product of a self made program?

Rgds,
Alex
if you don't try, you'll never know if you are able to
Robert-Jan Goossens_1
Honored Contributor
Solution

Re: "bad mmap(2)", errno 12

Hi Senthil,

I can't find your exact error message, but

errno 12 =

#define ENOMEM 12 /* Not enough core */
Check your swap space
# swapinfo -tam

Hope this helps,
Robert-Jan
Alessandro Pilati
Esteemed Contributor

Re: "bad mmap(2)", errno 12

Oops,
I had a doc with worng errno sequence...
Sorry Senthil, and all respect for the Olympian ;-)
if you don't try, you'll never know if you are able to
Senthil Kumar .A_1
Honored Contributor

Re: "bad mmap(2)", errno 12

Hi guys,

It would be unfair if i award points right away without check how accurate the hints were.

I will back in office by tuesday , will surely award accordingly. Thanx for your time spent on this.

Meanwhile waiting for few more responses for more options. :)
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
A. Clay Stephenson
Acclaimed Contributor

Re: "bad mmap(2)", errno 12

This is caused by 2 different things and both will set errno = 12 (ENOMEM) : 1) Hitting a kernel limit, maxdsiz (or maxdsiz_64bit) 2) more swap space is needed
If it ain't broke, I can fix that.
D Block 2
Respected Contributor

Re: "bad mmap(2)", errno 12

generally, the mmap(2) provides optimized address seeking/location of values.. some system developers love this rather than using read system call.

btw, errno == 12, then

$ grep 12 /usr/include/sys/errno.h

ex:
grep 12 /usr/include/sys/errno.h
#define ENOMEM 12 /* Not enough core */


also, read: $ man mmap

[ENOMEM] MAP_FIXED was specified, and the range [addr,
addr+len] exceeds that allowed for the address
space of a process; or if MAP_FIXED was not
specified and there is insufficient room in the
address space to effect the mapping.


--
just maybe there is a large range and it could be swap, then again, it could be some process limitations, like max stack, max data, or max text sizes in the kernel tunes.

just my 2 cents
Golf is a Good Walk Spoiled, Mark Twain.
Kent Ostby
Honored Contributor

Re: "bad mmap(2)", errno 12

This can also be an out of swap space issue.

Make sure that you have at least 2xRAM worth of device swap space.

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Senthil Kumar .A_1
Honored Contributor

Re: "bad mmap(2)", errno 12

Hi Guys,

I really appreciate all the efforts taken in this regard.

I should admit that everyone has indicated in the right direction for the issue concerned. Though I did not find any problems related to said Kernel parameter and swap size, atleast you guys affirmed me to check this system aspect to the error concerned.

Proving that I need to check on the app end. Now I'm working on the application perspective. Based on the developers suggestion have changed some app related parameter fields. Looks promising. But, eagerly awaiting for the results.

:)

Thanx once again.
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)