From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yavor Doganov Newsgroups: gmane.emacs.bugs Subject: bug#1079: GNUstep port segfaults making autoloads on x86_64 Date: Tue, 07 Oct 2008 22:02:51 +0300 Organization: The GNU Emacs Church (Bulgarian eparchy) Message-ID: <87od1wcjok.GNU's_Not_Unix!%yavor@gnu.org> References: <87ej2uysd1.GNU's_Not_Unix!%yavor@gnu.org> <7uiqs5sksd.fsf@fencepost.gnu.org> Reply-To: Yavor Doganov , 1079@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1223407855 662 80.91.229.12 (7 Oct 2008 19:30:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Oct 2008 19:30:55 +0000 (UTC) Cc: yavor@gnu.org, 1079@emacsbugs.donarmstrong.com To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 07 21:31:50 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 1KnIHR-0005TU-Nh for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Oct 2008 21:31:38 +0200 Original-Received: from localhost ([127.0.0.1]:56213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnIGO-00078f-2V for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Oct 2008 15:30:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnIFz-0006s6-Cx for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 15:30:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnIFu-0006lE-Ts for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 15:30:06 -0400 Original-Received: from [199.232.76.173] (port=56252 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnIFu-0006kJ-1E for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 15:30:02 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55695) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KnIFs-0000Nj-6i for bug-gnu-emacs@gnu.org; Tue, 07 Oct 2008 15:30:00 -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 m97JTv5X026615; Tue, 7 Oct 2008 12:29:57 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m97JA5pF022065; Tue, 7 Oct 2008 12:10:05 -0700 X-Loop: don@donarmstrong.com Resent-From: Yavor Doganov Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , don@donarmstrong.com Resent-Date: Tue, 07 Oct 2008 19:10:05 +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.122340618619895 (code B ref 1079); Tue, 07 Oct 2008 19:10:05 +0000 Original-Received: (at 1079) by emacsbugs.donarmstrong.com; 7 Oct 2008 19:03:06 +0000 Original-Received: from yavor.doganov.org (92_245.btc-net.bg [213.91.245.92] (may be forged)) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m97J2tYg019881 for <1079@emacsbugs.donarmstrong.com>; Tue, 7 Oct 2008 12:02:57 -0700 Original-Received: from gana.yavor.doganov.org ([192.168.0.5]) by yavor.doganov.org with esmtp (Exim 4.69) (envelope-from ) id 1KnHpb-0001Ro-Mq; Tue, 07 Oct 2008 22:02:53 +0300 Original-Received: from localhost ([127.0.0.1] helo=gana.yavor.doganov.org) by gana.yavor.doganov.org with esmtp (Exim 4.69) (envelope-from ) id 1KnHpb-0005lF-Dp; Tue, 07 Oct 2008 22:02:51 +0300 In-Reply-To: <7uiqs5sksd.fsf@fencepost.gnu.org> Mail-Followup-To: Glenn Morris , 1079@emacsbugs.donarmstrong.com, yavor@gnu.org User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 =?UTF-8?Q?(Goj=C5=8D)?= APEL/10.7 Emacs/22.3 (i486-pc-linux-gnu) MULE/5.0 (SAKAKI) X-Jabber-ID: doganov@jabber.minus273.org X-SA-Exim-Connect-IP: 192.168.0.5 X-SA-Exim-Mail-From: yavor@gnu.org X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000) X-SA-Exim-Scanned: Yes (on yavor.doganov.org) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 07 Oct 2008 15:30:06 -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:21236 Archived-At: Glenn Morris wrote: > > > Which version of GNUstep Base is this? > > gnustep-startup-0.20.0.tar That should contain the latest stable releases, so it must be OK (I've never installed this way, though.) > base/NSInvocation/general.m: > FAIL: Can send/return large structs This is a bit worrisome. Just to rule out the possibility, can you compile gnustep-base against libffi in case it was built with libffcall (and vice-versa -- rebuild it with libffcall if it was with libffi). There were numerous problems with both, and libffi became preferred by upstream a few months ago. > > Does the naive patch below eliminate this problem? > > I'm afraid not. Oh, of course not; this file is not being read at all at this point. Nevertheless, still fixes a harmless runtime warning. > Here is a full backtrace this time: Thanks. I can't see how this can be a bug in Emacs. The arguments of bootstrap-emacs are evaluated as property lists and since "(setq foo 1)" (or whatever is passed to --batch in such form) is not a validly formatted array, an NSException is raised here: #5 0x00002b51204f9fbb in GSPropertyListFromStringsFormat (string=0x1b392730) at NSPropertyList.m:1505 dict = (class NSMutableDictionary *) 0x0 _pld = { ptr = 0x1b281c70 "(setq foo 1)", end = 12, pos = 0, lin = 0, err = 0x2b512095f000, opt = NSPropertyListImmutable, key = 0 '\000', old = 1 '\001' } However, this exception should be caught and handled by the parent exception handler at NSUserDefaults.m:1814 -- note the comment there: else { // Real parameter /* Parsing the argument as a property list is very delicate. We *MUST NOT* crash here just because a strange parameter (such as `(load "test.scm")`) is passed, otherwise the whole library is useless in a foreign environment. */ NSObject *plist_val; NS_DURING [....] This is precisely the case here, and it's handled properly on i386. It is getting too complicated for me, but can you compile this test program (it should never crash): test.m: ======= #import int main (int argc, char** argv, char **env) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSProcessInfo *proc = [NSProcessInfo processInfo]; NSBundle *bundle = [NSBundle mainBundle]; NSArray *args; unsigned i; int retval = 0; [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; args = [proc arguments]; GSPrintf (stderr, @"Useless info about bundle: %@\n", bundle); if ([args count] <= 1) { GSPrintf (stderr, @"Please specify some arguments.\n"); RELEASE (pool); exit (EXIT_FAILURE); } else if ([[proc environment] valueForKey:@"NOHANDLE"] != nil) GSPrintf (stderr, @"NOHANDLE defined; should exit with success.\n"); else { for (i = 1; i < [args count]; i++) { NSString *opt = [args objectAtIndex: i]; NS_DURING { NSString *tempString; id result; tempString = [NSString stringWithString: opt]; if (tempString == nil) GSPrintf (stderr, @"This should not happen.\n"); /* Exception handler taking care here. */ else if (![tempString propertyList]); else if ((result = [tempString propertyList]) == nil) GSPrintf (stderr, @"'%@' - a nil property list.\n", opt); else if ([result isKindOfClass: [NSDictionary class]] == YES) GSPrintf (stderr, @"'%@' - a dictionary.\n", opt); else if ([result isKindOfClass: [NSArray class]] == YES) GSPrintf (stderr, @"'%@' - an array.\n", opt); else if ([result isKindOfClass: [NSString class]] == YES) GSPrintf (stderr, @"'%@' - a string.\n", opt); else GSPrintf (stderr, @"'%@' - unknown class %@.\n", opt, [[result class] description]); } NS_HANDLER { GSPrintf (stderr, @"'%@' failed with:\n%@.\n", opt, [localException reason]); GSPrintf (stderr, @"Failure.\n"); retval = 1; } NS_ENDHANDLER } } RELEASE (pool); return retval; } You can use this simple makefile to build it: GNUmakefile: ============ include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = test test_OBJC_FILES = test.m include $(GNUSTEP_MAKEFILES)/tool.make Just type `make'. Then test it as follows (the executable should be /obj/test): (gdb) r '{a=b; c=d}' '(foo, bar)' --batch '(setq foo 1)' ... (gdb) set environment NOHANDLE=yes (gdb) r (with the same arguments) Thanks.