public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Programs die when max_map_count is too large
@ 2009-11-26 15:01 Jan Engelhardt
  2009-11-26 16:16 ` Américo Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2009-11-26 15:01 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,


setting max_map_count to a value large enough results in programs dying 
at first try.
This is on 2.6.31.6.

15:59 borg:/proc/sys/vm # echo $[1<<31-1] >max_map_count 
15:59 borg:/proc/sys/vm # cat max_map_count
1073741824
15:59 borg:/proc/sys/vm # echo $[1<<31] >max_map_count 
15:59 borg:/proc/sys/vm # cat max_map_count
Killed


thanks,
Jan

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: Programs die when max_map_count is too large
@ 2009-11-26 16:48 Alexey Dobriyan
  2009-11-27  6:30 ` Américo Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2009-11-26 16:48 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: jengelh, linux-kernel

> IMO, the problem is 'sysctl_max_map_count' is actually signed int,
> while when writing to it, the value is treated as unsigned.

The problem is the loop in simple_strtoul(), some people were so afraid
to touch so they even came up with strict_* variants.

> A better fix which I could imagine is to fix sysctl to understand
> signed int's.

	-	int map_count;
	+	unsigned int map_count;

This is incomplete at least.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-27  6:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-26 15:01 Programs die when max_map_count is too large Jan Engelhardt
2009-11-26 16:16 ` Américo Wang
  -- strict thread matches above, loose matches on Subject: below --
2009-11-26 16:48 Alexey Dobriyan
2009-11-27  6:30 ` Américo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox