From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#18885: 25.0.50; build fails with ASan enabled Date: Wed, 29 Oct 2014 11:31:17 -0400 Message-ID: <87r3xqevui.fsf@udel.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414596764 4829 80.91.229.3 (29 Oct 2014 15:32:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2014 15:32:44 +0000 (UTC) To: 18885@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 29 16:32:37 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1XjVEh-0005wv-AH for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Oct 2014 16:32:35 +0100 Original-Received: from localhost ([::1]:46896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVEg-0002Xd-Us for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Oct 2014 11:32:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVEK-000293-CB for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:32:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjVEA-0003Ht-GK for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:32:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVEA-0003Hj-Dd for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XjVE9-0003KL-R6 for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Oct 2014 15:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18885 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141459671512771 (code B ref -1); Wed, 29 Oct 2014 15:32:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Oct 2014 15:31:55 +0000 Original-Received: from localhost ([127.0.0.1]:38924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjVE2-0003Js-76 for submit@debbugs.gnu.org; Wed, 29 Oct 2014 11:31:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35143) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjVDy-0003Jc-JL for submit@debbugs.gnu.org; Wed, 29 Oct 2014 11:31:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjVDj-00035k-Ak for submit@debbugs.gnu.org; Wed, 29 Oct 2014 11:31:45 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVDj-00035g-7r for submit@debbugs.gnu.org; Wed, 29 Oct 2014 11:31:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVDb-0001a2-LY for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:31:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjVDU-00032P-3S for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:31:27 -0400 Original-Received: from mail-qa0-f41.google.com ([209.85.216.41]:37918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjVDT-00032K-UW for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2014 11:31:20 -0400 Original-Received: by mail-qa0-f41.google.com with SMTP id v10so747881qac.14 for ; Wed, 29 Oct 2014 08:31:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=YXpdEMMfQJhwh4pWnsq2l7JCQAC4pVzXkfNRecPCVog=; b=CkeRA71dSWJepn/sWF0Aq200OyY7hZwfQzj0MIX7fDg1i4ke04shako1JihZRFWW21 tyXMJoVnLhihmrK9IUsArMk+ztxYeGd4dR863RwopzaX6EHVHPVJSCZqNluTFvc+1B76 PeZWhnjRg/lE2Lw/6T1GCZzpJ3s5oFH+GmgIlFE6QIn+RUYzwQSy8Z3dti9Wjb4eJ4nO u3cseI4GLx6BlD4xaE2o2e7oy9WLdkoa0KGonPri/kkEC1JE0PAfxZPIoJuq7joC9Wsb pQm7+9lWYOh/ZnPsljOoEtLN/u4hs7jQ2SrAXAm9ZsrHwmTtIWYeaJwwPD7a4Ub2W/+J 6vYQ== X-Gm-Message-State: ALoCoQlEo+miVIHdoxLmaY0dRZsCkqW4fuyof4L/ynavWXSYgPd3C9kl79HAw0wSBzF82wh5dPyh X-Received: by 10.140.104.200 with SMTP id a66mr16179609qgf.37.1414596679021; Wed, 29 Oct 2014 08:31:19 -0700 (PDT) Original-Received: from holos (wifi-roaming-128-4-117-56.host.udel.edu. [128.4.117.56]) by mx.google.com with ESMTPSA id a93sm4372200qga.26.2014.10.29.08.31.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Oct 2014 08:31:18 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95251 Hi, For debugging another project, I resorted to using gcc's address sanitizer to help track down a bug, and it actually helped find others along the way. I came across a crash in emacs and decided to build trunk with the address sanitizer enabled. The build failed with this output on Arch Linux. The build config is the same as below except without optimization and with -fsanitize=address in CFLAGS and LDFLAGS. Loading /tmp/makepkg/emacs-git/src/emacs/lisp/tooltip.el (source)... Finding pointers to doc strings... Finding pointers to doc strings...done Dumping under the name emacs ================================================================= ==6778==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000cf9d70 at pc 0x7ffff6f2fd1a bp 0x7fffffffc6a0 sp 0x7fffffffbe48 READ of size 3601184 at 0x000000cf9d70 thread T0 #0 0x7ffff6f2fd19 in __interceptor_memcpy.part.38 (/usr/lib/libasan.so.1+0x2fd19) #1 0x91421d in unexec /tmp/makepkg/emacs-git/src/emacs/src/unexelf.c:1060 #2 0x7304f1 in Fdump_emacs /tmp/makepkg/emacs-git/src/emacs/src/emacs.c:2116 #3 0x88066e in eval_sub /tmp/makepkg/emacs-git/src/emacs/src/eval.c:2181 #4 0x8778e3 in Fprogn /tmp/makepkg/emacs-git/src/emacs/src/eval.c:455 #5 0x880106 in eval_sub /tmp/makepkg/emacs-git/src/emacs/src/eval.c:2128 #6 0x87751a in Fif /tmp/makepkg/emacs-git/src/emacs/src/eval.c:406 #7 0x880106 in eval_sub /tmp/makepkg/emacs-git/src/emacs/src/eval.c:2128 #8 0x8dbabf in readevalloop /tmp/makepkg/emacs-git/src/emacs/src/lread.c:1966 #9 0x8d89d3 in Fload /tmp/makepkg/emacs-git/src/emacs/src/lread.c:1361 #10 0x880767 in eval_sub /tmp/makepkg/emacs-git/src/emacs/src/eval.c:2192 #11 0x87f587 in Feval /tmp/makepkg/emacs-git/src/emacs/src/eval.c:1993 #12 0x734663 in top_level_2 /tmp/makepkg/emacs-git/src/emacs/src/keyboard.c:1206 #13 0x87c2b4 in internal_condition_case /tmp/makepkg/emacs-git/src/emacs/src/eval.c:1344 #14 0x734703 in top_level_1 /tmp/makepkg/emacs-git/src/emacs/src/keyboard.c:1214 #15 0x87ab0c in internal_catch /tmp/makepkg/emacs-git/src/emacs/src/eval.c:1105 #16 0x734448 in command_loop /tmp/makepkg/emacs-git/src/emacs/src/keyboard.c:1175 #17 0x732d58 in recursive_edit_1 /tmp/makepkg/emacs-git/src/emacs/src/keyboard.c:786 #18 0x7330f4 in Frecursive_edit /tmp/makepkg/emacs-git/src/emacs/src/keyboard.c:857 #19 0x72e5d9 in main /tmp/makepkg/emacs-git/src/emacs/src/emacs.c:1623 #20 0x7ffff0bc903f in __libc_start_main (/usr/lib/libc.so.6+0x2003f) #21 0x413818 (/tmp/makepkg/emacs-git/src/emacs/src/temacs+0x413818) 0x000000cf9d70 is located 0 bytes to the right of global variable 'Sredraw_frame' from 'dispnew.c' (0xcf9d40) of size 48 0x000000cf9d70 is located 48 bytes to the left of global variable 'Sredraw_display' from 'dispnew.c' (0xcf9da0) of size 48 SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 __interceptor_memcpy.part.38 Shadow bytes around the buggy address: 0x000080197350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080197360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080197370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080197380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x000080197390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0000801973a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00[f9]f9 0x0000801973b0: f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 0x0000801973c0: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0000801973d0: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 0x0000801973e0: f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 0x0000801973f0: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Contiguous container OOB:fc ASan internal: fe ==6778==ABORTING Makefile:833: recipe for target 'bootstrap-emacs' failed make[1]: *** [bootstrap-emacs] Error 1 make[1]: Leaving directory '/tmp/makepkg/emacs-git/src/emacs/src' Makefile:380: recipe for target 'src' failed make: *** [src] Error 2 In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2014-10-28 on logos Configured using: `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=lucid 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -g -fvar-tracking-assignments' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O2,--sort-common,--as-needed,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB Important settings: value of $LC_COLLATE: C value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: flycheck-mode: t company-mode: t show-paren-mode: t savehist-mode: t winner-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t size-indication-mode: t column-number-mode: t line-number-mode: t Recent input: ESC [ > 8 4 ; 0 ; 0 c ESC x r e p o TAB r TAB RET Recent messages: Loading /home/mvo/.cache/emacs/custom.el (source)...done Loading /home/mvo/.emacs.d/site-lisp/loaddefs.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Load-path shadows: /usr/share/emacs/25.0.50/lisp/loaddefs hides /home/mvo/.emacs.d/site-lisp/loaddefs /usr/share/emacs/25.0.50/lisp/env hides /home/mvo/.emacs.d/site-lisp/expand-region/features/support/env Features: (shadow sort gnus-util mail-extr emacsbug message idna dired format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils xterm flycheck find-func help-mode rx easymenu subr-x pcase dash company-files company-oddmuse company-keywords company-etags etags company-gtags company-dabbrev-code company-dabbrev company-capf company-cmake company-ropemacs company-xcode company-clang company-semantic company-eclim company-template company-css company-nxml company-bbdb company package epg-config windmove edmacro kmacro cl-loaddefs cl-lib saveplace paren time-date savehist winner ring zenburn-theme tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty emacs) Memory information: ((conses 16 116916 5465) (symbols 48 21555 0) (miscs 40 59 98) (strings 32 25050 6012) (string-bytes 1 669887) (vectors 16 17375) (vector-slots 8 1131936 209498) (floats 8 93 614) (intervals 56 234 0) (buffers 976 12) (heap 1024 46990 1175))