From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12908: 24.3.50; file `emacs_backtrace.txt'? Date: Sun, 18 Nov 2012 06:04:28 +0200 Message-ID: <83d2zb1rqr.fsf@gnu.org> References: <4B9EFDFEE27E43DBB6331605DD7C2842@us.oracle.com> <50A7DB2C.7050501@cs.ucla.edu> <8339082gig.fsf@gnu.org> <50A7E5AB.3040006@cs.ucla.edu> <83zk2g10ew.fsf@gnu.org> <50A800BD.2@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1353211517 23491 80.91.229.3 (18 Nov 2012 04:05:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Nov 2012 04:05:17 +0000 (UTC) Cc: 12908@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 18 05:05:28 2012 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 1TZw8M-0008Jl-6K for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Nov 2012 05:05:26 +0100 Original-Received: from localhost ([::1]:53598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZw8B-0008AD-Ur for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Nov 2012 23:05:15 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZw86-00089C-Ej for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2012 23:05:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZw83-0001GN-BZ for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2012 23:05:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZw83-0001G3-7w for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2012 23:05:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TZw8w-0006xS-DR for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2012 23:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Nov 2012 04:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12908 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12908-submit@debbugs.gnu.org id=B12908.135321155326732 (code B ref 12908); Sun, 18 Nov 2012 04:06:02 +0000 Original-Received: (at 12908) by debbugs.gnu.org; 18 Nov 2012 04:05:53 +0000 Original-Received: from localhost ([127.0.0.1]:51823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TZw8m-0006x6-Ie for submit@debbugs.gnu.org; Sat, 17 Nov 2012 23:05:52 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:46345) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TZw8l-0006x0-3e for 12908@debbugs.gnu.org; Sat, 17 Nov 2012 23:05:51 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MDO009000NEFW00@a-mtaout20.012.net.il> for 12908@debbugs.gnu.org; Sun, 18 Nov 2012 06:04:54 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MDO0087W0O6XNM0@a-mtaout20.012.net.il>; Sun, 18 Nov 2012 06:04:54 +0200 (IST) In-reply-to: <50A800BD.2@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-Spam-Score: 1.5 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: 1.5 (+) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:67106 Archived-At: > Date: Sat, 17 Nov 2012 13:25:17 -0800 > From: Paul Eggert > CC: 12908@debbugs.gnu.org > > >> Perhaps it would be better for Emacs, on Microsoft Windows, to > >> redirect stderr to a file, so that the information does not get > >> lost. > > > > It's not easy to do that > > Can Emacs use freopen? That's not the problem. The problem is that stderr is used when Emacs is run in non-interactive mode, and should not be touched then. The problem is in detecting when stderr is closed or an invalid handle to begin with, and do the redirection only then. In all my readings and tests, I was unable to find a reliable, let alone documented, way of determining that. I don't even know if the "invalid handle" (which is a pointer on Windows) is NULL or an INVALID_HANDLE_VALUE. > For example, the following code would do the job on a POSIX > platform: if stderr is closed, it redirects it to emacs-stderr.txt > in the current directory, if possible. Would this sort of thing > work on Microsoft platform? It will surely break -batch. And guess what happens with this redirection when Emacs has its stderr closed or invalid in the first place.