From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#6991: Please keep bytecode out of *Backtrace* buffers Date: Sat, 19 Nov 2016 09:41:29 +0200 Message-ID: <83oa1bc3x2.fsf@gnu.org> References: <8739tm9vzl.fsf@jidanni.org> <87vb5ct1lz.fsf@gnus.org> <2223f654-1e67-4a9a-a471-828fd4078410@default> <87fumokzbp.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1479541334 3993 195.159.176.226 (19 Nov 2016 07:42:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 19 Nov 2016 07:42:14 +0000 (UTC) Cc: lekktu@gmail.com, johnw@gnu.org, monnier@iro.umontreal.ca, 6991@debbugs.gnu.org, larsi@gnus.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 19 08:42:09 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c80Hp-00008u-HV for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Nov 2016 08:42:09 +0100 Original-Received: from localhost ([::1]:40392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c80Hs-0004GU-SR for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Nov 2016 02:42:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c80Hl-0004EK-Ky for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 02:42:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c80Hi-0000PE-6A for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 02:42:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c80Hi-0000PA-2X for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 02:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c80Hh-00081H-SP for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 02:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Nov 2016 07:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6991 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6991-submit@debbugs.gnu.org id=B6991.147954129930790 (code B ref 6991); Sat, 19 Nov 2016 07:42:01 +0000 Original-Received: (at 6991) by debbugs.gnu.org; 19 Nov 2016 07:41:39 +0000 Original-Received: from localhost ([127.0.0.1]:34384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c80HL-00080X-Ed for submit@debbugs.gnu.org; Sat, 19 Nov 2016 02:41:39 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c80HK-00080L-0c for 6991@debbugs.gnu.org; Sat, 19 Nov 2016 02:41:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c80HB-0008TW-44 for 6991@debbugs.gnu.org; Sat, 19 Nov 2016 02:41:32 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c80H6-0008QD-Qz; Sat, 19 Nov 2016 02:41:24 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3381 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c80H5-0000ZO-Fr; Sat, 19 Nov 2016 02:41:23 -0500 In-reply-to: <87fumokzbp.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:125859 Archived-At: > From: npostavs@users.sourceforge.net > Date: Fri, 18 Nov 2016 20:55:54 -0500 > Cc: Juanma Barranquero , Lars Ingebrigtsen , > John Wiegley , > Stefan Monnier , 6991@debbugs.gnu.org > > Drew Adams writes: > > > > Here's a backtrace with some byte-code in it: > > > > Debugger entered--entering a function: > > * icicle-ucs-names() > > * #[(prompt &optional names) "\204 > > > > > > See, only the top two lines got pasted (even into an Outlook > > window, and the second line was truncated at the first null > > byte (it appears as ^@ in the backtrace, where that is a null > > char and not two chars). > > I would propose something like the below, which will cause the NUL byte > to be rendered as \0 instead of ^@. We could potentially do this with > other control characters too, if they cause trouble too? Isn't the fact that copying text into the clipboard stops at the first null character a Windows-specific issue? And if it isn't Windows specific, isn't it at least specific to selections? I think Emacs doesn't need this change for all occurrences of the null byte, because Emacs Lisp strings and buffer text will happily DTRT with them (they were designed to do so). So I thin we should only "fix" this problem where it happens, not in print functions in general. > I do think it's worth keeping the bytecode in the backtrace, because > it's not useless: you can run `disassemble' on it and get something > meaningful. Exactly. But if we change print_object like you suggest, there's no way of being sure the null bytes won't be mangled by some application of a print function.