From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marco Maggi Newsgroups: gmane.lisp.guile.bugs Subject: [bug #21489] crash when incorrectly sorting methods Date: Wed, 31 Oct 2007 17:22:53 +0000 Message-ID: <20071031-172252.sv63311.32405@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Trace: ger.gmane.org 1193851389 28179 80.91.229.12 (31 Oct 2007 17:23:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Oct 2007 17:23:09 +0000 (UTC) To: Marco Maggi , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Oct 31 18:23:12 2007 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1InHHb-0002vU-4i for guile-bugs@m.gmane.org; Wed, 31 Oct 2007 18:23:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InHHR-00045G-Gx for guile-bugs@m.gmane.org; Wed, 31 Oct 2007 13:23:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1InHHN-00044o-GR for bug-guile@gnu.org; Wed, 31 Oct 2007 13:22:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1InHHL-000439-9W for bug-guile@gnu.org; Wed, 31 Oct 2007 13:22:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InHHK-000435-QW for bug-guile@gnu.org; Wed, 31 Oct 2007 13:22:54 -0400 Original-Received: from savannah.gnu.org ([199.232.41.3] helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1InHHK-0000o4-CJ for bug-guile@gnu.org; Wed, 31 Oct 2007 13:22:54 -0400 Original-Received: from savannah.gnu.org ([199.232.41.3] helo=frontend) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1InHHJ-0003cj-Ny; Wed, 31 Oct 2007 17:22:53 +0000 Original-Received: from www-data by frontend with local (Exim 4.63) (envelope-from ) id 1InHHJ-0003cg-Gm; Wed, 31 Oct 2007 17:22:53 +0000 X-Savane-Server: savannah.gnu.org:443 [199.232.41.3] X-Savane-Project: guile X-Savane-Tracker: bugs X-Savane-Item-ID: 21489 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 X-Apparently-From: 131.175.7.1 (Savane authenticated user marcomaggi) Original-References: In-Reply-To: X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:3659 Archived-At: URL: Summary: crash when incorrectly sorting methods Project: Guile Submitted by: marcomaggi Submitted on: mercoledì 31/10/2007 alle 17:22 Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: I know that the correct way to do it is: (sort-applicable-methods (compute-applicable-methods arg ...) arg ...) so the following will "never" happen, but nevertheless the following segfaults Guile 1.8.3 on a i686-pc-linux-gnu with GCC 4.1.2, CFLAGS="-O3 -g -march=i686 -mtune=i686". ;; hurtme.scm -- (define-module (one) #:use-module (oop goops) #:duplicates merge-generics) (define saved-length length) (define-generic length) (define-method (length . args) (apply saved-length o)) (define-method (length (o )) (vector-length o)) (export length) (define-module (hurt-me) #:use-module (oop goops) #:use-module (one) #:duplicates merge-generics) (sort-applicable-methods length (generic-function-methods length) '(1 2 3)) ;; end of file The actual crashing code is in 'more_specificp()'. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1212094784 (LWP 22856)] scm_sys_method_more_specific_p (m1=0xb7bc3160, m2=0xb7bc3130, targs=0xb7b3f3f0) at goops.c:1961 1961 if (cs1 == SCM_CAR(l)) #0 scm_sys_method_more_specific_p (m1=0xb7bc3160, m2=0xb7bc3130, targs=0xb7b3f3f0) at goops.c:1961 #1 0xb7e40876 in ceval (x=, env=0xb7b3ed18) at eval.c:4560 #2 0xb7e462ad in call_closure_2 (proc=0xb7b3f390, arg1=0xb7bc3160, arg2=0xb7bc3130) at eval.c:5347 #3 0xb7e80fb2 in scm_merge_list_step (seq=0xbf831c70, cmp=0xb7e46250 , less=0xb7b3f390, n=2) at sort.c:348 #4 0xb7e82610 in scm_sort_x (items=0x404, less=0xb7b3f390) at sort.c:384 #5 0xb7e826e7 in scm_sort (items=0xb7bea680, less=0xb7b3f390) at sort.c:411 #6 0xb7e41782 in ceval (x=0x404, env=0xb7b3f3c8) at eval.c:4349 #7 0xb7e4603a in scm_primitive_eval_x (exp=0xb7b3cf38) at eval.c:5910 #8 0xb7e5faef in scm_primitive_load (filename=0xb7ba4c20) at load.c:109 #9 0xb7e4169f in ceval (x=0x404, env=0xb7b90fe0) at eval.c:4223 #10 0xb7e2d56b in scm_start_stack (id=0xb7b9d440, exp=0xb7bfe2d8, env=0xb7b90fe0) at debug.c:454 #11 0xb7e2dd55 in scm_m_start_stack (exp=, env=0xb7b90fe0) at debug.c:470 #12 0xb7e43495 in scm_apply (proc=, arg1=0xb7bfe310, args=) at eval.c:4930 #13 0xb7e401e2 in ceval (x=, env=0xb7b90fe0) at eval.c:4050 #14 0xb7e45b9f in scm_call_0 (proc=0xb7b90fa8) at eval.c:4655 #15 0xb7e479bd in apply_thunk (thunk=0xb7b90fa8) at fluids.c:396 #16 0xb7e47b9e in scm_c_with_fluid (fluid=0x80620e0, value=0x4, cproc=0xb7e479a0 , cdata=0xb7b90fa8) at fluids.c:459 #17 0xb7e47bf5 in scm_with_fluid (fluid=0x80620e0, value=0x4, thunk=0xb7b90fa8) at fluids.c:446 #18 0xb7e40876 in ceval (x=, env=0xb7b90f68) at eval.c:4560 #19 0xb7e45b9f in scm_call_0 (proc=0xb7b90d70) at eval.c:4655 (gdb) _______________________________________________________ Reply to this item at: _______________________________________________ Messaggio inviato con/da Savannah http://savannah.gnu.org/ _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://lists.gnu.org/mailman/listinfo/bug-guile