From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adrian Robert Newsgroups: gmane.emacs.bugs Subject: bug#1079: GNUstep port segfaults making autoloads on x86_64 Date: Sat, 4 Oct 2008 22:06:54 -0400 Message-ID: <7F82B60B-481E-48E4-A004-B211E4180421@gmail.com> References: <3A88304F-EE0F-4F8D-A5B3-7B62E926150C@gmail.com> Reply-To: Adrian Robert , 1079@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v926) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1223173822 7036 80.91.229.12 (5 Oct 2008 02:30:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Oct 2008 02:30:22 +0000 (UTC) Cc: 1079@emacsbugs.donarmstrong.com To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 05 04:31:19 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KmJOx-0008KM-1K for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Oct 2008 04:31:19 +0200 Original-Received: from localhost ([127.0.0.1]:50939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmJNt-0008Im-Mh for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Oct 2008 22:30:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KmJNj-0008Fp-Ax for bug-gnu-emacs@gnu.org; Sat, 04 Oct 2008 22:30:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KmJNh-0008FC-JI for bug-gnu-emacs@gnu.org; Sat, 04 Oct 2008 22:30:02 -0400 Original-Received: from [199.232.76.173] (port=57201 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmJNh-0008F9-DD for bug-gnu-emacs@gnu.org; Sat, 04 Oct 2008 22:30:01 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:46762) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KmJNh-000253-7V for bug-gnu-emacs@gnu.org; Sat, 04 Oct 2008 22:30:01 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m952TuJu024824; Sat, 4 Oct 2008 19:29:56 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m952F3kQ021380; Sat, 4 Oct 2008 19:15:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Adrian Robert Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , don@donarmstrong.com Resent-Date: Sun, 05 Oct 2008 02:15:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1079 X-Emacs-PR-Package: emacs,ns X-Emacs-PR-Keywords: Original-Received: via spool by 1079-submit@emacsbugs.donarmstrong.com id=B1079.122317243520053 (code B ref 1079); Sun, 05 Oct 2008 02:15:03 +0000 Original-Received: (at 1079) by emacsbugs.donarmstrong.com; 5 Oct 2008 02:07:15 +0000 Original-Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.225]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9527Bqa020046 for <1079@emacsbugs.donarmstrong.com>; Sat, 4 Oct 2008 19:07:12 -0700 Original-Received: by wx-out-0506.google.com with SMTP id h29so1454872wxd.13 for <1079@emacsbugs.donarmstrong.com>; Sat, 04 Oct 2008 19:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=QJuLCDOiEbsoj8gOOJPHpEVQNuqcH/8EQ6T5OPY0Rgo=; b=rdihUV/lLDtEBrwZRMKOGkOVUtykloz0+AR+aWNRHk2VOw52JWYmterE6MByxLTj3t r5arVByJ2yFsuuuRXpv1512UtOUq1KuX+dnb8tpLGfX9dXqX72VzC4De8Vu+BMsBHjUq WkH46XjMWLmqQXTtQ8fdety22YiW1aBRWnrGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=YP4Lpp5bJrH8tH9xqm0ZFxkPttZGSHhkGfUl8N0Cr8JEQGHMmSL+YTrSAi9E2rMEu5 8IHRBPkir7kXAKXJsghCtY1l9NxpsBcVDMgzFxHC+UEs/rMErIaGi1Dc9+ySSPnHMyfQ Yi6SC1Xh8LeHvkrfSCboCubvkHn+U7aUxNilc= Original-Received: by 10.70.49.8 with SMTP id w8mr3640567wxw.67.1223172431034; Sat, 04 Oct 2008 19:07:11 -0700 (PDT) Original-Received: from ?10.0.1.199? ([72.169.150.82]) by mx.google.com with ESMTPS id l31sm4826357hsa.6.2008.10.04.19.07.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 04 Oct 2008 19:07:10 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.926) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sat, 04 Oct 2008 22:30:02 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:21125 Archived-At: On Oct 4, 2008, at 9:40 PM, Glenn Morris wrote: > Adrian Robert wrote: > >> #ifndef CANNOT_DUMP >> if (initialized) >> #endif >> ns_init_paths (); >> #endif >> >> Hmm, not sure if this ns_init_paths() is needed during the bootstrap > > I tried commenting it out; then I get a segfault loading > term/ns-win.el from the ns-list-colors call. > >> -- i.e., should the conditional be different, or should it be moved >> after the init_...() calls? Unf I cannot test this stuff myself. > > I tried (randomly) moving it after init_cmdargs; didn't make a > difference. > > Since it works (for this stage at least) on 32-bit, but not 64, I > don't think something like that can be the answer. > > It's the very first line of ns_init_paths that is the problem, does > this suggest anything? > > NSBundle *bundle = [NSBundle mainBundle]; It's just an ordinary API call, but it's not meant to be run from an app that is not inside a "bundle". That is, once packaged into Emacs.app directory structure, it's OK to run this call, but the behavior would be undefined if just being run as src/[t]emacs. From your stack trace it looked like GNUstep tried to initialize some of its internals and ran into an unexpected condition causing the crash. So, if there were some way to run ns_init_paths() only in either dumped emacs, or CANNOT_DUMP emacs but NOT during bootstrapping, I think that would be best. (I may not have fully thought this through when I first wrote that conditional, probably since the ns_init_paths impl originally didn't call -mainBundle.) As for the location before or after init_ calls, on second thought I'm not sure this matters a lot. I believe I put it the same place the Carbon port had its equivalent call. Regarding the later segfault after commenting out, ns_init_paths only sets environment variables affecting emacs lisp load paths, does not initialize anything else. So I'd say this is a separate bug.