From owner-freebsd-tcltk@FreeBSD.ORG Mon Jul 15 08:06:51 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 150EE784 for ; Mon, 15 Jul 2013 08:06:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 60B54A2 for ; Mon, 15 Jul 2013 08:06:49 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA06039 for ; Mon, 15 Jul 2013 11:06:41 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uydns-000GCX-UJ for tcltk@FreeBSD.org; Mon, 15 Jul 2013 11:06:40 +0300 Message-ID: <51E3AD58.6030001@FreeBSD.org> Date: Mon, 15 Jul 2013 11:05:44 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: tcltk@FreeBSD.org Subject: weird problem with git gui X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 08:06:51 -0000 I started having some weird problems with "git gui" command after a recent massive upgrade of ports (the last one was > 3 months ago), which also included updates of tcl and tk. Here is a small snippet from modified tcl/tk code in /usr/local/libexec/git-core/git-gui: catch {puts "1GIT_DIR is $env(GIT_DIR)"} # added by me menu .mbar -tearoff 0 catch {puts "2GIT_DIR is $env(GIT_DIR)"} # added by me I think the following output speaks for itself: 1GIT_DIR is .git 2GIT_DIR as .git.git I am very puzzled as to why the 'menu' command would cause such a detrimental change to the environment. I am trying to debug this issue right now. I see that there is a call to TclSetupEnv() (from generic/tclEnv.c) when 'menu' is executed. Any hints and suggestions are very appreciated! I'll get back with any additional details I discover. -- Andriy Gapon From owner-freebsd-tcltk@FreeBSD.ORG Mon Jul 15 08:32:52 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0F5A263; Mon, 15 Jul 2013 08:32:52 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from cpanel09.rubas.ch (cpanel09.rubas.ch [195.182.222.79]) by mx1.freebsd.org (Postfix) with ESMTP id 81D4F6B1; Mon, 15 Jul 2013 08:32:52 +0000 (UTC) Received: from 98-41.199-178.cust.bluewin.ch ([178.199.41.98]:64803 helo=gahrfit.gahr.ch) by cpanel09.rubas.ch with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1UyeD6-003Lsz-Bn; Mon, 15 Jul 2013 10:32:45 +0200 Date: Mon, 15 Jul 2013 10:32:41 +0200 From: Pietro Cerutti To: Andriy Gapon Subject: Re: weird problem with git gui Message-ID: <20130715083241.GB21355@gahrfit.gahr.ch> References: <51E3AD58.6030001@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <51E3AD58.6030001@FreeBSD.org> X-PGP-Key: 0x9571F78E X-PGP-Fingerprint: 1203 92B5 3919 AF84 9B97 28D6 C0C2 6A98 9571 F78E User-Agent: Mutt/1.5.21 (2010-09-15) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel09.rubas.ch X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - FreeBSD.org X-Get-Message-Sender-Via: cpanel09.rubas.ch: authenticated_id: gahr@gahr.ch Cc: tcltk@FreeBSD.org X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: gahr@FreeBSD.org List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 08:32:52 -0000 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013-Jul-15, 11:05, Andriy Gapon wrote: >=20 > I started having some weird problems with "git gui" command after a recent > massive upgrade of ports (the last one was > 3 months ago), which also in= cluded > updates of tcl and tk. >=20 > Here is a small snippet from modified tcl/tk code in > /usr/local/libexec/git-core/git-gui: >=20 > catch {puts "1GIT_DIR is $env(GIT_DIR)"} # added by me > menu .mbar -tearoff 0 > catch {puts "2GIT_DIR is $env(GIT_DIR)"} # added by me >=20 > I think the following output speaks for itself: > 1GIT_DIR is .git > 2GIT_DIR as .git.git >=20 > I am very puzzled as to why the 'menu' command would cause such a detrime= ntal > change to the environment. > I am trying to debug this issue right now. I see that there is a call to > TclSetupEnv() (from generic/tclEnv.c) when 'menu' is executed. >=20 > Any hints and suggestions are very appreciated! > I'll get back with any additional details I discover. I fear I can't reproduce it locally,=20 puts [info patchlevel] puts "1 - $env(GIT_DIR)" menu .mbar -tearoff 0 puts "2 - $env(GIT_DIR)" gives 8.6.0 1 - .git 2 - .git I get to it by opening an existing repository. Could you please elaborate on the steps you take to get to that point? --=20 Pietro Cerutti The FreeBSD Project gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHjs6gACgkQwMJqmJVx946PSACgwGGFt7zbC4yyax0X+c1q1dLl Q5EAoJgJ5WLjERSIgKFNoEmGVOMF1ZG6 =opTk -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e-- From owner-freebsd-tcltk@FreeBSD.ORG Mon Jul 15 15:36:58 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EFBCEDC; Mon, 15 Jul 2013 15:36:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 15BAB395; Mon, 15 Jul 2013 15:36:57 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA16090; Mon, 15 Jul 2013 18:36:56 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uykpb-000Gp5-TR; Mon, 15 Jul 2013 18:36:55 +0300 Message-ID: <51E416DF.6040903@FreeBSD.org> Date: Mon, 15 Jul 2013 18:35:59 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: gahr@FreeBSD.org Subject: Re: weird problem with git gui References: <51E3AD58.6030001@FreeBSD.org> <20130715083241.GB21355@gahrfit.gahr.ch> In-Reply-To: <20130715083241.GB21355@gahrfit.gahr.ch> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: tcltk@FreeBSD.org X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 15:36:59 -0000 on 15/07/2013 11:32 Pietro Cerutti said the following: > On 2013-Jul-15, 11:05, Andriy Gapon wrote: >> >> I started having some weird problems with "git gui" command after a recent >> massive upgrade of ports (the last one was > 3 months ago), which also included >> updates of tcl and tk. >> >> Here is a small snippet from modified tcl/tk code in >> /usr/local/libexec/git-core/git-gui: >> >> catch {puts "1GIT_DIR is $env(GIT_DIR)"} # added by me >> menu .mbar -tearoff 0 >> catch {puts "2GIT_DIR is $env(GIT_DIR)"} # added by me >> >> I think the following output speaks for itself: >> 1GIT_DIR is .git >> 2GIT_DIR as .git.git >> >> I am very puzzled as to why the 'menu' command would cause such a detrimental >> change to the environment. >> I am trying to debug this issue right now. I see that there is a call to >> TclSetupEnv() (from generic/tclEnv.c) when 'menu' is executed. >> >> Any hints and suggestions are very appreciated! >> I'll get back with any additional details I discover. > > I fear I can't reproduce it locally, > > puts [info patchlevel] > puts "1 - $env(GIT_DIR)" > menu .mbar -tearoff 0 > puts "2 - $env(GIT_DIR)" > > gives > > 8.6.0 > 1 - .git > 2 - .git > > I get to it by opening an existing repository. Could you please > elaborate on the steps you take to get to that point? I just ran git gui in an existing repository as well. Also, I could not reproduce the problem on another machine that I have access too. Weird... I do not have any conclusions or solution, but i have some further observations. It seems that in my environment tcl wants to manipulate 'environ' global variable directly instead of using putenv/setenv/tec. I am not sure why this is preferred, but unix/tclUnixPort.h defines USE_PUTENV only for __CYGWIN__ or APPLE. Then I decided to use gdb to see how 'environ' is manipulated. $ gdb76 /usr/local/bin/wish8.6 (gdb) set args /usr/local/libexec/git-core/git-gui -- (gdb) watch environ (gdb) run I noticed that first tcl changes environ here: (gdb) bt #0 TclSetEnv (name=, value=0x8044fd010 "/usr/local/libexec/git-core/git-gui--askpass") at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclEnv.c:205 #1 0x0000000800c09254 in EnvTraceProc (clientData=, interp=0x804039010, name1=0x80419ad90 "env", name2=0x804474b30 "SSH_ASKPASS", flags=32) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclEnv.c:593 #2 0x0000000800c5efe4 in TclCallVarTraces (iPtr=0x804039010, arrayPtr=0x804098c90, varPtr=0x804486d90, part1=0x80419ad90 "env", part2=0x804474b30 "SSH_ASKPASS", flags=32, leaveErrMsg=512) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclTrace.c:2627 #3 0x0000000800c5f396 in TclObjCallVarTraces (iPtr=0x804039010, arrayPtr=0x804098c90, varPtr=0x804486d90, part1Ptr=, part2Ptr=0x80448bc40, flags=32, leaveErrMsg=512, index=-1) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclTrace.c:2513 #4 0x0000000800c66373 in TclPtrSetVar (interp=0x804039010, varPtr=0x804486d90, arrayPtr=0x804098c90, part1Ptr=0x80422ac80, part2Ptr=0x80448bc40, newValuePtr=0x80448b850, flags=512, index=-1) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclVar.c:1963 #5 0x0000000800c0ffff in TEBCresume (data=, interp=0x804039010, result=0) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclExecute.c:3357 #6 0x0000000800bad81c in TclNRRunCallbacks (interp=0x804039010, result=0, rootPtr=0x0) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclBasic.c:4350 #7 0x0000000800bad8d5 in Tcl_EvalObjv (interp=0x804039010, objc=, objv=, flags=) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclBasic.c:4142 #8 0x0000000800bae9a9 in TclEvalEx (interp=, script=, numBytes=73811, flags=, line=1227, clNextOuter=, outerScript=0x804450010 "#!/bin/sh\n# Tcl ignores the next line -*- tcl -*- \\\n if test \"z$*\" = zversion \\\n || test \"z$*\" = z--version; \\\n then \\\n\techo 'git-gui version 0.16.0.15.gf6dd78'; \\\n\texit; \\\n fi; \\\n argv0=$0; \\\n exec '"...) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclBasic.c:5248 #9 0x0000000800c36297 in Tcl_FSEvalFileEx (interp=0x804039010, pathPtr=0x804074030, encodingName=) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclIOUtil.c:1812 #10 0x0000000800872d5c in Tk_MainEx () from /usr/local/lib/libtk86.so #11 0x000000000040088f in main () (Please note that line numbers are slightly skewed, because of some debugging printfs) And then environ is modified here again: (gdb) bt #0 0x00000008026b0845 in ?? () from /lib/libc.so.7 #1 0x00000008026afe8b in ?? () from /lib/libc.so.7 #2 0x00000008026afd8b in setenv () from /lib/libc.so.7 #3 0x0000000801669d2c in FT_Load_Glyph () from /usr/local/lib/libfreetype.so.9 #4 0x00000008011108f4 in XftFontLoadGlyphs () from /usr/local/lib/libXft.so.2 #5 0x000000080110e309 in XftGlyphExtents () from /usr/local/lib/libXft.so.2 #6 0x000000080110e572 in XftTextExtents32 () from /usr/local/lib/libXft.so.2 #7 0x000000080090fdea in Tk_MeasureChars () from /usr/local/lib/libtk86.so #8 0x000000080091010f in InitFont () from /usr/local/lib/libtk86.so #9 0x0000000800910251 in TkpGetFontFromAttributes () from /usr/local/lib/libtk86.so #10 0x00000008008696ac in Tk_AllocFontFromObj () from /usr/local/lib/libtk86.so #11 0x00000008008607f3 in DoObjConfig () from /usr/local/lib/libtk86.so #12 0x00000008008610da in Tk_InitOptions () from /usr/local/lib/libtk86.so #13 0x00000008008937b2 in MenuCmd () from /usr/local/lib/libtk86.so #14 0x0000000800bad36d in TclNREvalObjv (interp=0x804039010, objc=4, objv=0x80407e2f0, flags=, cmdPtr=0x804155c10) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclBasic.c:4308 #15 0x0000000800bad8c8 in Tcl_EvalObjv (interp=0x804039010, objc=, objv=, flags=) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclBasic.c:4141 #16 0x0000000800bae9a9 in TclEvalEx (interp=, script=, numBytes=39162, flags=, line=2646, clNextOuter=, outerScript=0x804450010 "#!/bin/sh\n# Tcl ignores the next line -*- tcl -*- \\\n if test \"z$*\" = zversion \\\n || test \"z$*\" = z--version; \\\n then \\\n\techo 'git-gui version 0.16.0.15.gf6dd78'; \\\n\texit; \\\n fi; \\\n argv0=$0; \\\n exec '"...) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclBasic.c:5248 #17 0x0000000800c36297 in Tcl_FSEvalFileEx (interp=0x804039010, pathPtr=0x804074030, encodingName=) at /usr/obj/ports/usr/ports/lang/tcl86/work/tcl8.6.0/generic/tclIOUtil.c:1812 #18 0x0000000800872d5c in Tk_MainEx () from /usr/local/lib/libtk86.so #19 0x000000000040088f in main () After this modification of environ things go very sour for tcl. ... and now I also know why I have this problem on this particular machine! I have a patched version of libfreetype (print/freetype2 with custom 'infinality' patch). So apparently the unmodified version does not call setenv and so tcl has full control. On the other hand with my version setenv confuses tcl. I think that in general we should allow setenv to be called from beyond tcl control even while under tcl interpreter. So I consider this to be an exotic bug in tcl. Not sure how to proceed from here though. -- Andriy Gapon From owner-freebsd-tcltk@FreeBSD.ORG Mon Jul 15 16:25:09 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABE83F9E; Mon, 15 Jul 2013 16:25:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C32FE854; Mon, 15 Jul 2013 16:25:08 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA16915; Mon, 15 Jul 2013 19:25:07 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UylaE-000Gsr-Ua; Mon, 15 Jul 2013 19:25:06 +0300 Message-ID: <51E4222B.8010605@FreeBSD.org> Date: Mon, 15 Jul 2013 19:24:11 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: gahr@FreeBSD.org Subject: Re: weird problem with git gui References: <51E3AD58.6030001@FreeBSD.org> <20130715083241.GB21355@gahrfit.gahr.ch> <51E416DF.6040903@FreeBSD.org> In-Reply-To: <51E416DF.6040903@FreeBSD.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: tcltk@FreeBSD.org X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 16:25:09 -0000 on 15/07/2013 18:35 Andriy Gapon said the following: [snip] > I do not have any conclusions or solution, but i have some further observations. > It seems that in my environment tcl wants to manipulate 'environ' global > variable directly instead of using putenv/setenv/tec. I am not sure why this is > preferred, but unix/tclUnixPort.h defines USE_PUTENV only for __CYGWIN__ or APPLE. [snip] > > ... and now I also know why I have this problem on this particular machine! > I have a patched version of libfreetype (print/freetype2 with custom > 'infinality' patch). So apparently the unmodified version does not call setenv > and so tcl has full control. On the other hand with my version setenv confuses tcl. > > I think that in general we should allow setenv to be called from beyond tcl > control even while under tcl interpreter. So I consider this to be an exotic > bug in tcl. Not sure how to proceed from here though. > This patch seems to help me: --- unix/tclUnixPort.h.orig 2012-06-26 22:29:18.000000000 +0300 +++ unix/tclUnixPort.h 2013-07-15 19:19:59.609561609 +0300 @@ -115,6 +115,10 @@ # define TclOSstat stat # define TclOSlstat lstat #endif +#ifdef __FreeBSD__ +# define USE_PUTENV 1 +# define USE_PUTENV_FOR_UNSET 1 +#endif /* *--------------------------------------------------------------------------- --- generic/tclEnv.c.orig 2012-06-26 22:29:18.000000000 +0300 +++ generic/tclEnv.c 2013-07-15 19:20:15.441564839 +0300 @@ -395,7 +395,7 @@ * that no = should be included, and Windows requires it. */ -#if defined(__WIN32__) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) || defined(__FreeBSD__) string = ckalloc(length + 2); memcpy(string, name, (size_t) length); string[length] = '='; -- Andriy Gapon From owner-freebsd-tcltk@FreeBSD.ORG Mon Jul 15 16:53:00 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A2EE43C3; Mon, 15 Jul 2013 16:53:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B9F67AC4; Mon, 15 Jul 2013 16:52:59 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA17199; Mon, 15 Jul 2013 19:52:58 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uym1B-000Gv9-UW; Mon, 15 Jul 2013 19:52:57 +0300 Message-ID: <51E428C5.8050000@FreeBSD.org> Date: Mon, 15 Jul 2013 19:52:21 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: gahr@FreeBSD.org Subject: Re: weird problem with git gui References: <51E3AD58.6030001@FreeBSD.org> <20130715083241.GB21355@gahrfit.gahr.ch> <51E416DF.6040903@FreeBSD.org> <51E4222B.8010605@FreeBSD.org> In-Reply-To: <51E4222B.8010605@FreeBSD.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: tcltk@FreeBSD.org X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 16:53:00 -0000 on 15/07/2013 19:24 Andriy Gapon said the following: > on 15/07/2013 18:35 Andriy Gapon said the following: > [snip] >> I do not have any conclusions or solution, but i have some further observations. >> It seems that in my environment tcl wants to manipulate 'environ' global >> variable directly instead of using putenv/setenv/etc. I am not sure why this is >> preferred, but unix/tclUnixPort.h defines USE_PUTENV only for __CYGWIN__ or APPLE. > [snip] >> >> ... and now I also know why I have this problem on this particular machine! >> I have a patched version of libfreetype (print/freetype2 with custom >> 'infinality' patch). So apparently the unmodified version does not call setenv >> and so tcl has full control. On the other hand with my version setenv confuses tcl. >> >> I think that in general we should allow setenv to be called from beyond tcl >> control even while under tcl interpreter. So I consider this to be an exotic >> bug in tcl. Not sure how to proceed from here though. >> > > This patch seems to help me: [snip] And I think I found a bug in libc: commit e757a2e38f2b2f96136d2193c8f292d6aa552f6c Author: Andriy Gapon Date: Mon Jul 15 19:50:55 2013 +0300 libc: name passed into __setenv is not necessarily NUL-terminated That's particularly true when __setenv is called from __merge_environ. diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c index 47963d5..079b024 100644 --- a/lib/libc/stdlib/getenv.c +++ b/lib/libc/stdlib/getenv.c @@ -505,7 +505,7 @@ __setenv(const char *name, size_t nameLen, const char *value, int overwrite) envVars[envNdx].valueSize = valueLen; /* Save name of name/value pair. */ - env = stpcpy(envVars[envNdx].name, name); + env = stpncpy(envVars[envNdx].name, name, nameLen); if ((envVars[envNdx].name)[nameLen] != '=') env = stpcpy(env, "="); } So, I think that tcl is not to blame at all. Sorry for the noise on tcltk@. -- Andriy Gapon From owner-freebsd-tcltk@FreeBSD.ORG Mon Jul 15 16:56:22 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CA9542D; Mon, 15 Jul 2013 16:56:22 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from cpanel09.rubas.ch (cpanel09.rubas.ch [195.182.222.79]) by mx1.freebsd.org (Postfix) with ESMTP id 0AC93AF6; Mon, 15 Jul 2013 16:56:21 +0000 (UTC) Received: from 98-41.199-178.cust.bluewin.ch ([178.199.41.98]:64989 helo=gahrfit.gahr.ch) by cpanel09.rubas.ch with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1Uym4R-002jmx-CF; Mon, 15 Jul 2013 18:56:19 +0200 Date: Mon, 15 Jul 2013 18:56:16 +0200 From: Pietro Cerutti To: Andriy Gapon Subject: Re: weird problem with git gui Message-ID: <20130715165616.GF21355@gahrfit.gahr.ch> References: <51E3AD58.6030001@FreeBSD.org> <20130715083241.GB21355@gahrfit.gahr.ch> <51E416DF.6040903@FreeBSD.org> <51E4222B.8010605@FreeBSD.org> <51E428C5.8050000@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pQhZXvAqiZgbeUkD" Content-Disposition: inline In-Reply-To: <51E428C5.8050000@FreeBSD.org> X-PGP-Key: 0x9571F78E X-PGP-Fingerprint: 1203 92B5 3919 AF84 9B97 28D6 C0C2 6A98 9571 F78E User-Agent: Mutt/1.5.21 (2010-09-15) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel09.rubas.ch X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - FreeBSD.org X-Get-Message-Sender-Via: cpanel09.rubas.ch: authenticated_id: gahr@gahr.ch Cc: tcltk@FreeBSD.org X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: gahr@FreeBSD.org List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 16:56:22 -0000 --pQhZXvAqiZgbeUkD Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013-Jul-15, 19:52, Andriy Gapon wrote: > on 15/07/2013 19:24 Andriy Gapon said the following: > > on 15/07/2013 18:35 Andriy Gapon said the following: > > [snip] > >> I do not have any conclusions or solution, but i have some further obs= ervations. > >> It seems that in my environment tcl wants to manipulate 'environ' glob= al > >> variable directly instead of using putenv/setenv/etc. I am not sure w= hy this is > >> preferred, but unix/tclUnixPort.h defines USE_PUTENV only for __CYGWIN= __ or APPLE. > > [snip] > >> > >> ... and now I also know why I have this problem on this particular mac= hine! > >> I have a patched version of libfreetype (print/freetype2 with custom > >> 'infinality' patch). So apparently the unmodified version does not ca= ll setenv > >> and so tcl has full control. On the other hand with my version setenv= confuses tcl. > >> > >> I think that in general we should allow setenv to be called from beyon= d tcl > >> control even while under tcl interpreter. So I consider this to be an= exotic > >> bug in tcl. Not sure how to proceed from here though. > >> > >=20 > > This patch seems to help me: > [snip] >=20 > And I think I found a bug in libc: > commit e757a2e38f2b2f96136d2193c8f292d6aa552f6c > Author: Andriy Gapon > Date: Mon Jul 15 19:50:55 2013 +0300 >=20 > libc: name passed into __setenv is not necessarily NUL-terminated >=20 > That's particularly true when __setenv is called from __merge_environ. >=20 > diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c > index 47963d5..079b024 100644 > --- a/lib/libc/stdlib/getenv.c > +++ b/lib/libc/stdlib/getenv.c > @@ -505,7 +505,7 @@ __setenv(const char *name, size_t nameLen, const char > *value, int overwrite) > envVars[envNdx].valueSize =3D valueLen; >=20 > /* Save name of name/value pair. */ > - env =3D stpcpy(envVars[envNdx].name, name); > + env =3D stpncpy(envVars[envNdx].name, name, nameLen); > if ((envVars[envNdx].name)[nameLen] !=3D '=3D') > env =3D stpcpy(env, "=3D"); > } >=20 >=20 > So, I think that tcl is not to blame at all. > Sorry for the noise on tcltk@. Thanks a lot for finding and fixing this! It would have caused me a lot of head scratch to locate this starting from the Tcl interp :) --=20 Pietro Cerutti The FreeBSD Project gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp --pQhZXvAqiZgbeUkD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHkKa8ACgkQwMJqmJVx945LBwCfQ93oHKHZfWo11v1Aija2WGYT LXUAoJjSKm5DdoYl3RH+/nOGsfVP5fTe =ZBo6 -----END PGP SIGNATURE----- --pQhZXvAqiZgbeUkD-- From owner-freebsd-tcltk@FreeBSD.ORG Thu Jul 18 16:50:59 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DB5338DC for ; Thu, 18 Jul 2013 16:50:59 +0000 (UTC) (envelope-from mozart@lib.uchicago.edu) Received: from mozart.lib.uchicago.edu (mozart.lib.uchicago.edu [128.135.53.59]) by mx1.freebsd.org (Postfix) with ESMTP id AB634AFD for ; Thu, 18 Jul 2013 16:50:59 +0000 (UTC) Received: from mozart.lib.uchicago.edu (localhost [127.0.0.1]) by mozart.lib.uchicago.edu (8.14.5/8.14.5) with ESMTP id r6IGkmcO074117 for ; Thu, 18 Jul 2013 11:46:48 -0500 (CDT) (envelope-from mozart@lib.uchicago.edu) Date: Thu, 18 Jul 2013 11:46:48 -0500 Message-ID: From: Peggy Wilkins To: tcltk@FreeBSD.org Subject: devel/tcllib: struct::queue version problem User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3 (amd64-portbld-freebsd8.3) MULE/6.0 (HANACHIRUSATO) Organization: University of Chicago Library X-Face: )C,7auub1,qHwu.Spk;Y6'8pld<:g8_\/=Zo/=E3y5*[m?C;;5Wc'B9=V+I:v 7>8Y=yx{[yy0$Zu@q+d&+$`jV{"Gk"Q0A#d]btd#$qjAR),qXF+GuE#?9Q4_xai{V&". MJluE"^Oj41R'ypsHcp2_`6kxl;T7?5eW57j#Muert'z`Y Y03pPAp3uY@x9DhN?yWwH.!jV MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2013 16:50:59 -0000 Hello, I build devel/tcllib on FreeBSD 9.1-RELEASE-p4 via ports. After the update to tcllib-1.15_1 I am seeing the following problem: % package require struct::queue attempt to provide package struct::queue 1.4.4 failed: package struct::queue 1.4.5 provided instead mozart:~:12% grep struct::queue /usr/local/lib/tcllib/struct/pkgIndex.tcl package ifneeded struct::queue 1.4.4 [list source [file join $dir queue.tcl]] /usr/local/lib/tcllib/struct/queue.tcl:package provide struct::queue 1.4.5 I report this FYI. Regards, Peggy Wilkins __ Peggy Wilkins mozart@lib.uchicago.edu Sr. System Administrator sysadmin@lib.uchicago.edu Digital Library Development Center The University of Chicago Library From owner-freebsd-tcltk@FreeBSD.ORG Thu Jul 18 18:46:43 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D9C41E8E for ; Thu, 18 Jul 2013 18:46:43 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from cpanel09.rubas.ch (cpanel09.rubas.ch [195.182.222.79]) by mx1.freebsd.org (Postfix) with ESMTP id 99B2DFA6 for ; Thu, 18 Jul 2013 18:46:43 +0000 (UTC) Received: from 98-41.199-178.cust.bluewin.ch ([178.199.41.98]:51783 helo=gahrfit.gahr.ch) by cpanel09.rubas.ch with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1Uzsjd-003F7I-25; Thu, 18 Jul 2013 20:15:25 +0200 Date: Thu, 18 Jul 2013 20:15:17 +0200 From: Pietro Cerutti To: Peggy Wilkins Subject: Re: devel/tcllib: struct::queue version problem Message-ID: <20130718181516.GL21355@gahrfit.gahr.ch> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oxV4ZoPwBLqAyY+a" Content-Disposition: inline In-Reply-To: X-PGP-Key: 0x9571F78E X-PGP-Fingerprint: 1203 92B5 3919 AF84 9B97 28D6 C0C2 6A98 9571 F78E User-Agent: Mutt/1.5.21 (2010-09-15) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel09.rubas.ch X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - FreeBSD.org X-Get-Message-Sender-Via: cpanel09.rubas.ch: authenticated_id: gahr@gahr.ch Cc: tcltk@FreeBSD.org X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: gahr@FreeBSD.org List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jul 2013 18:46:43 -0000 --oxV4ZoPwBLqAyY+a Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013-Jul-18, 11:46, Peggy Wilkins wrote: > Hello, Hello Peggy, >=20 > I build devel/tcllib on FreeBSD 9.1-RELEASE-p4 via ports. After the > update to tcllib-1.15_1 I am seeing the following problem: >=20 > % package require struct::queue > attempt to provide package struct::queue 1.4.4 failed: package struct::qu= eue 1.4.5 provided instead >=20 > mozart:~:12% grep struct::queue /usr/local/lib/tcllib/struct/pkgIndex.tcl= =20 > package ifneeded struct::queue 1.4.4 [list source [file join $dir que= ue.tcl]] >=20 > /usr/local/lib/tcllib/struct/queue.tcl:package provide struct::queue 1.4.5 >=20 > I report this FYI. thanks for your report! I see it's been fixed upstream [1]. I have imported the fix and updated the port [2]. PORTREVISION has been bumped. Regards, [1] http://core.tcl.tk/tcllib/info/91f14dfd0a [2] http://svnweb.freebsd.org/ports?view=3Drevision&revision=3D323251 --=20 Pietro Cerutti The FreeBSD Project gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp --oxV4ZoPwBLqAyY+a Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHoMLMACgkQwMJqmJVx946RnQCcCtt7kTkdxUh6BIybDs7ZOKog DrMAoM0iqMutHM1bdThmjYCI4ABgg397 =8B6E -----END PGP SIGNATURE----- --oxV4ZoPwBLqAyY+a-- From owner-freebsd-tcltk@FreeBSD.ORG Fri Jul 19 14:10:00 2013 Return-Path: Delivered-To: tcltk@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1B72A4D5 for ; Fri, 19 Jul 2013 14:10:00 +0000 (UTC) (envelope-from jesse@glx.me) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id A9FAAC59 for ; Fri, 19 Jul 2013 14:09:59 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id x54so4041609wes.4 for ; Fri, 19 Jul 2013 07:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=glx.me; s=g; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=6KYh4nh7Ckm6eCiOPQgrhMhIbdrzJ+1k73v/1MhDu/0=; b=dHul4Oykii8RpxzcUwRXOgnXpYeUogCy0eii3hGaQdhsqZvcdU8zZJy0pKV+ipmOke 06vlsWbPbDQomoXKtsyYmeRLrdVBACBhl1yFKu3l6J+97F5/eEGywIPCMK6BHC7YcGKz Zb7MKv6EMGwQIIk+iiaN9wxiv0oF7d3A4xi3s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=6KYh4nh7Ckm6eCiOPQgrhMhIbdrzJ+1k73v/1MhDu/0=; b=TNAnB+xFiRf5veYrHI/GQCnRXfXCPBfLDTsS6pUzvfifUwY0AblXoxD//MBCXh2ZwK 5D0obmIW5RhBL4kP6SdlUnTcsVgA5jTdliEvZGc5HANT4mymH2nOYmeS1FCJl/JHdWNQ 5B/UGqmLob6wHG9vraNMEVLnvxeHpO3JBoSDzQ/CPvQvFnTSAQuOxtmSYrk2n1TX2NWp 9h8TDDhbQ5gPhHcYjfIEIvvT/uFDib2+9EsNXGpo1aw5H7qN9XfkzgijDduvkGzWXnFo 1euwmeLXqBmFVuMxSfai7JTDo0yfJWC6M+qAduBJyoE32cY0xleLT3GWnV3/Y2RUBhK1 uTHw== MIME-Version: 1.0 X-Received: by 10.194.242.134 with SMTP id wq6mr12029008wjc.94.1374242998621; Fri, 19 Jul 2013 07:09:58 -0700 (PDT) Received: by 10.194.240.201 with HTTP; Fri, 19 Jul 2013 07:09:58 -0700 (PDT) X-Originating-IP: [116.238.151.239] In-Reply-To: <20130718181516.GL21355@gahrfit.gahr.ch> References: <20130718181516.GL21355@gahrfit.gahr.ch> Date: Fri, 19 Jul 2013 22:09:58 +0800 Message-ID: Subject: Re: devel/tcllib: struct::queue version problem From: J To: gahr@freebsd.org X-Gm-Message-State: ALoCoQlHlD57Wh3VCWSaS8WGUqyKZUy6jqKkTN0mC0Nxt+tv2uUWs+MHEbU9s9VVKd9btlBRVqdg Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Peggy Wilkins , tcltk@freebsd.org X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2013 14:10:00 -0000 I guess the previous install is not cleaned On Fri, Jul 19, 2013 at 2:15 AM, Pietro Cerutti wrote: > On 2013-Jul-18, 11:46, Peggy Wilkins wrote: > > Hello, > Hello Peggy, > > > > > I build devel/tcllib on FreeBSD 9.1-RELEASE-p4 via ports. After the > > update to tcllib-1.15_1 I am seeing the following problem: > > > > % package require struct::queue > > attempt to provide package struct::queue 1.4.4 failed: package > struct::queue 1.4.5 provided instead > > > > mozart:~:12% grep struct::queue /usr/local/lib/tcllib/struct/pkgIndex.tcl > > package ifneeded struct::queue 1.4.4 [list source [file join $dir > queue.tcl]] > > > > /usr/local/lib/tcllib/struct/queue.tcl:package provide struct::queue > 1.4.5 > > > > I report this FYI. > > thanks for your report! I see it's been fixed upstream [1]. I have imported > the fix and updated the port [2]. PORTREVISION has been bumped. > > Regards, > > [1] http://core.tcl.tk/tcllib/info/91f14dfd0a > [2] http://svnweb.freebsd.org/ports?view=revision&revision=323251 > > -- > Pietro Cerutti > The FreeBSD Project > gahr@FreeBSD.org > > PGP Public Key: > http://gahr.ch/pgp > -- (c) http://glx.me/