From owner-freebsd-questions@freebsd.org Thu Oct 17 13:05:40 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 6685D151DCF for ; Thu, 17 Oct 2019 13:05:40 +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 46v8Xz3NHnz4CB5 for ; Thu, 17 Oct 2019 13:05:38 +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 x9HD5WN5034162 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 17 Oct 2019 15:05:34 +0200 (CEST) (envelope-from ml@netfence.it) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfence.it; s=201910; t=1571317535; bh=p45JkQ+BuzzV8tCD22RrbddSfvxCq/A+0R8dbHVHggk=; h=Subject:To:References:From:Date:In-Reply-To; b=O84ma1zz9oxRutb/NeNFCE6j7BO/G7XZfgOy8kPOwAZjCQu2vjroAfTxfQyoTDM4E mAowew6SD9GWypEv1NTw6IEbtXmP84r6+DHW2RmU4sgebunNe6SvAPs554ou4NRmpr YiV9p+jsjMkyBeP6F37YjSV4Fa4XuH0WjSeockDU= 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, kpn@neutralgood.org References: From: Andrea Venturoli Message-ID: <62d45c64-ac95-43a7-5e39-9a94d26d323c@netfence.it> Date: Thu, 17 Oct 2019 15:05:32 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46v8Xz3NHnz4CB5 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netfence.it header.s=201910 header.b=O84ma1zz; 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 [-0.19 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(0.00)[netfence.it:s=201910]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(0.00)[+ip4:2.44.121.52]; 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_DN_SOME(0.00)[]; BAD_REP_POLICIES(0.10)[]; URIBL_RED(3.50)[netfence.it.multi.uribl.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[netfence.it:+]; HAS_ANON_DOMAIN(0.10)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.79)[ip: (-5.84), ipnet: 2.44.0.0/16(-2.92), asn: 30722(-0.22), 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: Thu, 17 Oct 2019 13:05:40 -0000 On 2019-10-17 13:48, MJ wrote: > Well the short answer is: You pretty well can't. :-O > If LibreOffice gets in such a tight loop processing that the kernel > can't process keyboard commands, then you've got no alternative. I thought root could always stop a user process! I wasn't logged in as root at the time, but I'll previously log in (in a VT or via SSH) next time and see if this helps. >Unless you can wait for it to stop, if it will ever stop. It won't stop (at least in about an hour, which is too much to wait anyhow). > Mucking around with settings is a waste of time until you know what's > causing the lock-up. Is it the cpu? Memory exhaustion? etc From the bars in my XFCE panel I don't think it's the CPU (BTW, this is a 4-core system). As I said, I think it's a problem with memory. In the past I've seen several "Process X was killed due to out of swap space" messages (or the like, I don't have them in sight now); why doesn't it happen in this case? > Running it virtually would seem the only quick practical approach I thought about this, but putting a virtual machine up would be a lot of work; besides, I'd like to understand and solve the problem at its root. Today it's LibreOffice; tomorrow who knows... > better still fix your program. :-) That's what I'm trying to do... but it's hard if I need to constantly reboot/fsck/etc... :-) On 2019-10-17 14:08, Kevin P. Neal wrote: > A shell script wrapper around LibreOffice to lower the ulimit just for > LibreOffice? This might be interesting. Unfortunately, "man ulimit" is useless and the handbook doesn't talk about this. I tried to gather info from a web search, but I'm still not completely sure. After I set vmemoryuse in /etc/login.conf, running "ulimit -a" shows: cpu time (seconds, -t) unlimited file size (512-blocks, -f) unlimited data seg size (kbytes, -d) 33554432 stack size (kbytes, -s) 524288 core file size (512-blocks, -c) unlimited max memory size (kbytes, -m) unlimited locked memory (kbytes, -l) 64 max user processes (-u) 12200 open files (-n) 235440 virtual mem size (kbytes, -v) 6291456 swap limit (kbytes, -w) unlimited socket buffer size (bytes, -b) unlimited pseudo-terminals (-p) unlimited kqueues (-k) unlimited umtx shared locks (-o) unlimited So I think I was able to limit virtual memory for all the processes of my user to 6GiB, but this obviously didn't help. If I issue "ulimit -v 2097152" and "ulimit -a" again, I still see the same values as above. So either "ulimit -v 2097152" did nothing or I'm not understanding it correctly... Once I solve the above, should I use -m instead of -v (or the corresponding memoryuse insetead of vmemoryuse in /etc/login.conf)? bye & Thanks av.