Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761555AbcLPOx6 (ORCPT ); Fri, 16 Dec 2016 09:53:58 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:32830 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761037AbcLPOxt (ORCPT ); Fri, 16 Dec 2016 09:53:49 -0500 Subject: Re: crash during oom reaper To: Michal Hocko References: <20161216082202.21044-1-vegard.nossum@oracle.com> <20161216082202.21044-4-vegard.nossum@oracle.com> <20161216090157.GA13940@dhcp22.suse.cz> <20161216101113.GE13940@dhcp22.suse.cz> <20161216140043.GN13940@dhcp22.suse.cz> <2d65449b-5f8a-7a29-e879-9c27bd1d4537@oracle.com> <20161216143235.GO13940@dhcp22.suse.cz> Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Rik van Riel , Matthew Wilcox , Peter Zijlstra , Andrew Morton , Al Viro , Ingo Molnar , Linus Torvalds From: Vegard Nossum Message-ID: <53b709f5-c560-a8ae-616f-cc7a64ff536c@oracle.com> Date: Fri, 16 Dec 2016 15:53:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161216143235.GO13940@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2398 Lines: 65 On 12/16/2016 03:32 PM, Michal Hocko wrote: > On Fri 16-12-16 15:25:27, Vegard Nossum wrote: >> On 12/16/2016 03:00 PM, Michal Hocko wrote: >>> On Fri 16-12-16 14:14:17, Vegard Nossum wrote: >>> [...] >>>> Out of memory: Kill process 1650 (trinity-main) score 90 or sacrifice child >>>> Killed process 1724 (trinity-c14) total-vm:37280kB, anon-rss:236kB, >>>> file-rss:112kB, shmem-rss:112kB >>>> BUG: unable to handle kernel NULL pointer dereference at 00000000000001e8 >>>> IP: [] copy_process.part.41+0x2150/0x5580 >>>> PGD c001067 PUD c000067 >>>> PMD 0 >>>> Oops: 0002 [#1] PREEMPT SMP KASAN >>>> Dumping ftrace buffer: >>>> (ftrace buffer empty) >>>> CPU: 28 PID: 1650 Comm: trinity-main Not tainted 4.9.0-rc6+ #317 >>> >>> Hmm, so this was the oom victim initially but we have decided to kill >>> its child 1724 instead. >>> >>>> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS >>>> Ubuntu-1.8.2-1ubuntu1 04/01/2014 >>>> task: ffff88000f9bc440 task.stack: ffff88000c778000 >>>> RIP: 0010:[] [] >>>> copy_process.part.41+0x2150/0x5580 >>> >>> Could you match this to the kernel source please? >> >> kernel/fork.c:629 dup_mmap() > > Ok, so this is before the child is made visible so the oom reaper > couldn't have seen it. > >> it's atomic_dec(&inode->i_writecount), it matches up with >> file_inode(file) == NULL: >> >> (gdb) p &((struct inode *)0)->i_writecount >> $1 = (atomic_t *) 0x1e8 > > is this a p9 inode? When I looked at this before it always crashed in this spot for the very first VMA in the mm (which happens to be the exe, which is on a 9p root fs). I added a trace_printk() to dup_mmap() to print inode->i_sb->s_type and the last thing I see for a new crash in the same place is: trinity--9280 28.... 136345090us : copy_process.part.41: ffffffff8485ec40 --------------------------------- CPU: 0 PID: 9302 Comm: trinity-c0 Not tainted 4.9.0-rc8+ #332 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 task: ffff880000070000 task.stack: ffff8800099e0000 RIP: 0010:[] [] copy_process.part.41+0x22c9/0x55b0 As you can see, the addresses match: (gdb) p &v9fs_fs_type $1 = (struct file_system_type *) 0xffffffff8485ec40 So I think we can safely say that yes, it's a p9 inode. Vegard