From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bkey1@tampabay.rr.com Newsgroups: gmane.emacs.devel Subject: Re: Fix for Emacs Crash - revisited Date: Wed, 13 Nov 2002 15:18:49 +0000 (UTC) Sender: emacs-devel-admin@gnu.org Message-ID: <200211111532.gABFWmCB017225@smtp-server1.tampabay.rr.com> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1037200729 18224 80.91.224.249 (13 Nov 2002 15:18:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 13 Nov 2002 15:18:49 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18BzCi-00048L-00 for ; Wed, 13 Nov 2002 16:13:20 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18BzOf-00066k-00 for ; Wed, 13 Nov 2002 16:25:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18BGmQ-0000HH-00; Mon, 11 Nov 2002 10:47:14 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18BGYh-0003fo-00 for emacs-devel@gnu.org; Mon, 11 Nov 2002 10:33:03 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18BGYe-0003fI-00 for emacs-devel@gnu.org; Mon, 11 Nov 2002 10:33:02 -0500 Original-Received: from smtp-server1.tampabay.rr.com ([65.32.1.34]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18BGYX-0003eT-00; Mon, 11 Nov 2002 10:32:53 -0500 Original-Received: from Debug (webmail.tampabay.rr.com [65.32.1.36]) by smtp-server1.tampabay.rr.com (8.12.2/8.12.2) with SMTP id gABFWmCB017225; Mon, 11 Nov 2002 10:32:48 -0500 (EST) Original-To: Juanma Barranquero , bkey1@tampabay.rr.com, emacs-devel@gnu.org, rms@gnu.org X-Posting-IP: 209.101.206.131 X-Mailer: Endymion MailMan Standard Edition v3.2.9 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9309 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9309 > IMHO the test should *exclude* the platforms where you know the call to > OpenProcessToken fails, not include the ones where it works, because the > first subset is more likely to remain stable than the second one. Good idea, I will make this change tonight. > > Usually it means that it consists of dead code, i.e., that no machine code > was generated for those source locations... Or there's something I'm > missing? I would agree with this if it where not for the global variable test I did (I set a global variable to a specific value in syms_of_w32menu, set a breakpoint in initialize_frame_menubar which is called after syms_of_w32menu, and found that at this point the global variable had that specific value). > > Anyway, it is still interesting trying to determine why it does happens > in XP vs. 9x/Me and not, for example, 2K vs 9x/Me. One of the grand mysteries of the universe. I also would like to know the answer to this question, but I was unable to find it. As I said before, I am uncomfortable when I cannot determine why a change that fixes a crash is necessary. That is why I tested this change as throughly as I did. > > As an aside: According to the Platform SDK, OpenProcessToken only exists > in NT 3.1 and later, not in the 9x series... The Platform SDK documentation says it is only Supported in Windows NT / 2000 / XP. This does not necessarily mean it does not exist in other versions of Windows. I found out that it does exist in the version of advapi32.dll found on Windows 9x by using dumpbin /exports. If OpenProcessToken did not exist in Windows 9x, Emacs would not even run in Windows 9x. Instead, a dialog complaining about OpenProcessToken not being found would be displayed and then Emacs would exit unless we changed the code to call OpenProcessToken via a function pointer rather than calling it directly. NOTE: The call to OpenProcessToken was there before I made my change.