Skip to contentSkip to conversation

Fix formatting signal name in tst_strstatus()

PATCH New Martin Doucha 3 participants 6 messages Sep 24, 2020 – Sep 25, 2020 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Fix formatting signal name in tst_strstatus()

---
 lib/tst_status.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/tst_status.c +2 -1
index f1affeac5..9124faaa3 100644
@@ -20,7 +20,8 @@ const char *exited(int status)
 
 const char *signaled(int status)
 {
-	snprintf(buf, sizeof(buf), "killed by %s", tst_strsig(status));
+	snprintf(buf, sizeof(buf), "killed by %s",
+		tst_strsig(WTERMSIG(status)));
 
 	return buf;
 }
Signature · 1 line
2.28.0
#1 lore raw

PATCH 2/2 mmap18: Increase minimal stack mapping to 8KB

The first testcase keeps segfaulting on older kernels with only 4KB initial stack mapping

---

Note: Increasing initial stack size to 8KB fixes the segfaults but I'm not entirely sure whether we shouldn't use PTHREAD_STACK_MIN as the minimal size instead. Pthread man page isn't entirely clear whether PTHREAD_STACK_MIN is the minimal value for stack size after it grows to the limit, or the minimal size of the initial stack mapping (before it starts growing).

On x86_64, PTHREAD_STACK_MIN is 4 pages (16KB). On PPC64, it's 2 pages (128KB).

 testcases/kernel/syscalls/mmap/mmap18.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/mmap/mmap18.c +3 -2
index 966bf673e..8b149fb93 100644
@@ -201,10 +201,11 @@ static void grow_stack_fail(size_t stack_size, size_t mapped_size)
 static void run_test(void)
 {
 	size_t stack_size = 8 * PTHREAD_STACK_MIN;
+	size_t minsize = MAX(page_size, 8192);
 
-	grow_stack_success(stack_size, page_size);
+	grow_stack_success(stack_size, minsize);
 	grow_stack_success(stack_size, stack_size/2);
-	grow_stack_fail(stack_size, page_size);
+	grow_stack_fail(stack_size, minsize);
 	grow_stack_fail(stack_size, stack_size/2);
 }
 
Signature · 1 line
2.28.0
#2 lore raw

PATCH 2/2 mmap18: Increase minimal stack mapping to 8KB

Quoted 5 lines · Martin Doucha

The first testcase keeps segfaulting on older kernels with only 4KB initial stack mapping

Quoted 11 lines

---

Note: Increasing initial stack size to 8KB fixes the segfaults but I'm not entirely sure whether we shouldn't use PTHREAD_STACK_MIN as the minimal size
instead. Pthread man page isn't entirely clear whether PTHREAD_STACK_MIN is
the minimal value for stack size after it grows to the limit, or the minimal
size of the initial stack mapping (before it starts growing).

I slightly think the latter, which means PTHREAD_STACK_MIN is the minimal size of the initial stack mapping. So maybe better to use the PTHREAD_STACK_MIN
as mmaped_size, we even don't need to have a MAX() there.

Quoted 36 lines

On x86_64, PTHREAD_STACK_MIN is 4 pages (16KB). On PPC64, it's 2 pages (128KB).

 testcases/kernel/syscalls/mmap/mmap18.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/mmap/mmap18.c +3 -3
index 966bf673e..8b149fb93 100644
@@ -201,10 +201,11 @@ static void grow_stack_fail(size_t stack_size,
 size_t mapped_size)
 static void run_test(void)
 {
        size_t stack_size = 8 * PTHREAD_STACK_MIN;
+       size_t minsize = MAX(page_size, 8192);
 
-       grow_stack_success(stack_size, page_size);
+       grow_stack_success(stack_size, minsize);
        grow_stack_success(stack_size, stack_size/2);
-       grow_stack_fail(stack_size, page_size);
+       grow_stack_fail(stack_size, minsize);
        grow_stack_fail(stack_size, stack_size/2);
 }
 
--

2.28.0

--
Mailing list info: https://lists.linux.it/listinfo/ltp

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200925/9be3da58/attachment.htm>
#3 lore raw

PATCH 2/2 mmap18: Increase minimal stack mapping to 8KB

In reply to Martin Doucha

Hi!

Quoted 11 lines

The first testcase keeps segfaulting on older kernels with only 4KB initial stack mapping

---

Note: Increasing initial stack size to 8KB fixes the segfaults but I'm not entirely sure whether we shouldn't use PTHREAD_STACK_MIN as the minimal size instead. Pthread man page isn't entirely clear whether PTHREAD_STACK_MIN is the minimal value for stack size after it grows to the limit, or the minimal size of the initial stack mapping (before it starts growing).

I vote for passing down PTHREAD_STACK_MIN for the initial mapping.

Quoted 30 lines

On x86_64, PTHREAD_STACK_MIN is 4 pages (16KB). On PPC64, it's 2 pages (128KB).

 testcases/kernel/syscalls/mmap/mmap18.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/mmap/mmap18.c +3 -2
index 966bf673e..8b149fb93 100644
@@ -201,10 +201,11 @@ static void grow_stack_fail(size_t stack_size, size_t mapped_size)
 static void run_test(void)
 {
 	size_t stack_size = 8 * PTHREAD_STACK_MIN;
+	size_t minsize = MAX(page_size, 8192);
 
-	grow_stack_success(stack_size, page_size);
+	grow_stack_success(stack_size, minsize);
 	grow_stack_success(stack_size, stack_size/2);
-	grow_stack_fail(stack_size, page_size);
+	grow_stack_fail(stack_size, minsize);
 	grow_stack_fail(stack_size, stack_size/2);
 }
 
Signature · 5 lines
2.28.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 2 lines
Cyril Hrubis
[email protected]
#4 lore raw

PATCH 1/2 Fix formatting signal name in tst_strstatus()

In reply to Martin Doucha
Quoted 2 lines · Martin Doucha
Quoted 26 lines
---
 lib/tst_status.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/tst_status.c +2 -2
index f1affeac5..9124faaa3 100644
@@ -20,7 +20,8 @@ const char *exited(int status)
 
 const char *signaled(int status)
 {
-       snprintf(buf, sizeof(buf), "killed by %s", tst_strsig(status));
+       snprintf(buf, sizeof(buf), "killed by %s",
+               tst_strsig(WTERMSIG(status)));
 
        return buf;
 }
--

2.28.0

--
Mailing list info: https://lists.linux.it/listinfo/ltp

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200925/f5923914/attachment.htm>