From owner-freebsd-questions@freebsd.org Fri Oct 18 12:31:38 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E8AE14F8E1 for ; Fri, 18 Oct 2019 12:31:38 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.netfence.it (net-2-44-121-52.cust.vodafonedsl.it [2.44.121.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mailserver.netfence.it", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46vllF5kfXz4W9b for ; Fri, 18 Oct 2019 12:31:37 +0000 (UTC) (envelope-from ml@netfence.it) Received: from alamar.ventu (alamar.local.netfence.it [10.1.2.18]) (authenticated bits=0) by soth.netfence.it (8.15.2/8.15.2) with ESMTPSA id x9ICVXQI068303 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 18 Oct 2019 14:31:35 +0200 (CEST) (envelope-from ml@netfence.it) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfence.it; s=201910; t=1571401895; bh=x7ahEfqDMjdi+uuTOpuBX8DAy64PieTAw7AMlTxfThQ=; h=Subject:To:References:From:Date:In-Reply-To; b=AzbE4mY5ykqi+JXU7/2QLAXcQaOdx+FqOUzZrlt3EK27+lU+4xxqO7sjQaH+8VHOk t5lmy85JUnvKfyxm6MezlBnh/2dniBkcxTfrmV/Z+i6J5VHQP6yBEcSOAqifRmvfld oFv/yTYHwvgx6KGAn7FCRbzH/YyIhi0zr6fpxhA8= X-Authentication-Warning: soth.netfence.it: Host alamar.local.netfence.it [10.1.2.18] claimed to be alamar.ventu Subject: Re: Avoiding LibreOffice DOS To: MJ , freebsd-questions@freebsd.org References: <62d45c64-ac95-43a7-5e39-9a94d26d323c@netfence.it> <96a4c0a3-9b48-3cf4-27a6-8d3753b42d87@gmail.com> From: Andrea Venturoli Message-ID: Date: Fri, 18 Oct 2019 14:31:33 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <96a4c0a3-9b48-3cf4-27a6-8d3753b42d87@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46vllF5kfXz4W9b X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netfence.it header.s=201910 header.b=AzbE4mY5; dmarc=none; spf=pass (mx1.freebsd.org: domain of ml@netfence.it designates 2.44.121.52 as permitted sender) smtp.mailfrom=ml@netfence.it X-Spamd-Result: default: False [-4.40 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[netfence.it:s=201910]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:2.44.121.52:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[netfence.it]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[netfence.it:+]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.90)[ip: (-6.11), ipnet: 2.44.0.0/16(-3.06), asn: 30722(-0.36), country: IT(0.03)]; ASN(0.00)[asn:30722, ipnet:2.44.0.0/16, country:IT]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2019 12:31:38 -0000 On 2019-10-17 23:59, MJ wrote: >> As I said, I think it's a problem with memory. > > Oh did you? I saw you mention "vmemoryuse" but didn't understand whether > you meant this was the cause or just an attempt to fix one cause. Sorry, maybe I should have made this clearer. > If it is memory related, perhaps you need to create a larger swap space. > It might just get you over the hump of exhausting memory enough for > Libreoffice to complete whatever it is it's trying to do. My guess is that it will use as much as it's available. > Conjecture? There's a tight loop. Possibly/likely a bug in libreoffice? Possibly, but, as I said, I'm trying to approach this from an OS perspective as a general case. This time it was LibreOffice, but I was also able to reproduce this with different applications (e.g. remove swap, fire up a couple of VirtualBox VMs to eat most memory, open several pages in FireFox). > Is the keyboard/mouse responsive at all? Depends. Sometimes it is: moving the mouse (slowly) moves the pointer. Switching to a VT console works, I can enter the username, but then it'll get stuck before the password prompt. Other times no input device seems to work. > So this is a UFS system? Yes. What difference does it make? Apart from limiting the ARC size in case I need virtual machines, I mean. > As to ulimit, I'm not sure it will have the affect you desire. You could > ulimit -v YOUR_VALUE; exec your_program and try. > > Have you considered using a login class - create a new user, give them > fixed resource limits (like you tried on your own account?) and run > within that user domain? > > Set the stacksize small. I'll try. > However, I'm not sure what this achieves. All you will do is run the > program until it encounters the bug, then it will die because of > resource exhaustion (best case) and so what have you achieved? That's exactly what I'm trying to achieve: have the memory hog program killed, without the need to hard-reset the system, so saving all the rest. bye & Thanks av.