From: Ian Jackson Subject: Re: Current LibXL Status Date: Thu, 18 Feb 2016 17:19:56 +0000 Message-ID: <22213.64828.978431.135803@mariner.uk.xensource.com> References: <564CC43B.1000904@ainfosec.com> <1447924858.5647.15.camel@citrix.com> <564DAA8D.5060305@citrix.com> <1447932195.5647.46.camel@citrix.com> <564DB393.3070805@citrix.com> <1447933727.5647.51.camel@citrix.com> <1447934120.5647.54.camel@citrix.com> <1447935411.5647.55.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Ian Campbell , Andrew Cooper , "xen-devel@lists.xen.org" , Martin Osterloh , Shriram Rajagopalan , Yang Hongyang List-Id: xen-devel@lists.xenproject.org George Dunlap writes ("Re: [Xen-devel] Current LibXL Status"): > So what was the conclusion here? It looks like we've confirmed that > exit() is only called: > > 1. In the case of a malloc() failure > 2. in libxl-save-helper (a separate process forked by the library) > 3. In libxl__event_disaster(), if no callback is provided 4. In other processes forked by the library But, yes,l basically. > Which just leaves #1 as something to be discussed? Is this crashing on malloc failure a problem ? >From the point of view of libxl's innards, making malloc failures fatal means that nothing that allocates memory needs to care about malloc failures. That massively reduces the number of error paths to be considered and eliminates an entire class of (largely theoretical) bugs. And often there is no good recovery possible (and logging the error is hard too). I'm not sure whether I'd want to change this policy even if someone wanted to commit to auditing libxl and submitting the necessary patches to cope with every malloc failure. Having to cope with malloc failure would be a continual burden on every proposed change or new feature. If in practice this is a problem it would probaby be better to run libxl in a process which can be restarted if it dies due to malloc failure. Ian.