Skip to contentSkip to conversation

munmap() don't check sysctl_max_mapcount

PATCH In review [email protected] 2 participants 2 messages Dec 7, 2010 – Dec 8, 2010 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH v2 1/1 munmap() don't check sysctl_max_mapcount

In reply to a message not in the archive

From http://lkml.org/lkml/2009/10/2/85:

On ia64, the following test program exit abnormally, because glibc thread library called abort().

========================================================
(gdb) bt

 #0  0xa000000000010620 in __kernel_syscall_via_break ()
 #1  0x20000000003208e0 in raise () from /lib/libc.so.6.1
 #2  0x2000000000324090 in abort () from /lib/libc.so.6.1
 #3  0x200000000027c3e0 in __deallocate_stack () from

/lib/libpthread.so.0
#4 0x200000000027f7c0 in start_thread () from /lib/libpthread.so.0 #5 0x200000000047ef60 in __clone2 () from /lib/libc.so.6.1
========================================================
The fact is, glibc call munmap() when thread exitng time for freeing stack, and it assume munlock() never fail. However, munmap() often make vma splitting and it with many mapcount make -ENOMEM.

Oh well, stack unfreeing is not reasonable option. Also munlock() via free() shouldn't failed.

Thus, munmap() shoudn't check max-mapcount.

---
v2: code cleanup

 runtest/syscalls                        |    1 +
 testcases/kernel/syscalls/mmap/Makefile |    2 +
 testcases/kernel/syscalls/mmap/mmap11.c |  144 +++++++++++++++++++++++++++++++
 3 files changed, 147 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/syscalls/mmap/mmap11.c
runtest/syscalls +1 -0
index b2bf144..1589b5f 100644
@@ -1287,3 +1287,4 @@ writev04 writev04
 writev05 writev05
 writev06 writev06
 
+mmap11 mmap11 -i 30000
\ No newline at end of file
testcases/kernel/syscalls/mmap/Makefile +2 -0
index bd617d8..68771cd 100644
@@ -21,3 +21,5 @@ top_srcdir		?= ../../../..
 include $(top_srcdir)/include/mk/testcases.mk
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
+
+LDLIBS 			+= -lpthread
\ No newline at end of file
testcases/kernel/syscalls/mmap/mmap11.c new file +144 -0

144 lines not on this page · raw message

Signature · 1 line
1.7.3.2

From http://lkml.org/lkml/2009/10/2/85:

On ia64, the following test program exit abnormally, because glibc thread library called abort().

========================================================
(gdb) bt

 #0  0xa000000000010620 in __kernel_syscall_via_break ()
 #1  0x20000000003208e0 in raise () from /lib/libc.so.6.1
 #2  0x2000000000324090 in abort () from /lib/libc.so.6.1
 #3  0x200000000027c3e0 in __deallocate_stack () from

/lib/libpthread.so.0
#4 0x200000000027f7c0 in start_thread () from /lib/libpthread.so.0 #5 0x200000000047ef60 in __clone2 () from /lib/libc.so.6.1
========================================================
The fact is, glibc call munmap() when thread exitng time for freeing stack, and it assume munlock() never fail. However, munmap() often make vma splitting and it with many mapcount make -ENOMEM.

Oh well, stack unfreeing is not reasonable option. Also munlock() via free() shouldn't failed.

Thus, munmap() shoudn't check max-mapcount.

---
v2: code cleanup

 runtest/syscalls                        |    1 +
 testcases/kernel/syscalls/mmap/Makefile |    2 +
 testcases/kernel/syscalls/mmap/mmap11.c |  144 +++++++++++++++++++++++++++++++
 3 files changed, 147 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/syscalls/mmap/mmap11.c
runtest/syscalls +1 -0
index b2bf144..1589b5f 100644
@@ -1287,3 +1287,4 @@ writev04 writev04
 writev05 writev05
 writev06 writev06
 
+mmap11 mmap11 -i 30000
\ No newline at end of file
testcases/kernel/syscalls/mmap/Makefile +2 -0
index bd617d8..68771cd 100644
@@ -21,3 +21,5 @@ top_srcdir		?= ../../../..
 include $(top_srcdir)/include/mk/testcases.mk
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
+
+LDLIBS 			+= -lpthread
\ No newline at end of file
testcases/kernel/syscalls/mmap/mmap11.c new file +144 -0

144 lines not on this page · raw message

Signature · 1 line
1.7.3.2

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 19 lines · On Mon, Dec 6, 2010 at 11:36 PM, <[email protected]> wrote:
Quoted 1 line

From http://lkml.org/lkml/2009/10/2/85:

On ia64, the following test program exit abnormally, because glibc thread library called abort().

 ========================================================
 (gdb) bt
 #0  0xa000000000010620 in __kernel_syscall_via_break ()
 #1  0x20000000003208e0 in raise () from /lib/libc.so.6.1
 #2  0x2000000000324090 in abort () from /lib/libc.so.6.1
 #3  0x200000000027c3e0 in __deallocate_stack () from /lib/libpthread.so.0
 #4  0x200000000027f7c0 in start_thread () from /lib/libpthread.so.0 #5  0x200000000047ef60 in __clone2 () from /lib/libc.so.6.1
 ========================================================
The fact is, glibc call munmap() when thread exitng time for freeing stack, and it assume munlock() never fail. However, munmap() often make vma splitting and it with many mapcount make -ENOMEM.

Quoted 4 lines

Oh well, stack unfreeing is not reasonable option. Also munlock() via free() shouldn't failed.

Thus, munmap() shoudn't check max-mapcount.

Committed.

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list