From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 08 23:13:40 2015 Received: (at submit) by debbugs.gnu.org; 9 Jan 2015 04:13:40 +0000 Received: from localhost ([127.0.0.1]:40583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y9Qx9-0002uc-HJ for submit@debbugs.gnu.org; Thu, 08 Jan 2015 23:13:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34263) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y9Qx7-0002uU-7H for submit@debbugs.gnu.org; Thu, 08 Jan 2015 23:13:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9Qx5-00072P-RI for submit@debbugs.gnu.org; Thu, 08 Jan 2015 23:13:36 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Qx5-000723-OH for submit@debbugs.gnu.org; Thu, 08 Jan 2015 23:13:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Qx4-0004yO-Ev for bug-guile@gnu.org; Thu, 08 Jan 2015 23:13:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9Qx1-0006t1-95 for bug-guile@gnu.org; Thu, 08 Jan 2015 23:13:34 -0500 Received: from vms173021pub.verizon.net ([206.46.173.21]:57120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Qx1-0006rT-4s for bug-guile@gnu.org; Thu, 08 Jan 2015 23:13:31 -0500 Received: from [192.168.2.127] ([71.108.232.238]) by vms173021.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NHW007996E7O050@vms173021.mailsrvcs.net> for bug-guile@gnu.org; Thu, 08 Jan 2015 22:13:20 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=LrklEcZZ c=1 sm=1 tr=0 a=XxAusKNOGYjrkNisIOG4pA==:117 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=YNv0rlydsVwA:10 a=kv5Rj4TNoDG266CRCl4A:9 a=CjuIK1q_8ugA:10 a=yQzNEDcw1qvDQLNEPGkA:9 a=SlRytPVKvuHpOxHl:21 a=_W_S_7VecoQA:10 From: Matt Wette Content-type: multipart/alternative; boundary="Apple-Mail=_0F4EE09E-0BA3-436D-81AA-F4076A9A0BBE" Subject: minor: module path picking up ./././... Message-id: Date: Thu, 08 Jan 2015 20:13:18 -0800 To: bug-guile@gnu.org MIME-version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --Apple-Mail=_0F4EE09E-0BA3-436D-81AA-F4076A9A0BBE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii guile 2.0.11 on macos (darwin) 10.9.5. This seems very minor to but I thought I'd report it. If I ",reload" a = module in the current directory it seems to pick up extra "./" parts in = the path. ... ;;; compiling ././././././././././././lalr1.scm ;;; compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go scheme@(guile-user)> (system "touch lalr1.scm") $5 =3D 0 scheme@(guile-user)> ,reload (lalr1) ;;; note: source file ./././././././././././././lalr1.scm ;;; newer than compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go ;;; compiling ./././././././././././././lalr1.scm ;;; compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go scheme@(guile-user)> (system "touch lalr1.scm") $6 =3D 0 scheme@(guile-user)> ,reload (lalr1) ;;; note: source file ././././././././././././././lalr1.scm ;;; newer than compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go ;;; compiling ././././././././././././././lalr1.scm ;;; compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go scheme@(guile-user)>=20 --Apple-Mail=_0F4EE09E-0BA3-436D-81AA-F4076A9A0BBE Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
guile 2.0.11 on macos (darwin) = 10.9.5.

This seems very minor to but I thought = I'd report it.  If I ",reload" a module in the current directory it = seems to pick up extra "./" parts in the = path.

...
;;; compiling = ././././././././././././lalr1.scm
;;; compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go
scheme@(guile-user)> (system "touch = lalr1.scm")
$5 =3D 0
scheme@(guile-user)> ,reload = (lalr1)
;;; note: source file = ./././././././././././././lalr1.scm
;;;       newer = than compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go
;;; compiling = ./././././././././././././lalr1.scm
;;; compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go
scheme@(guile-user)> (system "touch = lalr1.scm")
$6 =3D 0
scheme@(guile-user)> ,reload = (lalr1)
;;; note: source file = ././././././././././././././lalr1.scm
;;;       newer = than compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go
;;; compiling = ././././././././././././././lalr1.scm
;;; compiled = /Users/mwette/.cache/guile/ccache/2.0-LE-8-2.0/Users/mwette/proj/scheme/my= proj/lalr1/lalr1.scm.go
scheme@(guile-user)> 

= --Apple-Mail=_0F4EE09E-0BA3-436D-81AA-F4076A9A0BBE-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 10 17:45:27 2015 Received: (at 19540) by debbugs.gnu.org; 10 Jan 2015 22:45:27 +0000 Received: from localhost ([127.0.0.1]:42209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YA4mc-0006IF-Pl for submit@debbugs.gnu.org; Sat, 10 Jan 2015 17:45:26 -0500 Received: from vms173025pub.verizon.net ([206.46.173.25]:57727) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YA4ma-0006I7-Id for 19540@debbugs.gnu.org; Sat, 10 Jan 2015 17:45:25 -0500 Received: from [192.168.2.127] ([71.108.232.238]) by vms173025.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NHZ008TRGJ1YWX0@vms173025.mailsrvcs.net> for 19540@debbugs.gnu.org; Sat, 10 Jan 2015 16:45:11 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=LrklEcZZ c=1 sm=1 tr=0 a=XxAusKNOGYjrkNisIOG4pA==:117 a=kj9zAlcOel0A:10 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=YNv0rlydsVwA:10 a=gq01_MhpKMVHvrLyoFAA:9 a=CjuIK1q_8ugA:10 From: Matt Wette Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Subject: repeated ./././ in compiled modules Message-id: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> Date: Sat, 10 Jan 2015 14:45:00 -0800 To: 19540@debbugs.gnu.org MIME-version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19540 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Some more info: 1) I found that this problem persists across restarts of guile. I have = been debugging a module in current dir and I am seeing the path extend = an extra "./" every time I type ",reload (lalr1). 2) My environment includes GUILE_LOAD_PATH=3D.:/Users/mwette/opt/guile 3) If I change the above to the following, the problem goes away (but = the following solution not satisfactory IMO). GUILE_LOAD_PATH=3D:/Users/mwette/opt/guile # dot replaced with blank Take care, Matt From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 18 11:09:36 2015 Received: (at 19540) by debbugs.gnu.org; 18 Jan 2015 16:09:36 +0000 Received: from localhost ([127.0.0.1]:60713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YCsPw-0003OP-6Z for submit@debbugs.gnu.org; Sun, 18 Jan 2015 11:09:36 -0500 Received: from vms173019pub.verizon.net ([206.46.173.19]:33882) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YCsPu-0003OD-Mt for 19540@debbugs.gnu.org; Sun, 18 Jan 2015 11:09:35 -0500 Received: from [192.168.2.127] ([71.108.234.224]) by vms173019.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NID007C6RJKHT60@vms173019.mailsrvcs.net> for 19540@debbugs.gnu.org; Sun, 18 Jan 2015 10:09:27 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=Ko/6AtSI c=1 sm=1 tr=0 a=4GYO7MqD+LEvu06q0FvZQA==:117 a=kj9zAlcOel0A:10 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=YNv0rlydsVwA:10 a=QMmUPJquUlPQ8Y072_8A:9 a=CjuIK1q_8ugA:10 a=A-Gcv8gqjawA:10 a=O84xABmlfPwA:10 a=HmigYwTcqSQA:10 From: Matt Wette Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Subject: also generates problem for debugger tracebacks Message-id: Date: Sun, 18 Jan 2015 08:09:20 -0800 To: 19540@debbugs.gnu.org MIME-version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19540 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) I had another problem with the "." in my GUILE_LOAD_PATH, I believe. If my code encountered an error, the debugger traceback would not list = file/line information.= From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 19 15:28:10 2015 Received: (at 19540) by debbugs.gnu.org; 19 Jan 2015 20:28:10 +0000 Received: from localhost ([127.0.0.1]:49891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YDIvh-0004qF-RI for submit@debbugs.gnu.org; Mon, 19 Jan 2015 15:28:10 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:54707) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YDIvf-0004q4-43 for 19540@debbugs.gnu.org; Mon, 19 Jan 2015 15:28:07 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 6BE9C454F; Mon, 19 Jan 2015 21:28:06 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uavSR8+sAyel; Mon, 19 Jan 2015 21:28:06 +0100 (CET) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 10AB719D7; Mon, 19 Jan 2015 21:28:05 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Matt Wette Subject: Re: bug#19540: repeated ./././ in compiled modules References: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> Date: Mon, 19 Jan 2015 21:28:05 +0100 In-Reply-To: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> (Matt Wette's message of "Sat, 10 Jan 2015 14:45:00 -0800") Message-ID: <877fwiy0q2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 19540 Cc: 19540@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Matt Wette skribis: > 1) I found that this problem persists across restarts of guile. I have b= een debugging a module in current dir and I am seeing the path extend an ex= tra "./" every time I type ",reload (lalr1). > > 2) My environment includes > GUILE_LOAD_PATH=3D.:/Users/mwette/opt/guile The problem stems from the =E2=80=98.=E2=80=99 entry in the search path. O= n one hand this is perfectly valid; on the other hand, it=E2=80=99s usually frowned up= on, because you may end up executing possibly malicious code that just happens to be in $PWD. All in all, I recommend using only absolute directory names in the search paths, which will also solve the initial problem. Can you confirm? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 19 17:19:48 2015 Received: (at 19540) by debbugs.gnu.org; 19 Jan 2015 22:19:48 +0000 Received: from localhost ([127.0.0.1]:49906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YDKfj-0007XC-UP for submit@debbugs.gnu.org; Mon, 19 Jan 2015 17:19:48 -0500 Received: from vms173017pub.verizon.net ([206.46.173.17]:43768) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YDKfh-0007Wz-Vf for 19540@debbugs.gnu.org; Mon, 19 Jan 2015 17:19:46 -0500 Received: from [192.168.2.127] ([71.108.234.224]) by vms173017.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NIG00BX23CBEQ30@vms173017.mailsrvcs.net> for 19540@debbugs.gnu.org; Mon, 19 Jan 2015 16:19:25 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=CoYIqc8G c=1 sm=1 tr=0 a=4GYO7MqD+LEvu06q0FvZQA==:117 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=YNv0rlydsVwA:10 a=mDV3o1hIAAAA:8 a=IWPIhUFVpLZhUxBJGKAA:9 a=nqggFft_mDtrloIj:21 a=66H0nNvgSFE_7gN4:21 a=pILNOxqGKmIA:10 a=dZ0fnHXVBqyF9aAhS90A:9 a=Bp_7goOo2YYoqd4B:21 a=H96xmX4OuXTWQYpP:21 a=sX1Mi9glhXCGS7Gs:21 a=_W_S_7VecoQA:10 Content-type: multipart/alternative; boundary="Apple-Mail=_EDF9470D-7EC1-43DC-9AFA-E41CA45F89F7" MIME-version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: bug#19540: repeated ./././ in compiled modules From: Matt Wette In-reply-to: <877fwiy0q2.fsf@gnu.org> Date: Mon, 19 Jan 2015 14:19:22 -0800 Message-id: <093940B7-4480-4FD4-A0AD-0B19B6FEECDB@alumni.caltech.edu> References: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> <877fwiy0q2.fsf@gnu.org> To: =?iso-8859-1?Q?Ludovic_Court=E8s?= X-Mailer: Apple Mail (2.1878.6) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19540 Cc: 19540@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --Apple-Mail=_EDF9470D-7EC1-43DC-9AFA-E41CA45F89F7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Absolute paths work. But this is really unsatisfactory IMO. I develop = code in modules and do so in many directories. It would be quite = painful to just use absolute paths. I don't see what the big security thread is. If really a problem, why = does guile allow relative paths? For comparison, Python will load modules in the current directory. Nonetheless, I think "." is breaking the traceback with the "./" being = added on reload. When I was using "." I wasn't getting file, line = information in tracebacks. Now, without GUILE_LOAD_PATH set to = ":$HOME/opt/guile" I get traceback info for modules in my current = directory. I think the following may be a candidate fix? code is from guile-2.0.11, in file boot-9.scm, near line 1683: (define (in-vicinity vicinity file) (let ((tail (let ((len (string-length vicinity))) (if (zero? len) #f (string-ref vicinity (- len 1)))))) (string-append vicinity (if (or (not tail) (file-name-separator? tail)) "" file-name-separator-string) file))) ;; FIX? (define (new-in-vicinity vicinity file) (let ((tail (let ((len (string-length vicinity))) (if (or (zero? len) (string=3D? "." vicinity)) #f (string-ref vicinity (- len 1)))))) (string-append vicinity (if (or (not tail) (file-name-separator? tail)) "" file-name-separator-string) file))) On Jan 19, 2015, at 12:28 PM, Ludovic Court=E8s wrote: > Matt Wette skribis: >=20 >> 1) I found that this problem persists across restarts of guile. I = have been debugging a module in current dir and I am seeing the path = extend an extra "./" every time I type ",reload (lalr1). >>=20 >> 2) My environment includes >> GUILE_LOAD_PATH=3D.:/Users/mwette/opt/guile >=20 > The problem stems from the =91.=92 entry in the search path. On one = hand > this is perfectly valid; on the other hand, it=92s usually frowned = upon, > because you may end up executing possibly malicious code that just > happens to be in $PWD. >=20 > All in all, I recommend using only absolute directory names in the > search paths, which will also solve the initial problem. >=20 > Can you confirm? >=20 > Thanks, > Ludo=92. --Apple-Mail=_EDF9470D-7EC1-43DC-9AFA-E41CA45F89F7 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 Absolute paths work.  But this is really = unsatisfactory IMO.  I develop code in modules and do so in many = directories.  It would be quite painful to just use absolute = paths.

I don't see what the big security thread = is.   If really a problem, why does guile allow relative = paths?

For comparison, Python will load = modules in the current directory.

Nonetheless, = I think "." is breaking the traceback with the "./" being added on = reload.  When I was using "." I wasn't getting file, line = information in tracebacks.  Now, without GUILE_LOAD_PATH set to = ":$HOME/opt/guile" I get traceback info for modules in my current = directory.

I think the following may be a = candidate fix?

code is from guile-2.0.11, in = file boot-9.scm, near line 1683:

(define (in-vicinity vicinity file)
  (let = ((tail (let ((len (string-length vicinity)))
        =         (if (zero? len)
        =             #f
        =             (string-ref vicinity (- len = 1))))))
    (string-append vicinity
       =             (if (or (not tail) = (file-name-separator? tail))
           =             ""
       =                 = file-name-separator-string)
           =         file)))
;; FIX?
(define (new-in-vicinity = vicinity file)
  (let ((tail (let ((len (string-length = vicinity)))
              =   (if (or (zero? len) (string=3D? "." vicinity))
  =                   = #f
                  =   (string-ref vicinity (- len 1))))))
    (string-append = vicinity
                 =   (if (or (not tail) (file-name-separator? tail))
   =                     = ""
                 =       file-name-separator-string)
   =                 = file)))


On Jan = 19, 2015, at 12:28 PM, Ludovic Court=E8s <ludo@gnu.org> wrote:

Matt Wette = <mwette@alumni.caltech.edu>= ; skribis:

1) I found that this problem = persists across restarts of guile.  I have been debugging a module = in current dir and I am seeing the path extend an extra "./" every time = I type ",reload (lalr1).

2) My environment includes
=   GUILE_LOAD_PATH=3D.:/Users/mwette/opt/guile
The problem stems from the =91.=92 entry in the search path.  On = one hand
this is perfectly valid; on the other hand, it=92s usually = frowned upon,
because you may end up executing possibly malicious = code that just
happens to be in $PWD.

All in all, I recommend = using only absolute directory names in the
search paths, which will = also solve the initial problem.

Can you = confirm?

Thanks,
Ludo=92.

= --Apple-Mail=_EDF9470D-7EC1-43DC-9AFA-E41CA45F89F7-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 20 16:12:16 2015 Received: (at 19540) by debbugs.gnu.org; 20 Jan 2015 21:12:16 +0000 Received: from localhost ([127.0.0.1]:51087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YDg5w-0007Rc-98 for submit@debbugs.gnu.org; Tue, 20 Jan 2015 16:12:16 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:56187) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YDg5t-0007RT-Ki for 19540@debbugs.gnu.org; Tue, 20 Jan 2015 16:12:14 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 1E642455A; Tue, 20 Jan 2015 22:12:12 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tbMt72h--Kvz; Tue, 20 Jan 2015 22:12:12 +0100 (CET) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id B41413D63; Tue, 20 Jan 2015 22:12:11 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Matt Wette Subject: Re: bug#19540: repeated ./././ in compiled modules References: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> <877fwiy0q2.fsf@gnu.org> <093940B7-4480-4FD4-A0AD-0B19B6FEECDB@alumni.caltech.edu> Date: Tue, 20 Jan 2015 22:12:11 +0100 In-Reply-To: <093940B7-4480-4FD4-A0AD-0B19B6FEECDB@alumni.caltech.edu> (Matt Wette's message of "Mon, 19 Jan 2015 14:19:22 -0800") Message-ID: <87iog117is.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 19540 Cc: 19540@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Matt Wette skribis: > Absolute paths work. But this is really unsatisfactory IMO. I develop c= ode in modules and do so in many directories. It would be quite painful to= just use absolute paths. > > I don't see what the big security thread is. Suppose we=E2=80=99re working on the same machine and I install /tmp/ice-9/regex.scm (say), which just does: (system "rm -rf /") If I can tweak you into running Guile with /tmp as its current working directory, you lose. > If really a problem, why does guile allow relative paths? > > For comparison, Python will load modules in the current directory. > > Nonetheless, I think "." is breaking the traceback with the "./" being > added on reload. When I was using "." I wasn't getting file, line > information in tracebacks. Now, without GUILE_LOAD_PATH set to > ":$HOME/opt/guile" I get traceback info for modules in my current > directory. Actually the problem stems from the =E2=80=9Cfile name relative canonicalization=E2=80=9D, the process by which Guile attaches a file name relative to the search path to an open port: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (add-to-load-path ".") scheme@(guile-user)> %load-path $2 =3D ("." [...]) scheme@(guile-user)> (getcwd) $3 =3D "/home/ludo/src/guile/module/ice-9" scheme@(guile-user)> (open-input-file (search-path %load-path "boot-9.scm")) $4 =3D # scheme@(guile-user)> (open-input-file (search-path %load-path "./boot-9.scm= ")) $5 =3D # scheme@(guile-user)> (open-input-file (search-path %load-path "././boot-9.s= cm")) $6 =3D # --8<---------------cut here---------------end--------------->8--- This could be fixed either in =E2=80=98search-path=E2=80=99 or in =E2=80=98scm_i_relativize_path=E2=80=99, but the former sounds like a bette= r place. However, I=E2=80=99m unsure of the effect of changing the result of =E2=80=98search-path=E2=80=99 in those cases, so I=E2=80=99d rather leave t= hings unchanged. Thoughts? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 23 04:36:53 2016 Received: (at 19540-done) by debbugs.gnu.org; 23 Jun 2016 08:36:53 +0000 Received: from localhost ([127.0.0.1]:51759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bG085-0008B2-H9 for submit@debbugs.gnu.org; Thu, 23 Jun 2016 04:36:53 -0400 Received: from pb-sasl2.pobox.com ([64.147.108.67]:61328 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bG084-0008Au-5e for 19540-done@debbugs.gnu.org; Thu, 23 Jun 2016 04:36:52 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 4ABD81EFAE; Thu, 23 Jun 2016 04:36:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=mBm3JbusKNyv offUh9yVD2BzuLI=; b=heXHCdhEy9MrjOzObb5Ju6GTy9NNdZIdN6azR/4LO44Q uO2gpqX+At5PwqJX4s99DYoVXiIShz9zyNMTfpHyybgB+UgfVgrFkmGASNbMsaIB FnvwFE+zwSHeYpOcA3TA/MoWU+a+nCfZBZJAX0DXnBX/JtL4sP8L4IzvPrneDQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=cv5htG kcDLpZ1TtWhRYiVuI4G8R7YK4MjINDe4WRbDf/Q/PDtVCsmOHolhbj/JoLupMPx0 dBx3Yva5KTi3MpvkJihslrmfLuLKlv2ZGkp0WFHX0m1l+VCGW5cFUnmI2p3VoaEO 30wywUC4cyxTycPKbd+kyqbUCtpyFsVhoQe3M= Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 41E041EFAB; Thu, 23 Jun 2016 04:36:49 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id 4644F1EFAA; Thu, 23 Jun 2016 04:36:48 -0400 (EDT) From: Andy Wingo To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#19540: repeated ./././ in compiled modules References: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> <877fwiy0q2.fsf@gnu.org> <093940B7-4480-4FD4-A0AD-0B19B6FEECDB@alumni.caltech.edu> <87iog117is.fsf@gnu.org> Date: Thu, 23 Jun 2016 10:36:41 +0200 In-Reply-To: <87iog117is.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 20 Jan 2015 22:12:11 +0100") Message-ID: <871t3oqp2e.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: A02FD256-391D-11E6-BEB6-28A6F1301B6D-02397024!pb-sasl2.pobox.com X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 19540-done Cc: 19540-done@debbugs.gnu.org, Matt Wette X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hi! On Tue 20 Jan 2015 22:12, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > scheme@(guile-user)> (add-to-load-path ".") > scheme@(guile-user)> %load-path > $2 =3D ("." [...]) > scheme@(guile-user)> (getcwd) > $3 =3D "/home/ludo/src/guile/module/ice-9" > scheme@(guile-user)> (open-input-file (search-path %load-path "boot-9.scm= ")) > $4 =3D # > scheme@(guile-user)> (open-input-file (search-path %load-path "./boot-9.s= cm")) > $5 =3D # > scheme@(guile-user)> (open-input-file (search-path %load-path "././boot-9= .scm")) > $6 =3D # > > This could be fixed either in =E2=80=98search-path=E2=80=99 or in > =E2=80=98scm_i_relativize_path=E2=80=99, but the former sounds like a bet= ter place. I think the latter is actually better. `relativize-path' tries to find an element of %load-path which is a prefix of *the canonicalized version of* a file name. We can't expect that to work unless we also canonicalize the elements of %load-path, for the purposes of relativizing. We don't want to canonicalize them eagerly or persistently, as that would access symlinks at the wrong time; just as needed inside relativize-path. I pushed the attached fix to master. If it sounds good to you let's push it to stable-2.0 as well. WDYT? Andy commit 9a951678713557b548415d32eae6d63d039bf652 Author: Andy Wingo Date: Thu Jun 23 10:03:10 2016 +0200 Fix relative file name canonicalization on paths with "." =20=20=20=20 * libguile/filesys.c (scm_i_relativize_path): Canonicalize the file names elements that we will be using as prefixes. Fixes the case where a load path contains a relative file name: #19540. * test-suite/tests/ports.test ("%file-port-name-canonicalization"): Add tests that elements of the load path are canonicalized. diff --git a/libguile/filesys.c b/libguile/filesys.c index 7674498..25501ef 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -1614,22 +1614,40 @@ SCM_DEFINE (scm_canonicalize_path, "canonicalize-pa= th", 1, 0, 0, SCM scm_i_relativize_path (SCM path, SCM in_path) { - char *str, *canon; SCM scanon; =20=20=20 - str =3D scm_to_locale_string (path); - canon =3D canonicalize_file_name (str); - free (str); -=20=20 - if (!canon) - return SCM_BOOL_F; + { + char *str, *canon; =20 - scanon =3D scm_take_locale_string (canon); + str =3D scm_to_locale_string (path); + canon =3D canonicalize_file_name (str); + free (str); =20 + if (!canon) + return SCM_BOOL_F; + + scanon =3D scm_take_locale_string (canon); + } +=20=20 for (; scm_is_pair (in_path); in_path =3D scm_cdr (in_path)) { SCM dir =3D scm_car (in_path); - size_t len =3D scm_c_string_length (dir); + size_t len; + + /* Try to canonicalize DIR, since we have canonicalized PATH. */ + { + char *str, *canon; + + str =3D scm_to_locale_string (dir); + canon =3D canonicalize_file_name (str); + free (str); +=20=20 + if (canon) + dir =3D scm_from_locale_string (canon); + free (canon); + } + + len =3D scm_c_string_length (dir); =20 /* When DIR is empty, it means "current working directory". We could set DIR to (getcwd) in that case, but then the diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test index dfa430e..ea8eaa7 100644 --- a/test-suite/tests/ports.test +++ b/test-suite/tests/ports.test @@ -1865,14 +1865,15 @@ (with-fluids ((%file-port-name-canonicalization 'relative)) (port-filename (open-input-file "/dev/null"))))) =20 + (pass-if-equal "relative canonicalization with /dev/.." "dev/null" + (with-load-path (cons "/dev/.." %load-path) + (with-fluids ((%file-port-name-canonicalization 'relative)) + (port-filename (open-input-file "/dev/null"))))) + (pass-if-equal "relative canonicalization from ice-9" "ice-9/q.scm" - ;; If an entry in %LOAD-PATH is not canonical, then - ;; `scm_i_relativize_path' is unable to do its job. - (if (equal? (map canonicalize-path %load-path) %load-path) - (with-fluids ((%file-port-name-canonicalization 'relative)) - (port-filename - (open-input-file (%search-load-path "ice-9/q.scm")))) - (throw 'unresolved))) + (with-fluids ((%file-port-name-canonicalization 'relative)) + (port-filename + (open-input-file (%search-load-path "ice-9/q.scm"))))) =20 (pass-if-equal "absolute canonicalization from ice-9" (canonicalize-path From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 23 09:06:41 2016 Received: (at 19540-done) by debbugs.gnu.org; 23 Jun 2016 13:06:41 +0000 Received: from localhost ([127.0.0.1]:51922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bG4LA-00012V-VG for submit@debbugs.gnu.org; Thu, 23 Jun 2016 09:06:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bG4L9-00012I-Gm for 19540-done@debbugs.gnu.org; Thu, 23 Jun 2016 09:06:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG4L1-0003Yf-DS for 19540-done@debbugs.gnu.org; Thu, 23 Jun 2016 09:06:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG4L1-0003YN-A7; Thu, 23 Jun 2016 09:06:31 -0400 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:52116 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bG4Kz-0002OJ-CC; Thu, 23 Jun 2016 09:06:29 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Andy Wingo Subject: Re: bug#19540: repeated ./././ in compiled modules References: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> <877fwiy0q2.fsf@gnu.org> <093940B7-4480-4FD4-A0AD-0B19B6FEECDB@alumni.caltech.edu> <87iog117is.fsf@gnu.org> <871t3oqp2e.fsf@pobox.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Messidor an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 23 Jun 2016 15:06:27 +0200 In-Reply-To: <871t3oqp2e.fsf@pobox.com> (Andy Wingo's message of "Thu, 23 Jun 2016 10:36:41 +0200") Message-ID: <87k2hgoy0c.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 19540-done Cc: 19540-done@debbugs.gnu.org, Matt Wette X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) Andy Wingo skribis: > commit 9a951678713557b548415d32eae6d63d039bf652 > Author: Andy Wingo > Date: Thu Jun 23 10:03:10 2016 +0200 > > Fix relative file name canonicalization on paths with "." >=20=20=20=20=20 > * libguile/filesys.c (scm_i_relativize_path): Canonicalize the file > names elements that we will be using as prefixes. Fixes the case > where a load path contains a relative file name: #19540. > * test-suite/tests/ports.test ("%file-port-name-canonicalization"): A= dd > tests that elements of the load path are canonicalized. > > diff --git a/libguile/filesys.c b/libguile/filesys.c > index 7674498..25501ef 100644 > --- a/libguile/filesys.c > +++ b/libguile/filesys.c > @@ -1614,22 +1614,40 @@ SCM_DEFINE (scm_canonicalize_path, "canonicalize-= path", 1, 0, 0, > SCM > scm_i_relativize_path (SCM path, SCM in_path) [...] > for (; scm_is_pair (in_path); in_path =3D scm_cdr (in_path)) > { > SCM dir =3D scm_car (in_path); > - size_t len =3D scm_c_string_length (dir); > + size_t len; > + > + /* Try to canonicalize DIR, since we have canonicalized PATH. */ > + { > + char *str, *canon; > + > + str =3D scm_to_locale_string (dir); > + canon =3D canonicalize_file_name (str); > + free (str); > +=20=20 > + if (canon) > + dir =3D scm_from_locale_string (canon); > + free (canon); > + } > + > + len =3D scm_c_string_length (dir); >=20=20 > /* When DIR is empty, it means "current working directory". We > could set DIR to (getcwd) in that case, but then the =E2=80=98canonicalize_file_name=E2=80=99 is costly: roughly one syscall per= file name component. IIUC, =E2=80=98canonicalize_file_name=E2=80=99 is now called once for each = =E2=80=98%load-path=E2=80=99 entry and file name that we canonicalize. Is this correct? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 23 12:03:25 2016 Received: (at 19540-done) by debbugs.gnu.org; 23 Jun 2016 16:03:25 +0000 Received: from localhost ([127.0.0.1]:52846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bG76D-0005qr-9U for submit@debbugs.gnu.org; Thu, 23 Jun 2016 12:03:25 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:65521 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bG76B-0005qk-Ox for 19540-done@debbugs.gnu.org; Thu, 23 Jun 2016 12:03:24 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 76FB92426F; Thu, 23 Jun 2016 12:03:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=Pmcx3O2T6Bns QE5AHc7S5pz2aF4=; b=Qubf8F13CEPgTRGxocC5qMEXyY8Zv1nEoKYpqGSBi/V6 UvyJwaIWtoKph6akMZL6mdhnmZjfdonl2d6U1lNbj97F66VCpfhrIoO5se6ojvge P6uD1uC35vk/BMiq0h454gN63IhdC3XrhdqlkJaA2oVXChC8bH9jC8G6RWNKiVQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=pZ8u+T e0Y4eKKQlCN8/3wsatWvmEYq1YmYPvWmZIhNAw0hWIvudRpQ6bBZeHQIYMjEJUTO 4FCDRM0sVZPL77AvTiwGnqe1vsDPVVaxLEuE5ZqIHMgz/FiEujJxWkeRJyTe7xbA AHIkH4MWrXxj7F0jx+yl74dPjfNaNxip4gv0A= Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 5B2592426E; Thu, 23 Jun 2016 12:03:23 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 7522E2426D; Thu, 23 Jun 2016 12:03:22 -0400 (EDT) From: Andy Wingo To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#19540: repeated ./././ in compiled modules References: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> <877fwiy0q2.fsf@gnu.org> <093940B7-4480-4FD4-A0AD-0B19B6FEECDB@alumni.caltech.edu> <87iog117is.fsf@gnu.org> <871t3oqp2e.fsf@pobox.com> <87k2hgoy0c.fsf@gnu.org> Date: Thu, 23 Jun 2016 18:03:15 +0200 In-Reply-To: <87k2hgoy0c.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 23 Jun 2016 15:06:27 +0200") Message-ID: <87fus3opto.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: 02BEE860-395C-11E6-ACD7-C1836462E9F6-02397024!pb-sasl1.pobox.com X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 19540-done Cc: 19540-done@debbugs.gnu.org, Matt Wette X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hi :) On Thu 23 Jun 2016 15:06, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Andy Wingo skribis: > >> commit 9a951678713557b548415d32eae6d63d039bf652 >> Author: Andy Wingo >> Date: Thu Jun 23 10:03:10 2016 +0200 >> >> Fix relative file name canonicalization on paths with "." >>=20=20=20=20=20 >> * libguile/filesys.c (scm_i_relativize_path): Canonicalize the file >> names elements that we will be using as prefixes. Fixes the case >> where a load path contains a relative file name: #19540. >> * test-suite/tests/ports.test ("%file-port-name-canonicalization"): = Add >> tests that elements of the load path are canonicalized. >> > =E2=80=98canonicalize_file_name=E2=80=99 is costly: roughly one syscall p= er file name > component. > > IIUC, =E2=80=98canonicalize_file_name=E2=80=99 is now called once for eac= h =E2=80=98%load-path=E2=80=99 > entry and file name that we canonicalize. Is this correct? That's correct, but only for relative canonicalization, which is in practive only when loading Scheme files from source. Seems out of the hot path; what do you think? Andy From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 24 04:28:55 2016 Received: (at 19540-done) by debbugs.gnu.org; 24 Jun 2016 08:28:55 +0000 Received: from localhost ([127.0.0.1]:53356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGMTv-0001vZ-7E for submit@debbugs.gnu.org; Fri, 24 Jun 2016 04:28:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGMTu-0001vK-0Q for 19540-done@debbugs.gnu.org; Fri, 24 Jun 2016 04:28:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGMTk-0005fY-So for 19540-done@debbugs.gnu.org; Fri, 24 Jun 2016 04:28:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGMTk-0005fT-PT; Fri, 24 Jun 2016 04:28:44 -0400 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:47624 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bGMTj-0006NL-SV; Fri, 24 Jun 2016 04:28:44 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Andy Wingo Subject: Re: bug#19540: repeated ./././ in compiled modules References: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> <877fwiy0q2.fsf@gnu.org> <093940B7-4480-4FD4-A0AD-0B19B6FEECDB@alumni.caltech.edu> <87iog117is.fsf@gnu.org> <871t3oqp2e.fsf@pobox.com> <87k2hgoy0c.fsf@gnu.org> <87fus3opto.fsf@pobox.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Messidor an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Fri, 24 Jun 2016 10:28:41 +0200 In-Reply-To: <87fus3opto.fsf@pobox.com> (Andy Wingo's message of "Thu, 23 Jun 2016 18:03:15 +0200") Message-ID: <87twgj9eiu.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 19540-done Cc: 19540-done@debbugs.gnu.org, Matt Wette X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) Hello! Andy Wingo skribis: > On Thu 23 Jun 2016 15:06, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Andy Wingo skribis: >> >>> commit 9a951678713557b548415d32eae6d63d039bf652 >>> Author: Andy Wingo >>> Date: Thu Jun 23 10:03:10 2016 +0200 >>> >>> Fix relative file name canonicalization on paths with "." >>>=20=20=20=20=20 >>> * libguile/filesys.c (scm_i_relativize_path): Canonicalize the file >>> names elements that we will be using as prefixes. Fixes the case >>> where a load path contains a relative file name: #19540. >>> * test-suite/tests/ports.test ("%file-port-name-canonicalization"):= Add >>> tests that elements of the load path are canonicalized. >>> >> =E2=80=98canonicalize_file_name=E2=80=99 is costly: roughly one syscall = per file name >> component. >> >> IIUC, =E2=80=98canonicalize_file_name=E2=80=99 is now called once for ea= ch =E2=80=98%load-path=E2=80=99 >> entry and file name that we canonicalize. Is this correct? > > That's correct, but only for relative canonicalization, which is in > practive only when loading Scheme files from source. Seems out of the > hot path; what do you think? I think it=E2=80=99s likely to have a noticeable impact on startup time for projects with a large number of modules like Guix. For instance, commands like =E2=80=98guix package -A=E2=80=99 or =E2=80=98g= uix build foo=E2=80=99 load all the modules. The impact will be smaller on a laptop with an SSD than on an NFS mount, where it=E2=80=99s likely going to be terrrible (this could be tested using the =E2=80=98delay=E2=80=99 device mapper.) WDYT? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 24 04:49:25 2016 Received: (at 19540-done) by debbugs.gnu.org; 24 Jun 2016 08:49:25 +0000 Received: from localhost ([127.0.0.1]:53386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGMnk-0002UE-W2 for submit@debbugs.gnu.org; Fri, 24 Jun 2016 04:49:25 -0400 Received: from pb-sasl2.pobox.com ([64.147.108.67]:59342 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGMnj-0002U7-SW for 19540-done@debbugs.gnu.org; Fri, 24 Jun 2016 04:49:24 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 7272020EA4; Fri, 24 Jun 2016 04:49:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=Be6SHy8IjW/z ezDwAqiHxXmIO2I=; b=MJC/pcVCLUqTnOYGh3v2fvrvQk2TwEjoRviQjObWSbrc 0Y+pq32uMFrln4yLGgcTBMgpfsk/yJvtr6AjYwm9O/KVif37A3Zsu7FXUJqbPyE9 7JXbQjXDRc7ENwas/CCHRTqLzAf0EpS+14u79yuvQWFRvraFLeIzQUuiYo1dLdk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=DK8uiC +I0fday0TIJX/PPWcBGoWsmF0oX0+4gotXNxchjcHH8R8vTvFViZobgSqOletf1B HZYxGxcQUxONeZ4viJh2P7V39M4mXhZKWYsazuwPYehLI9sllaitCqh3upxeW8rX e3qlXnJ8+AyeslMTc4FbG8orB8nZ+jSj77KII= Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id 5A62C20EA2; Fri, 24 Jun 2016 04:49:21 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id 3D58520EA1; Fri, 24 Jun 2016 04:49:19 -0400 (EDT) From: Andy Wingo To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#19540: repeated ./././ in compiled modules References: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> <877fwiy0q2.fsf@gnu.org> <093940B7-4480-4FD4-A0AD-0B19B6FEECDB@alumni.caltech.edu> <87iog117is.fsf@gnu.org> <871t3oqp2e.fsf@pobox.com> <87k2hgoy0c.fsf@gnu.org> <87fus3opto.fsf@pobox.com> <87twgj9eiu.fsf@gnu.org> Date: Fri, 24 Jun 2016 10:49:12 +0200 In-Reply-To: <87twgj9eiu.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Fri, 24 Jun 2016 10:28:41 +0200") Message-ID: <87fus3geev.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: 8ADD2810-39E8-11E6-8B69-28A6F1301B6D-02397024!pb-sasl2.pobox.com X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 19540-done Cc: 19540-done@debbugs.gnu.org, Matt Wette X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hi :) On Fri 24 Jun 2016 10:28, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hello! > > Andy Wingo skribis: > >> On Thu 23 Jun 2016 15:06, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> >>> =E2=80=98canonicalize_file_name=E2=80=99 is costly: roughly one syscall= per file name >>> component. >>> >>> IIUC, =E2=80=98canonicalize_file_name=E2=80=99 is now called once for e= ach =E2=80=98%load-path=E2=80=99 >>> entry and file name that we canonicalize. Is this correct? >> >> That's correct, but only for relative canonicalization, which is in >> practive only when loading Scheme files from source. Seems out of the >> hot path; what do you think? > > I think it=E2=80=99s likely to have a noticeable impact on startup time f= or > projects with a large number of modules like Guix. Aren't they usually compiled? Loading compiled files will not go through this path AFAIU. > For instance, commands like =E2=80=98guix package -A=E2=80=99 or =E2=80= =98guix build foo=E2=80=99 load > all the modules. The impact will be smaller on a laptop with an SSD > than on an NFS mount, where it=E2=80=99s likely going to be terrrible (th= is > could be tested using the =E2=80=98delay=E2=80=99 device mapper.) Oh I'm with you that we need to be careful here. I am under the impression though that there's no additional impact here because this is just something that happens at compile-time. Or if you load a source file, but in that case you're evaluating and expecting a perf loss is not the end of the world. Andy From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 24 05:41:22 2016 Received: (at 19540-done) by debbugs.gnu.org; 24 Jun 2016 09:41:22 +0000 Received: from localhost ([127.0.0.1]:53431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGNc1-0003r3-S3 for submit@debbugs.gnu.org; Fri, 24 Jun 2016 05:41:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37187) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGNc0-0003qn-KL for 19540-done@debbugs.gnu.org; Fri, 24 Jun 2016 05:41:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGNbr-0000MN-6H for 19540-done@debbugs.gnu.org; Fri, 24 Jun 2016 05:41:15 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNbr-0000Ll-3I; Fri, 24 Jun 2016 05:41:11 -0400 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:48156 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bGNbp-0008TK-0R; Fri, 24 Jun 2016 05:41:09 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Andy Wingo Subject: Re: bug#19540: repeated ./././ in compiled modules References: <188846A3-246A-49DB-95F0-37FEE6903C85@alumni.caltech.edu> <877fwiy0q2.fsf@gnu.org> <093940B7-4480-4FD4-A0AD-0B19B6FEECDB@alumni.caltech.edu> <87iog117is.fsf@gnu.org> <871t3oqp2e.fsf@pobox.com> <87k2hgoy0c.fsf@gnu.org> <87fus3opto.fsf@pobox.com> <87twgj9eiu.fsf@gnu.org> <87fus3geev.fsf@pobox.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Messidor an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Fri, 24 Jun 2016 11:41:06 +0200 In-Reply-To: <87fus3geev.fsf@pobox.com> (Andy Wingo's message of "Fri, 24 Jun 2016 10:49:12 +0200") Message-ID: <87inwy9b65.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 19540-done Cc: 19540-done@debbugs.gnu.org, Matt Wette X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) Andy Wingo skribis: > On Fri 24 Jun 2016 10:28, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Hello! >> >> Andy Wingo skribis: >> >>> On Thu 23 Jun 2016 15:06, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >>> >>>> =E2=80=98canonicalize_file_name=E2=80=99 is costly: roughly one syscal= l per file name >>>> component. >>>> >>>> IIUC, =E2=80=98canonicalize_file_name=E2=80=99 is now called once for = each =E2=80=98%load-path=E2=80=99 >>>> entry and file name that we canonicalize. Is this correct? >>> >>> That's correct, but only for relative canonicalization, which is in >>> practive only when loading Scheme files from source. Seems out of the >>> hot path; what do you think? >> >> I think it=E2=80=99s likely to have a noticeable impact on startup time = for >> projects with a large number of modules like Guix. > > Aren't they usually compiled? Loading compiled files will not > go through this path AFAIU. Good point, I had overlooked that. >> For instance, commands like =E2=80=98guix package -A=E2=80=99 or =E2=80= =98guix build foo=E2=80=99 load >> all the modules. The impact will be smaller on a laptop with an SSD >> than on an NFS mount, where it=E2=80=99s likely going to be terrrible (t= his >> could be tested using the =E2=80=98delay=E2=80=99 device mapper.) > > Oh I'm with you that we need to be careful here. I am under the > impression though that there's no additional impact here because this is > just something that happens at compile-time. Or if you load a source > file, but in that case you're evaluating and expecting a perf loss is > not the end of the world. Indeed, this makes sense to me now; sorry for the confusion! Ludo=E2=80=99. From unknown Tue Jun 17 22:07:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 22 Jul 2016 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator