Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b9 / dfbbd2fc0c676ecd0862e00853cc8edfad802e
1 Return-Path: <cworth@cworth.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id D841D4196F2\r
6         for <notmuch@notmuchmail.org>; Tue, 18 May 2010 09:08:28 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.9 tagged_above=-999 required=5\r
12         tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 7e0wKEkrUm-i; Tue, 18 May 2010 09:08:17 -0700 (PDT)\r
16 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
17         by olra.theworths.org (Postfix) with ESMTP id 7BA644196F0;\r
18         Tue, 18 May 2010 09:08:17 -0700 (PDT)\r
19 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
20         id 111F5568E21; Tue, 18 May 2010 09:08:17 -0700 (PDT)\r
21 From: Carl Worth <cworth@cworth.org>\r
22 To: bug-gnu-emacs@gnu.org\r
23 Subject: 23.1; json-read-string crashes emacs with long string\r
24 User-Agent: Notmuch/0.3-7-g2baa576 (http://notmuchmail.org) Emacs/23.1.1\r
25         (i486-pc-linux-gnu)\r
26 Date: Tue, 18 May 2010 09:08:17 -0700\r
27 Message-ID: <87pr0t5h1q.fsf@yoom.home.cworth.org>\r
28 MIME-Version: 1.0\r
29 Content-Type: text/plain; charset=us-ascii\r
30 Cc: Notmuch mailing list <notmuch@notmuchmail.org>\r
31 X-BeenThere: notmuch@notmuchmail.org\r
32 X-Mailman-Version: 2.1.13\r
33 Precedence: list\r
34 List-Id: "Use and development of the notmuch mail system."\r
35         <notmuch.notmuchmail.org>\r
36 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
37         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
39 List-Post: <mailto:notmuch@notmuchmail.org>\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
41 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
43 X-List-Received-Date: Tue, 18 May 2010 16:08:30 -0000\r
44 \r
45 > Please describe exactly what actions triggered the bug\r
46 > and the precise symptoms of the bug:\r
47 \r
48 A user of the emacs-based mail client, Notmuch [*], found that\r
49 attempting to display a particular message would consistently\r
50 causes a segmentation fault in emacs.\r
51 \r
52 I tracked this down to calling `json-read-string' with a very long\r
53 string, (roughly 1 million characters). Rather than including that\r
54 enormous string in this message, here's a little snippet of emacs lisp\r
55 that creates and reads such a string. So, if evaluated, this code should\r
56 trigger the segmentation fault, (assuming a copy of GPLv3 exists at\r
57 /usr/share/emacs/23.1/etc/COPYING---adjust the filename if necessary).\r
58 \r
59 ;; Caution: Evaluating the block below has been known to crash emacs\r
60 (with-temp-buffer\r
61   (require 'json)\r
62   ;; First we just need a lot of text. 32 copies of GPLv3 seems to do it\r
63   (dotimes (i 32)\r
64     (insert-file "/usr/share/emacs/23.1/etc/COPYING"))\r
65   ;; Now create a buffer with a json-encoded version of the text\r
66   (let ((json-string (json-encode-string (buffer-string))))\r
67     (with-temp-buffer\r
68       (insert json-string)\r
69       (goto-char (point-min))\r
70       ;; And try to read the string. This triggers the segfault.\r
71       (json-read-string))))\r
72 \r
73 > If Emacs crashed, and you have the Emacs process in the gdb debugger,\r
74 > please include the output from the following gdb commands:\r
75 >    `bt full' and `xbacktrace'.\r
76 \r
77 I haven't attempted to debug this within gdb yet, (I'll have to get my\r
78 hands on a build of emacs with debugging symbols first). But I wanted to\r
79 share things right away, so that perhaps someone else could do further\r
80 debugging and follow up.\r
81 \r
82 In the meantime, notmuch folks, if you've got a good idea for modifying\r
83 notmuch to avoid this bug I'd be glad to hear it. Adjust followups to\r
84 include the notmuch list and not the gnu.org bug address as appropriate.\r
85 \r
86 -Carl\r
87 \r
88 [*] http://notmuchmail.org\r
89 \r
90 PS. Here are some of the details provided by `report-emacs-bug':\r
91 \r
92 In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.18.2)\r
93  of 2010-01-26 on raven, modified by Debian\r
94 Windowing system distributor `The X.Org Foundation', version 11.0.10799001\r
95 configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''\r
96 \r
97 Important settings:\r
98   value of $LC_ALL: nil\r
99   value of $LC_COLLATE: nil\r
100   value of $LC_CTYPE: nil\r
101   value of $LC_MESSAGES: nil\r
102   value of $LC_MONETARY: nil\r
103   value of $LC_NUMERIC: nil\r
104   value of $LC_TIME: nil\r
105   value of $LANG: en_US.UTF-8\r
106   value of $XMODIFIERS: nil\r
107   locale-coding-system: utf-8-unix\r
108   default-enable-multibyte-characters: t\r
109 \r
110 -- \r
111 carl.d.worth@intel.com\r