From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Steve Juranich" Newsgroups: gmane.lisp.guile.bugs Subject: Bug in make-shared-array. Date: Mon, 27 Feb 2006 16:12:07 -0700 Message-ID: <56190b6c0602271512x5b43963fh174f5335906b6dcf@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1141403159 2058 80.91.229.2 (3 Mar 2006 16:25:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Mar 2006 16:25:59 +0000 (UTC) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 03 17:25:57 2006 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FFD5K-00038z-FH for guile-bugs@m.gmane.org; Fri, 03 Mar 2006 17:24:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFD5I-000222-Mv for guile-bugs@m.gmane.org; Fri, 03 Mar 2006 11:24:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FEhIE-0001r4-Ii for bug-guile@gnu.org; Thu, 02 Mar 2006 01:28:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FEhIB-0001pb-Ht for bug-guile@gnu.org; Thu, 02 Mar 2006 01:28:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FEAnf-00078d-D7 for bug-guile@gnu.org; Tue, 28 Feb 2006 14:46:23 -0500 Original-Received: from [64.233.182.201] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FDrY9-0007iZ-0V for bug-guile@gnu.org; Mon, 27 Feb 2006 18:13:05 -0500 Original-Received: by nproxy.gmail.com with SMTP id c2so637358nfe for ; Mon, 27 Feb 2006 15:12:07 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=FV9v2V6yazvltOgiERUvUPfbBSWKsFWjkiEXS61CTKgp1CG7+FDasXtAMvm8IvQNY6kvDMaXoQdWMf6z3uVl5UU1FZ4EsQRLbMtQP8wKGAMOQ7PNAm4HWbVAKDOiZoGoJwAErkYwBObuQTK/CZlRxDJR9tt3Ij39yz15lTSJv6o= Original-Received: by 10.49.18.14 with SMTP id v14mr374836nfi; Mon, 27 Feb 2006 15:12:07 -0800 (PST) Original-Received: by 10.49.35.18 with HTTP; Mon, 27 Feb 2006 15:12:07 -0800 (PST) Original-To: bug-guile@gnu.org Content-Disposition: inline X-Mailman-Approved-At: Thu, 02 Mar 2006 11:06:27 -0500 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:3118 Archived-At: I've tried posting a couple of messages about this via gmane.org, but they still haven't posted to the list, that I can see. Sorry if people are seeing multiple versions of this. There is a bug in scm_make_shared_array that causes things to break when the input array is 1-d. I thought I had a working patch for this, but I don't. Anyway, the offending line is libguile/unif.c:912: SCM_I_ARRAY_BASE (ra) =3D new_min =3D new_max =3D i + SCM_I_ARRAY_BASE (o= ldra); As far as I can tell, there is a bug somewhere in the SCM_I_ARRAY_BASE macro that causes things to break when oldra is a 1d uniform array.=20 The value of the array base seems to be sane for multi-dimensional arrays, but is something very strange for 1d arrays. Here's the proof: #include #include SCM show_base_wrap(SCM ra) { size_t base =3D SCM_I_ARRAY_BASE(ra); printf("base =3D %d.\n", base); return SCM_UNSPECIFIED; } void init_buggy () { scm_c_define_gsubr("show-base", 1, 0, 0, show_base_wrap); } Then the scheme code that shows this off would be: #! /bin/bash exec guile -s "$0" "$@" !# (use-modules (ice-9 format)) (setenv "LD_LIBRARY_PATH" (string-append ".:" (getenv "LD_LIBRARY_PATH"))) (load-extension "buggy" "init_buggy") (define good #2((a b c) (d e f) (g h i))) (define bad #1(a b c d e f g h i)) (format #t "This one should work:~%~!") (show-base good) (format #t "While this one should be weird.~%~!") (show-base bad) Are there any workarounds for this? BTW: GCC 3.4.4 libtool-1.5.2 SuSE 9.3 everything else. Thanks a bunch. -- Steve Juranich Tucson, AZ USA _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://lists.gnu.org/mailman/listinfo/bug-guile