From: Richard Weinberger <richard@nod.at>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: UML devel <user-mode-linux-devel@lists.sourceforge.net>,
trinity@vger.kernel.org
Subject: Re: [uml-devel] trinity commit 23dc478aba breaks syscall "mremap" at a 32 bit user mode linux
Date: Thu, 01 May 2014 22:57:34 +0200 [thread overview]
Message-ID: <5362B53E.5060601@nod.at> (raw)
In-Reply-To: <5362651A.1020504@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 5052 bytes --]
Toralf,
Am 01.05.2014 17:15, schrieb Toralf Förster:
> On 05/01/2014 02:33 PM, Richard Weinberger wrote:
>> Am 01.05.2014 12:29, schrieb Toralf Förster:
>>> On 05/01/2014 11:22 AM, Richard Weinberger wrote:
>>>> On Wed, Apr 30, 2014 at 8:19 PM, Toralf Förster <toralf.foerster@gmx.de> wrote:
>>>>> -or- it uncovers a bug in kernel v3.15-rc3 for UML:
>>>>
>>>> UML most not panic. :)
>>>>
>>>> Do you have the trinity logs?
>>>> I'd like to know the syscalls parameters.
>>> I run trinity with "-C 2 -c mremap" within the guest, the logs are attached
>>
>> Can you please try the attached pre-patch?
>> It looks like the panic() in that code is an overreaction.
>> I'm currently looking deeper in the issue.
>>
>> BTW: If you hit "BUG: failure at mm/filemap.c:202/__delete_from_page_cache()!",
>> this is a known issue https://lkml.org/lkml/2014/4/15/577
>>
>> Thanks,
>> //richard
>>
>
> That patch helps a lot, in the syslog I do now get :
>
> May 1 17:13:48 trinity kernel: Stub registers -
> May 1 17:13:48 trinity kernel: 0 - 100000
> May 1 17:13:48 trinity kernel: 1 - 2000
> May 1 17:13:48 trinity kernel: 2 - 0
> May 1 17:13:48 trinity kernel: 3 - 0
> May 1 17:13:48 trinity kernel: 4 - 0
> May 1 17:13:48 trinity kernel: 5 - 0
> May 1 17:13:48 trinity kernel: 6 - 0
> May 1 17:13:48 trinity kernel: 7 - 7b
> May 1 17:13:48 trinity kernel: 8 - 7b
> May 1 17:13:48 trinity kernel: 9 - 0
> May 1 17:13:48 trinity kernel: 10 - 33
> May 1 17:13:48 trinity kernel: 11 - ffffffff
> May 1 17:13:48 trinity kernel: 12 - 1000c3
> May 1 17:13:48 trinity kernel: 13 - 73
> May 1 17:13:48 trinity kernel: 14 - 10206
> May 1 17:13:48 trinity kernel: 15 - 101028
> May 1 17:13:48 trinity kernel: 16 - 7b
> May 1 17:13:48 trinity kernel: wait_stub_done : failed to wait for SIGTRAP, pid = 14757, n = 14757, errno = 0, status = 0xb7f
> May 1 17:13:48 trinity kernel: do_syscall_stub : ret = 0, offset = 1052680, data = 47788008
> May 1 17:13:48 trinity kernel: do_syscall_stub: syscall 91 failed, return value = 0x0, expected return value = 0x0
> May 1 17:13:48 trinity kernel: syscall parameters: 0x100000 0x2000 0x0 0x0 0x0 0x0
> May 1 17:13:48 trinity kernel: Registers -
> May 1 17:13:48 trinity kernel: 0 0x2c92
> May 1 17:13:48 trinity kernel: 1 0x13
> May 1 17:13:48 trinity kernel: 2 0x2c92
> May 1 17:13:48 trinity kernel: 3 0x2c8e
> May 1 17:13:48 trinity kernel: 4 0xbfa39508
> May 1 17:13:48 trinity kernel: 5 0xbfa394ec
> May 1 17:13:48 trinity kernel: 6 0x0
> May 1 17:13:48 trinity kernel: 7 0x7b
> May 1 17:13:48 trinity kernel: 8 0x7b
> May 1 17:13:48 trinity kernel: 9 0x0
> May 1 17:13:48 trinity kernel: 10 0x33
> May 1 17:13:48 trinity kernel: 11 0x25
> May 1 17:13:48 trinity kernel: 12 0x1000a0
> May 1 17:13:48 trinity kernel: 13 0x73
> May 1 17:13:48 trinity kernel: 14 0x246
> May 1 17:13:48 trinity kernel: 15 0xbfa394b8
> May 1 17:13:48 trinity kernel: 16 0x7b
> May 1 17:13:48 trinity kernel: do_syscall_stub : PTRACE_SETREGS failed, pid = 14757, errno = 3
> May 1 17:13:48 trinity kernel: fix_range_common: failed, killing current process
> May 1 17:13:48 trinity kernel: BUG: Bad rss-counter state mm:475aab40 idx:0 val:1
> May 1 17:13:48 trinity kernel: Stub registers -
> May 1 17:13:48 trinity kernel: 0 - 100000
> May 1 17:13:48 trinity kernel: 1 - 2000
> May 1 17:13:48 trinity kernel: 2 - 0
> May 1 17:13:48 trinity kernel: 3 - 0
> May 1 17:13:48 trinity kernel: 4 - 0
> May 1 17:13:48 trinity kernel: 5 - 0
> May 1 17:13:48 trinity kernel: 6 - 0
> May 1 17:13:48 trinity kernel: 7 - 7b
> May 1 17:13:48 trinity kernel: 8 - 7b
> May 1 17:13:48 trinity kernel: 9 - 0
> May 1 17:13:48 trinity kernel: 10 - 33
> May 1 17:13:48 trinity kernel: 11 - ffffffff
> May 1 17:13:48 trinity kernel: 12 - 1000c3
> May 1 17:13:48 trinity kernel: 13 - 73
> May 1 17:13:48 trinity kernel: 14 - 10206
> May 1 17:13:48 trinity kernel: 15 - 101028
> May 1 17:13:48 trinity kernel: 16 - 7b
> May 1 17:13:48 trinity kernel: wait_stub_done : failed to wait for SIGTRAP, pid = 14758, n = 14758, errno = 0, status = 0xb7f
> May 1 17:13:48 trinity kernel: do_syscall_stub : ret = 0, offset = 1052680, data = 477a9008
> May 1 17:13:48 trinity kernel: do_syscall_stub: syscall 91 failed, return value = 0x0, expected return value = 0x0
> May 1 17:13:48 trinity kernel: syscall parameters: 0x100000 0x2000 0x0 0x0 0x0 0x0
Yeah, this is because trinity destroys the UML stub code.
Please test the attached patch, it should fix the root cause of the problem.
Thanks,
//richard
[-- Attachment #2: fix2.patch --]
[-- Type: text/x-patch, Size: 1052 bytes --]
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 9472079..f1b3eb1 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -12,6 +12,7 @@
#include <mem_user.h>
#include <os.h>
#include <skas.h>
+#include <kern_util.h>
struct host_vm_change {
struct host_vm_op {
@@ -124,6 +125,9 @@ static int add_munmap(unsigned long addr, unsigned long len,
struct host_vm_op *last;
int ret = 0;
+ if ((addr >= STUB_START) && (addr < STUB_END))
+ return -EINVAL;
+
if (hvc->index != 0) {
last = &hvc->ops[hvc->index - 1];
if ((last->type == MUNMAP) &&
@@ -283,8 +287,11 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
/* This is not an else because ret is modified above */
if (ret) {
printk(KERN_ERR "fix_range_common: failed, killing current "
- "process\n");
+ "process: %d\n", task_tgid_vnr(current));
+ /* We are under mmap_sem, release it such that current can terminate */
+ up_write(¤t->mm->mmap_sem);
force_sig(SIGKILL, current);
+ do_signal();
}
}
[-- Attachment #3: Type: text/plain, Size: 388 bytes --]
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
[-- Attachment #4: Type: text/plain, Size: 194 bytes --]
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
WARNING: multiple messages have this Message-ID (diff)
From: Richard Weinberger <richard@nod.at>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: trinity@vger.kernel.org,
UML devel <user-mode-linux-devel@lists.sourceforge.net>
Subject: Re: [uml-devel] trinity commit 23dc478aba breaks syscall "mremap" at a 32 bit user mode linux
Date: Thu, 01 May 2014 22:57:34 +0200 [thread overview]
Message-ID: <5362B53E.5060601@nod.at> (raw)
In-Reply-To: <5362651A.1020504@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 5052 bytes --]
Toralf,
Am 01.05.2014 17:15, schrieb Toralf Förster:
> On 05/01/2014 02:33 PM, Richard Weinberger wrote:
>> Am 01.05.2014 12:29, schrieb Toralf Förster:
>>> On 05/01/2014 11:22 AM, Richard Weinberger wrote:
>>>> On Wed, Apr 30, 2014 at 8:19 PM, Toralf Förster <toralf.foerster@gmx.de> wrote:
>>>>> -or- it uncovers a bug in kernel v3.15-rc3 for UML:
>>>>
>>>> UML most not panic. :)
>>>>
>>>> Do you have the trinity logs?
>>>> I'd like to know the syscalls parameters.
>>> I run trinity with "-C 2 -c mremap" within the guest, the logs are attached
>>
>> Can you please try the attached pre-patch?
>> It looks like the panic() in that code is an overreaction.
>> I'm currently looking deeper in the issue.
>>
>> BTW: If you hit "BUG: failure at mm/filemap.c:202/__delete_from_page_cache()!",
>> this is a known issue https://lkml.org/lkml/2014/4/15/577
>>
>> Thanks,
>> //richard
>>
>
> That patch helps a lot, in the syslog I do now get :
>
> May 1 17:13:48 trinity kernel: Stub registers -
> May 1 17:13:48 trinity kernel: 0 - 100000
> May 1 17:13:48 trinity kernel: 1 - 2000
> May 1 17:13:48 trinity kernel: 2 - 0
> May 1 17:13:48 trinity kernel: 3 - 0
> May 1 17:13:48 trinity kernel: 4 - 0
> May 1 17:13:48 trinity kernel: 5 - 0
> May 1 17:13:48 trinity kernel: 6 - 0
> May 1 17:13:48 trinity kernel: 7 - 7b
> May 1 17:13:48 trinity kernel: 8 - 7b
> May 1 17:13:48 trinity kernel: 9 - 0
> May 1 17:13:48 trinity kernel: 10 - 33
> May 1 17:13:48 trinity kernel: 11 - ffffffff
> May 1 17:13:48 trinity kernel: 12 - 1000c3
> May 1 17:13:48 trinity kernel: 13 - 73
> May 1 17:13:48 trinity kernel: 14 - 10206
> May 1 17:13:48 trinity kernel: 15 - 101028
> May 1 17:13:48 trinity kernel: 16 - 7b
> May 1 17:13:48 trinity kernel: wait_stub_done : failed to wait for SIGTRAP, pid = 14757, n = 14757, errno = 0, status = 0xb7f
> May 1 17:13:48 trinity kernel: do_syscall_stub : ret = 0, offset = 1052680, data = 47788008
> May 1 17:13:48 trinity kernel: do_syscall_stub: syscall 91 failed, return value = 0x0, expected return value = 0x0
> May 1 17:13:48 trinity kernel: syscall parameters: 0x100000 0x2000 0x0 0x0 0x0 0x0
> May 1 17:13:48 trinity kernel: Registers -
> May 1 17:13:48 trinity kernel: 0 0x2c92
> May 1 17:13:48 trinity kernel: 1 0x13
> May 1 17:13:48 trinity kernel: 2 0x2c92
> May 1 17:13:48 trinity kernel: 3 0x2c8e
> May 1 17:13:48 trinity kernel: 4 0xbfa39508
> May 1 17:13:48 trinity kernel: 5 0xbfa394ec
> May 1 17:13:48 trinity kernel: 6 0x0
> May 1 17:13:48 trinity kernel: 7 0x7b
> May 1 17:13:48 trinity kernel: 8 0x7b
> May 1 17:13:48 trinity kernel: 9 0x0
> May 1 17:13:48 trinity kernel: 10 0x33
> May 1 17:13:48 trinity kernel: 11 0x25
> May 1 17:13:48 trinity kernel: 12 0x1000a0
> May 1 17:13:48 trinity kernel: 13 0x73
> May 1 17:13:48 trinity kernel: 14 0x246
> May 1 17:13:48 trinity kernel: 15 0xbfa394b8
> May 1 17:13:48 trinity kernel: 16 0x7b
> May 1 17:13:48 trinity kernel: do_syscall_stub : PTRACE_SETREGS failed, pid = 14757, errno = 3
> May 1 17:13:48 trinity kernel: fix_range_common: failed, killing current process
> May 1 17:13:48 trinity kernel: BUG: Bad rss-counter state mm:475aab40 idx:0 val:1
> May 1 17:13:48 trinity kernel: Stub registers -
> May 1 17:13:48 trinity kernel: 0 - 100000
> May 1 17:13:48 trinity kernel: 1 - 2000
> May 1 17:13:48 trinity kernel: 2 - 0
> May 1 17:13:48 trinity kernel: 3 - 0
> May 1 17:13:48 trinity kernel: 4 - 0
> May 1 17:13:48 trinity kernel: 5 - 0
> May 1 17:13:48 trinity kernel: 6 - 0
> May 1 17:13:48 trinity kernel: 7 - 7b
> May 1 17:13:48 trinity kernel: 8 - 7b
> May 1 17:13:48 trinity kernel: 9 - 0
> May 1 17:13:48 trinity kernel: 10 - 33
> May 1 17:13:48 trinity kernel: 11 - ffffffff
> May 1 17:13:48 trinity kernel: 12 - 1000c3
> May 1 17:13:48 trinity kernel: 13 - 73
> May 1 17:13:48 trinity kernel: 14 - 10206
> May 1 17:13:48 trinity kernel: 15 - 101028
> May 1 17:13:48 trinity kernel: 16 - 7b
> May 1 17:13:48 trinity kernel: wait_stub_done : failed to wait for SIGTRAP, pid = 14758, n = 14758, errno = 0, status = 0xb7f
> May 1 17:13:48 trinity kernel: do_syscall_stub : ret = 0, offset = 1052680, data = 477a9008
> May 1 17:13:48 trinity kernel: do_syscall_stub: syscall 91 failed, return value = 0x0, expected return value = 0x0
> May 1 17:13:48 trinity kernel: syscall parameters: 0x100000 0x2000 0x0 0x0 0x0 0x0
Yeah, this is because trinity destroys the UML stub code.
Please test the attached patch, it should fix the root cause of the problem.
Thanks,
//richard
[-- Attachment #2: fix2.patch --]
[-- Type: text/x-patch, Size: 1052 bytes --]
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 9472079..f1b3eb1 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -12,6 +12,7 @@
#include <mem_user.h>
#include <os.h>
#include <skas.h>
+#include <kern_util.h>
struct host_vm_change {
struct host_vm_op {
@@ -124,6 +125,9 @@ static int add_munmap(unsigned long addr, unsigned long len,
struct host_vm_op *last;
int ret = 0;
+ if ((addr >= STUB_START) && (addr < STUB_END))
+ return -EINVAL;
+
if (hvc->index != 0) {
last = &hvc->ops[hvc->index - 1];
if ((last->type == MUNMAP) &&
@@ -283,8 +287,11 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
/* This is not an else because ret is modified above */
if (ret) {
printk(KERN_ERR "fix_range_common: failed, killing current "
- "process\n");
+ "process: %d\n", task_tgid_vnr(current));
+ /* We are under mmap_sem, release it such that current can terminate */
+ up_write(¤t->mm->mmap_sem);
force_sig(SIGKILL, current);
+ do_signal();
}
}
next prev parent reply other threads:[~2014-05-01 20:57 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-30 18:19 [uml-devel] trinity commit 23dc478aba breaks syscall "mremap" at a 32 bit user mode linux Toralf Förster
2014-04-30 18:19 ` Toralf Förster
2014-05-01 9:22 ` [uml-devel] " Richard Weinberger
2014-05-01 9:22 ` Richard Weinberger
2014-05-01 10:29 ` Toralf Förster
2014-05-01 10:29 ` Toralf Förster
2014-05-01 12:33 ` Richard Weinberger
2014-05-01 12:33 ` Richard Weinberger
2014-05-01 15:15 ` Toralf Förster
2014-05-01 15:15 ` Toralf Förster
2014-05-01 20:57 ` Richard Weinberger [this message]
2014-05-01 20:57 ` Richard Weinberger
2014-05-01 21:34 ` Toralf Förster
2014-05-01 21:34 ` Toralf Förster
2014-05-02 7:21 ` Richard Weinberger
2014-05-02 7:21 ` Richard Weinberger
2014-05-02 7:46 ` Richard Weinberger
2014-05-02 7:46 ` Richard Weinberger
2014-05-02 14:07 ` Toralf Förster
2014-05-02 14:07 ` Toralf Förster
2014-05-02 14:14 ` Richard Weinberger
2014-05-02 14:14 ` Richard Weinberger
2014-07-12 17:16 ` Toralf Förster
2014-07-12 18:04 ` Richard Weinberger
2014-05-02 6:43 ` stian
2014-05-02 9:48 ` Richard Weinberger
2014-07-26 20:01 ` Toralf Förster
2014-07-26 20:07 ` Richard Weinberger
2014-07-26 21:21 ` Toralf Förster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5362B53E.5060601@nod.at \
--to=richard@nod.at \
--cc=toralf.foerster@gmx.de \
--cc=trinity@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.