From owner-freebsd-current@FreeBSD.ORG Tue Mar 17 00:09:21 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9548E106566B for ; Tue, 17 Mar 2009 00:09:21 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-fx0-f158.google.com (mail-fx0-f158.google.com [209.85.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id E29148FC1E for ; Tue, 17 Mar 2009 00:09:20 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: by fxm2 with SMTP id 2so3576868fxm.43 for ; Mon, 16 Mar 2009 17:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=tG4vYU7MJIjavnx36swkFpkHh48jPbBRju2MPq7UOHE=; b=Drk6V5V+i6EtGMMko8v+GRDoyt3ZkG9uFXutcJln0LqZt1Ui0SUoRAzIb6o6HBD2Rh vNXmePrLwrbWxJeRlWFNHSr6QYyOPm3G2ek7DbEBZ82phZo8jIcKsVBC2VlEBbnDGIr2 ApQNRtyZdHZNK4KHJdYZM1CrdgQmIjW6Ekt0w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=JIzf7SC9hc6bLvkHFfzS5xrwZESEV8UIepAmXljvUpJfSLoFHMUOLdMDFVc1EnsQ7K YL8Dt/DINALWl6WT5X6BY1m1OMU9JdU9KAqboLBXMdy3EiGaj/9UtFAtPjXhPD7PVK/n KxKJRyAP8OOqtMuh9Bewvi6qDierERZms2JNg= Received: by 10.103.49.12 with SMTP id b12mr2459972muk.98.1237248559750; Mon, 16 Mar 2009 17:09:19 -0700 (PDT) Received: from localhost (95-24-69-29.broadband.corbina.ru [95.24.69.29]) by mx.google.com with ESMTPS id e9sm11811080muf.38.2009.03.16.17.09.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 16 Mar 2009 17:09:18 -0700 (PDT) From: Anonymous To: Kostik Belousov References: <864oxtuzct.fsf@gmail.com> <20090316194541.GO41617@deviant.kiev.zoral.com.ua> <86ljr5p3f0.fsf@gmail.com> <20090316215205.GS41617@deviant.kiev.zoral.com.ua> Date: Tue, 17 Mar 2009 03:09:09 +0300 In-Reply-To: <20090316215205.GS41617@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Mon, 16 Mar 2009 23:52:05 +0200") Message-ID: <868wn5qaca.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-current@freebsd.org, dchagin@freebsd.org Subject: Re: lang/sbcl consumes all available memory and dies X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2009 00:09:30 -0000 Kostik Belousov writes: > On Tue, Mar 17, 2009 at 12:24:03AM +0300, Anonymous wrote: >> Kostik Belousov writes: >> >> > On Mon, Mar 16, 2009 at 08:55:14PM +0300, Anonymous wrote: >> >> I noticed that after commit r189771 (ELF: .note.ABI-tag) sbcl >> >> starts to eat all memory until it dies from bus error never reaching >> >> REPL. The process is unkillable, too. >> >> >> >> $ sbcl >> >> This is SBCL 1.0.25, an implementation of ANSI Common Lisp. >> >> More information about SBCL is available at . >> >> >> >> SBCL is free software, provided as is, with absolutely no warranty. >> >> It is mostly in the public domain; some portions are provided under >> >> BSD-style licenses. See the CREDITS and COPYING files in the >> >> distribution for more information. >> >> load: 0.06 cmd: sbcl 1926 [running] 0.01u 0.44s 3% 189432k >> >> load: 0.06 cmd: sbcl 1926 [tx->tx_quiesce_done_cv)] 0.01u 0.72s 5% 367124k >> >> load: 0.78 cmd: sbcl 1926 [running] 0.01u 2.91s 14% 1763028k >> >> load: 0.72 cmd: sbcl 1926 [tx->tx_quiesce_done_cv)] 0.01u 3.65s 14% 2237272k >> >> load: 0.74 cmd: sbcl 1926 [*vm page queue mutex] 0.01u 5.78s 9% 3482892k >> >> zsh: bus error (core dumped) sbcl >> >> >> >> This is amd64, r189876M, zfs, 4g mem, 4g swap, sbcl 1.0.17, sbcl-1.0.25, >> >> 1.0.26.3. I can reproduce it under qemu with clean environment as well. >> >> >> >> Can somebody confirm it on i386? Just run `sbcl' and exit from REPL by >> >> either `^D' or `(quit)'. >> >> >> >> The workaround is to reverse-apply diff from r189771. >> > >> > I think the D-state is due to quite large vm address space of the lisp, >> > that takes a long time to dump. >> > For the start, can you confirm that setting sysctl >> > machdep.prot_fault_translation to 2 solves your problem ? >> >> Yep, machdep.prot_fault_translation=2 solves it on my main amd64 box and >> in qemu-amd64. Anything else? > > Please, try this patch. > > diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c > index f2bdcf5..5604ea5 100644 > --- a/sys/kern/imgact_elf.c > +++ b/sys/kern/imgact_elf.c > @@ -1330,14 +1330,14 @@ __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote, > int32_t *osrel) > { > const Elf_Note *note, *note_end; > - const Elf32_Phdr *phdr, *pnote; > - const Elf32_Ehdr *hdr; > + const Elf_Phdr *phdr, *pnote; > + const Elf_Ehdr *hdr; > const char *note_name; > int i; > > pnote = NULL; > - hdr = (const Elf32_Ehdr *)imgp->image_header; > - phdr = (const Elf32_Phdr *)(imgp->image_header + hdr->e_phoff); > + hdr = (const Elf_Ehdr *)imgp->image_header; > + phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); > > for (i = 0; i < hdr->e_phnum; i++) { > if (phdr[i].p_type == PT_NOTE) { Double-checked on more recent revision (r189900) under qemu-amd64 with/without the patch. The problem disappears. Don't know about i386, though.