From owner-freebsd-questions@freebsd.org Thu Oct 17 22:00:14 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 22B7D15EAF3 for ; Thu, 17 Oct 2019 22:00:14 +0000 (UTC) (envelope-from mafsys1234@gmail.com) Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46vNPn0vGdz3JDb for ; Thu, 17 Oct 2019 22:00:12 +0000 (UTC) (envelope-from mafsys1234@gmail.com) Received: by mail-pf1-x42f.google.com with SMTP id a2so2480309pfo.10 for ; Thu, 17 Oct 2019 15:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=nDFUJEONoEITilqU+gDtyDENJ2dhHRo2t3yhbG/6ni8=; b=e7Z2sAKmEjh/956b9demjFNQ4YQvtNdVjnpy2l//A1c9rd/0yf6C/WI9om2Hm8qN9j 0+/hyPh1kKOx74ZscYcEsNAIxLSB0n7xWcDQjB8kkXzfc9y8DP/i/FLykm0Chm6JFGqu u2PSeoDGkAylx/4s0LOBe4uVXKPKHWnD9lBO2IXcxQzISBDUvXF2AkdfW51dWvf+unjw Na4JasnyKBmlJHjGtVCJXIQDLXtoPlIY3p/TOt5U4y8e0kb5T7rSiOeeXrLL+JlMUvW9 e2LyCZNuNCVQAVtLiAn1dlvoqhaUeT3nJzvg9n79d7o4Ye9KwR+v1mF2gNatprXNCHiI 4KRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=nDFUJEONoEITilqU+gDtyDENJ2dhHRo2t3yhbG/6ni8=; b=SXKOPzZPcyei1fTjrJpPkBM0cQiXMeFgkJDUZFXuPzjRdWWwVRMuVgzVwAU9djW02i 9rNOiJ7gSpCsVhigp0ezmt93THpv08XYOCRwt4OmJuF+EPMJL8OvUsDw/979q4T2sY/G klElwziBhpZxCQ2t5P1cxbDARZGfQcTDCwV86VFvSI9hKR6G1BqSPmYcGywM3SWrq9TO XM/wTJxnd6wRh1Yr7xwCe/87mSowjRpaNwIbz89wqHfgZbfd0Z8xZxziMmg7DvFSGk3K dXcKWqK5v2sLhs54jVTI/SM8BdNQ+5NogvV081WeaM91Xm7rCzVf3cvKlZkEAVoQYSEw 2GkA== X-Gm-Message-State: APjAAAWyZrroejF0RGzM7ZJjwaQw/2ZZULpDaxn1iMbxY4QTaT7Jr+6o uAAwxs4eq7Q5K1aS4awuDalM2SfT X-Google-Smtp-Source: APXvYqzYGbqIbaf+3rEWP88WueuH060c8MZNv5sxVjhWMYVaNVqzFPxcAMqQrpAmfukP3yBbPyT6wQ== X-Received: by 2002:a63:8ac8:: with SMTP id y191mr6510995pgd.324.1571349610804; Thu, 17 Oct 2019 15:00:10 -0700 (PDT) Received: from [192.168.1.10] (C-59-101-161-221.mel.connect.net.au. [59.101.161.221]) by smtp.gmail.com with ESMTPSA id p24sm6463859pgc.72.2019.10.17.15.00.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Oct 2019 15:00:10 -0700 (PDT) Subject: Re: Avoiding LibreOffice DOS To: freebsd-questions@freebsd.org References: <62d45c64-ac95-43a7-5e39-9a94d26d323c@netfence.it> From: MJ Message-ID: <96a4c0a3-9b48-3cf4-27a6-8d3753b42d87@gmail.com> Date: Fri, 18 Oct 2019 08:59:43 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <62d45c64-ac95-43a7-5e39-9a94d26d323c@netfence.it> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 46vNPn0vGdz3JDb X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=e7Z2sAKm; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mafsys1234@gmail.com designates 2607:f8b0:4864:20::42f as permitted sender) smtp.mailfrom=mafsys1234@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[221.161.101.59.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.00)[ip: (-8.89), ipnet: 2607:f8b0::/32(-2.47), asn: 15169(-2.10), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[f.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] 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 22:00:14 -0000 On 18/10/2019 12:05 am, Andrea Venturoli wrote: > 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! Of course. > 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. 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. 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. > > 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? Conjecture? There's a tight loop. Possibly/likely a bug in libreoffice? Is the keyboard/mouse responsive at all? > > > >> 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... > Understandable. > > >> 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... :-) So this is a UFS system? 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. 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? Cheers Mark