From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#6991: Please keep bytecode out of *Backtrace* buffers Date: Sat, 26 Nov 2016 12:18:00 -0500 Message-ID: <874m2ujh2v.fsf@users.sourceforge.net> References: <8739tm9vzl.fsf@jidanni.org> <87vb5ct1lz.fsf@gnus.org> <2223f654-1e67-4a9a-a471-828fd4078410@default> <87fumokzbp.fsf@users.sourceforge.net> <83oa1bc3x2.fsf@gnu.org> <87d1hrlek2.fsf@users.sourceforge.net> <83eg27bjah.fsf@gnu.org> <87a8cvlcmk.fsf@users.sourceforge.net> <8360njb9o5.fsf@gnu.org> <877f7zksm0.fsf@users.sourceforge.net> <83oa1a9msk.fsf@gnu.org> <83vavf73ei.fsf@gnu.org> <8360ne6v1q.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1480180699 15391 195.159.176.226 (26 Nov 2016 17:18:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 26 Nov 2016 17:18:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: lekktu@gmail.com, johnw@gnu.org, monnier@iro.umontreal.ca, 6991@debbugs.gnu.org, larsi@gnus.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 26 18:18:12 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 1cAgc5-0002Uh-24 for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Nov 2016 18:18:09 +0100 Original-Received: from localhost ([::1]:51223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAgc8-0001cK-PI for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Nov 2016 12:18:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAgc2-0001cF-I0 for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2016 12:18:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAgby-00005S-GX for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2016 12:18:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cAgby-00005O-CX for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2016 12:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cAgby-0005PU-1r for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2016 12:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Nov 2016 17:18:02 +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.148018064120736 (code B ref 6991); Sat, 26 Nov 2016 17:18:02 +0000 Original-Received: (at 6991) by debbugs.gnu.org; 26 Nov 2016 17:17:21 +0000 Original-Received: from localhost ([127.0.0.1]:42590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cAgbE-0005OJ-HM for submit@debbugs.gnu.org; Sat, 26 Nov 2016 12:17:20 -0500 Original-Received: from mail-io0-f195.google.com ([209.85.223.195]:32956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cAgb9-0005O4-HZ for 6991@debbugs.gnu.org; Sat, 26 Nov 2016 12:17:14 -0500 Original-Received: by mail-io0-f195.google.com with SMTP id j92so14954664ioi.0 for <6991@debbugs.gnu.org>; Sat, 26 Nov 2016 09:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=84IbJSAQ+20bpuanwKa51Ta2iDkmvfQwGvHCUYQbxjs=; b=LmgeCS0So2l4s0mOUGGLxJv+Dwjk+ahPz/XHzSx32qtLKkDY3D++HifqDA2P0Vl1R5 u+1l1G6bAjnUpXJDrqkUxaXY9T1wzCo1dTIvarPC+Wz9pF2Wc5E1A7ni4b/uRGd5aJb+ 7pmnG3aFxLO6qMrxNisOS1IEowcUGRQ5yDtSaC3rpTCii8l4MIvkjr+OqbWI8K0/UNXz ROVTQzedNCkrMlrTJKvjHTAVoSFjADstBp3+im6VlaLIyq54wrm/rRYoSoFgrfacs4Vz nTOhEe1EF07aVTiLTR/1llpFn8BOJ8LxkCxKXyP4r9NL7CuWMLBdubUs6lknGxd/Cw0G XpPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=84IbJSAQ+20bpuanwKa51Ta2iDkmvfQwGvHCUYQbxjs=; b=Q4TCGq84nZn56KN3PYvUxlcAXBm5mcLt2T4jjY+f6H/Vmak7AkAeYQz6iSAv+hy/ne F5AT0KElsSnyl1aJ/aPTLrelUadQZGjvsVVfpN11sr5zVqPrAOjkWPWM7JijgDIitDv4 OrQhzcAxyH20qkr4HD97tjdXy2RaF17x6u+AGg/Qzrl+EVWX4pslZrJxlBx9Tpyr/dAG piHp7MYmThUcFkleeIilrsE9r0tzZBxMhAkMnXsmd51F1MwcaGnhc/WBJOufXjAB8CGI +KT6wyKA1lbOj+4yAJYnC+/zGTo2E7YUksQoUu4txOH9i69rvdwQu1Z1zzPbv6zV/DIz 8sNQ== X-Gm-Message-State: AKaTC02sXP9o9KReBr94qPBTiTUYRNZRhEQIclcmBZH9mzHH8c4PFBrek35CHxhqBAqv+w== X-Received: by 10.36.254.74 with SMTP id w71mr11852686ith.38.1480180625894; Sat, 26 Nov 2016 09:17:05 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 17sm16860268ioh.12.2016.11.26.09.17.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Nov 2016 09:17:04 -0800 (PST) In-Reply-To: <8360ne6v1q.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 23 Nov 2016 18:05:37 +0200") 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:126117 Archived-At: Eli Zaretskii writes: >> From: Noam Postavsky >> Date: Tue, 22 Nov 2016 16:07:06 -0500 >> Cc: 6991@debbugs.gnu.org, Juanma Barranquero , John Wiegley , >> Stefan Monnier , Lars Magne Ingebrigtsen , >> Drew Adams >> >> > I'm confused: which problem the above is supposed to fix? Are we >> > still talking about putting null bytes in selections, or are we >> > talking about something else? >> >> The original bug report is about copying backtraces containing byte >> code to other applications (e.g., web browser, mail client, etc). The >> byte code in backtraces is currently printed with several characters >> backslash escaped (newline, formfeed, backslash, double quote, and >> characters higher than 0x80). I propose to extend this escaping to >> null bytes as well. That will (somewhat indirectly) solve the problem >> of copying backtraces to other applications, without lossyness (i.e., >> (equal (read (print str)) str) remains true). It won't solve the >> problem of copying arbitrary text containing null bytes to other >> applications, it only avoids the most common case of the user needing >> to copy text containing null bytes. > > I'm not necessarily opposed, but I never had any problems with binary > nulls, except when copying to clipboard. I've never needed to copy binary nulls except when a backtrace had one. > >> So in addition to that, your proposal to escape null bytes in xselect >> and w32select would still be needed to cover the general case. The >> drawback to replacing nulls in the {x,w32}select code is that the >> conversion is lossy, and there is a slightly increased chance of the >> user not noticing there was lossy conversion (relative to the current >> lossy "conversion" of truncating the string). > > Yes, it's lossy, but what other alternative do we have, except losing > much more? Yes, there's no perfect solution. That's why I prefer to solve just the immediate problem by extending the escaping in `print' to cover null bytes. And this will keep working if, for example, we make the general case of copying null bytes to clipboard use a customizable replacement.