From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Undefined behavior in OS X unexec detected by ASan Date: Fri, 08 Apr 2016 11:27:34 +0300 Message-ID: <83k2k8jyix.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1460104102 24915 80.91.229.3 (8 Apr 2016 08:28:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2016 08:28:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Philipp Stephani , John Wiegley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 08 10:28:20 2016 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 1aoRm4-0002uK-Pt for ged-emacs-devel@m.gmane.org; Fri, 08 Apr 2016 10:28:16 +0200 Original-Received: from localhost ([::1]:54934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoRm0-0000sm-Q7 for ged-emacs-devel@m.gmane.org; Fri, 08 Apr 2016 04:28:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoRll-0000qp-8m for emacs-devel@gnu.org; Fri, 08 Apr 2016 04:27:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoRlk-0004p3-Ha for emacs-devel@gnu.org; Fri, 08 Apr 2016 04:27:57 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoRle-0004mG-Tu; Fri, 08 Apr 2016 04:27:50 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3917 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aoRle-0002rd-3y; Fri, 08 Apr 2016 04:27:50 -0400 In-reply-to: (message from Philipp Stephani on Sat, 02 Apr 2016 17:26:17 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:202809 Archived-At: > From: Philipp Stephani > Date: Sat, 02 Apr 2016 17:26:17 +0000 > > unexmacosx.c reads process memory directly, which tends to work in practice but is technically undefined > behavior. I've attached a small patch that uses vm_read instead. According to ASan with this patch there's no > more UB when dumping. Would someone who uses OS X please see if this patch is OK? Are there any version-related caveats here (e.g., could some older OS X version have trouble with this change)? If everything's fine with the patch, we still need to decide to which branch this should go. John?