From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: libsigsegv? Date: Thu, 11 Sep 2014 19:49:19 +0400 Message-ID: <5411C47F.1040801@yandex.ru> References: <83r3zi8a9m.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1410450665 16236 80.91.229.3 (11 Sep 2014 15:51:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2014 15:51:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 11 17:50:59 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XS6e6-0002Lb-9U for ged-emacs-devel@m.gmane.org; Thu, 11 Sep 2014 17:50:54 +0200 Original-Received: from localhost ([::1]:39438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS6e5-0000va-SC for ged-emacs-devel@m.gmane.org; Thu, 11 Sep 2014 11:50:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS6d4-0008NK-Vp for emacs-devel@gnu.org; Thu, 11 Sep 2014 11:49:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XS6cx-0007Zq-Mt for emacs-devel@gnu.org; Thu, 11 Sep 2014 11:49:50 -0400 Original-Received: from forward5l.mail.yandex.net ([2a02:6b8:0:1819::5]:37740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS6cx-0007ZS-Am for emacs-devel@gnu.org; Thu, 11 Sep 2014 11:49:43 -0400 Original-Received: from smtp8.mail.yandex.net (smtp8.mail.yandex.net [77.88.61.54]) by forward5l.mail.yandex.net (Yandex) with ESMTP id CC794C416DC; Thu, 11 Sep 2014 19:49:39 +0400 (MSK) Original-Received: from smtp8.mail.yandex.net (localhost [127.0.0.1]) by smtp8.mail.yandex.net (Yandex) with ESMTP id 5CF431B604FD; Thu, 11 Sep 2014 19:49:39 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp8.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id N7aG6fdYWI-nTe8I1a5; Thu, 11 Sep 2014 19:49:38 +0400 (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: ee7846a8-bb5e-474c-b8f7-0231d5ef414e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1410450579; bh=GzsBEwX42HMTn/+EW+7tuwtAC77u2dTbwLhDp1reh/o=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=YjM3POQx/iEkpgnVgeHUtAsQCSE4x5fTvwOxQjNnV9XtKJLUx25QKHouMGXmO11aB 4b+e/YH1yGQmSL/7HpnFwjagEt2mnB5VjlsnH1l4RypNaispM1Bv+j3GGyIOVex453 M7Ddct0+f9IhvN5kEip4bMn2rITH6A7BqMpKBxQw= Authentication-Results: smtp8.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 In-Reply-To: <83r3zi8a9m.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a02:6b8:0:1819::5 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:174179 Archived-At: On 09/11/2014 07:08 PM, Eli Zaretskii wrote: > Apropos stack overflow protection: why not use libsigsegv if it is > available? It is capable of doing what we want (AFAICT), and supports > more platforms, including MS-Windows. 1. Stefan's mood gets worse after each new library dependency. 2. Basically libsigsegv uses the following heuristics to distinguish between stack overflow and other kinds of SIGSEGVs: a) If the fault address is near the stack pointer, it's a stack overflow. b) If the fault address is near and beyond the bottom of the stack's virtual memory area, it's a stack overflow. c) If the stack pointer is near the bottom of the stack's virtual memory area, it's a stack overflow. Currently we have only b), and this is the only thing which can be implemented staying in POSIX interfaces and without architecture-dependent tricks. a) may be implemented in a small forest of #ifdefs, and it doesn't worth using an extra library. c) is the most controversial - for example, on GNU/Linux it works by opening and reading /proc/self/maps. Do you really want to open and read file on SIGSEGV? I do not. Dmitry