Your message dated Sun, 11 Sep 2005 08:12:22 -0500
with message-id <[EMAIL PROTECTED]>
and subject line Not a make bug
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 14 Dec 2002 12:04:47 +0000
>From [EMAIL PROTECTED] Sat Dec 14 06:04:46 2002
Return-path: <[EMAIL PROTECTED]>
Received: from pool-68-160-50-129.bos.east.verizon.net (beth.swift.xxx) 
[68.160.50.129] (root)
        by master.debian.org with esmtp (Exim 3.12 1 (Debian))
        id 18NB2E-000487-00; Sat, 14 Dec 2002 06:04:46 -0600
Received: from beth.swift.xxx ([EMAIL PROTECTED] [127.0.0.1])
        by beth.swift.xxx (8.12.6/8.12.6/Debian-6) with ESMTP id gBEC4ei2028224;
        Sat, 14 Dec 2002 07:04:40 -0500
Message-Id: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Matthew Swift <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: make: inscrutable behavior with bash functions inherited in
        environment
X-Mailer: reportbug 2.9
Date: Sat, 14 Dec 2002 07:04:39 -0500
X-Mailscanner: clean    (beth.swift.xxx)
Delivered-To: [EMAIL PROTECTED]
X-Spam-Status: No, hits=0.8 required=5.0
        tests=MSG_ID_ADDED_BY_MTA_3,SPAM_PHRASE_00_01
        version=2.41
X-Spam-Level: 

Package: make
Version: 3.80-1
Severity: normal

When bash exports function definitions to child processes, it somehow stores
the definitions in variable values, but a function and a variable with the same
name are separate objects.

When Make collects variables from its environment, it does not properly
distinguish between variables and functions of the same name.

It is possible that this is a bug in bash, not Make.  

I've spent as much time as I can afford looking at the sources of Make and
Bash, without finding out exactly what's happening yet.  My next step would be
to determine exactly what is coming to Make in the ENVP argument, but strace is
not yielding me that information easily, and I would need more time to wrest
the answer from the sources.

Two short files are attached, a shell script "doit" and "Makefile".  Put these
two small files in an empty test directory, make "doit" executable, cd to the
dir, and run "env -i ./doit".  The error encountered is what happens when Make
tries to print out a value for "myident" that has a newline in it.  That is,
the value it is trying to print out is the function definition, which has
newlines in it, not the variable value, which does not.


Since I do not yet fully understand how bash passes functions to its children,
I do not know whether it is reasonable to suggest that Make avoid initializing
its own Make variables to values that are shell functions (and also avoid
passing on such values to its own shell children).  One possible way to achieve
this is to set within Make an exported variable that causes the shell to run in
"privileged" mode.  I have not tested this, privileged mode is thinly
documented, and I am not sure it is the correct solution, but it is something
to investigate (perhaps as a default behavior) if the current behavior is
discovered not strictly to be a bug.


---------- "doit" begin
#!/bin/bash

myident () { echo myfunc; }

echo
echo ----------------- 'export myident=myvar'
echo

export myident=myvar

make

echo
echo ----------------- 'myident function defined in export-all context, export 
myident=myvar'
echo

unset myident
set -a
myident () { echo myfunc; }
set +a
export myident=myvar

echo "value of shell variable myident is $myident"
echo "value of shell function myident (begin)"
type myident
echo "value of shell function myident (end)"

make
#make -p -r
---------- "doit" end

---------- "Makefile" begin
#MAKEFLAGS += p
..EXPORT_ALL_VARIABLES:
..PHONY: first
first:
        @echo ::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        @echo 'shell var myident: ['$$myident']'
        @echo 'make var myident: [$(myident)]'
        @echo 'make var myident unexpanded: [$(value myident)]'
---------- "Makefile" end



-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux beth 2.4.19 #1 Mon Aug 26 00:56:45 EDT 2002 i686
Locale: LANG=en_US, LC_CTYPE=en_US

Versions of packages make depends on:
ii  libc6                         2.2.5-14.3 GNU C Library: Shared libraries an

-- no debconf information


---------------------------------------
Received: (at 173022-done) by bugs.debian.org; 11 Sep 2005 13:20:52 +0000
>From [EMAIL PROTECTED] Sun Sep 11 06:20:52 2005
Return-path: <[EMAIL PROTECTED]>
Received: from host-12-107-230-171.dtccom.net 
(glaurung.internal.golden-gryphon.com) [12.107.230.171] 
        by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
        id 1EERlL-0004W7-00; Sun, 11 Sep 2005 06:20:52 -0700
Received: from glaurung.internal.golden-gryphon.com ([EMAIL PROTECTED] 
[127.0.0.1])
        by glaurung.internal.golden-gryphon.com (8.13.4/8.13.4/Debian-4) with 
ESMTP id j8BDCRuW022879
        (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
        Sun, 11 Sep 2005 08:12:28 -0500
Received: (from [EMAIL PROTECTED])
        by glaurung.internal.golden-gryphon.com (8.13.4/8.13.4/Submit) id 
j8BDCO9g022876;
        Sun, 11 Sep 2005 08:12:24 -0500
X-Authentication-Warning: glaurung.internal.golden-gryphon.com: srivasta set 
sender to [EMAIL PROTECTED] using -f
From: Manoj Srivastava <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: Matthew Swift <[EMAIL PROTECTED]>, [EMAIL PROTECTED],
        Matthias Klose <[EMAIL PROTECTED]>,
        "Paul D. Smith" <[EMAIL PROTECTED]>
Subject: Not a make bug
Organization: Manoj Srivastava's Home
User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) 
(i686-pc-linux-gnu)
Face: iVBORw0KGgoAAAANSUhEUgAAACYAAAAwCAMAAABKbPgaAAAAM1BMVEUAAADIjH/0rp1KPz79
        
0b+ic2nlpJc2Ly2AY17VlYb4uqi2gHQXFBN2WVXgno5iT02Xa2Nx+jaIAAACVElEQVQ4jeWU23bj
        
IAxFLUAggQX6/6+dI9LGTpo+9mlYiXNhc3TnOP50naZE0tqvgEk+soutnNfQ8yPTWMTENhNrjI+Y
        
+N7POVt8tAzpn2vJlsmttbyfrdkP7hx5iezteGzsbOts7xT+tC1mcG+LtRP2X/16bEQExuyx1uZW
        
vscrAWUT8aE0aDBeBuw8nS5u4WgWyDCllOZUBeyWgbWbGrBsTDpTx0qpphlcYPcgJLvBXFClPMg5
        
6WH2JidLIAaDF5aAed7uPTH4bjw0bZvfajp2tHc1F+cBm+Vr9YomGSwNhbmcczYEWUu5MBpYvCLV
        
F+ZIKwQfYB+CBXnIRQFvIRhK6l96PemsFLEPFxi+MPxiTYH0Ave1InPsIYes3NJb42ytBSmmysyj
        
lIQYHJm6Im1WbQ0kWMesKFRFPKTDzJ3GhWUn2KWKEkWlKthoACLm2eWJQQh2qKbAUgQxa+8TVjn1
        
aySm8656ookCfCc5TRzvnZ6YOu3NpHg+uR5YuRkNF/b5IHq5Y7Ve6c2+sR4hqIZ3+5DCt3ukh8Eo
        
vFIXVJxqfMdbkd/BF3YaQkB/2RIUHPMS7RLVAHefrYzWZVQ/ei4peBsROFLi90ltQyvF5I05t4Zs
        
L4C9DODJ2AZCUf8UitGjCIdfx15QQkfZibTOGT3edxns5fY6F2rstKcTwiiaJnQwvYkdzTlaTqNH
        
IkSmGdLrON45tGsMNDoSYr4bxH5emHEFaoFjKBahHXFXfLx9cR9p6ejJXihuxPz57gWHZkWovbPl
        9gsU8eImtBi++3D+f+sfT/Mg79fyEz8AAAAASUVORK5CYII=
X-URL: http://www.golden-gryphon.com/
Mail-Copies-To: nobody
X-Face: [EMAIL PROTECTED]/;Y^gTjR\T^"B'fbeuVGiyKrvbfKJl!^e|e:iu(kJ6c|QYB57LP*|t
 &YlP~HF/=h:[EMAIL PROTECTED]:6Cj0kd#4]>*D,|0djf'CVlXkI,>aV4\}?d_KEqsN{Nnt7
 78"OsbQ["56/!nisvyB/uA5Q.{)gm6?q.j71ww.>b9b]-sG8zNt%KkIa>xWg&1VcjZk[hBQ>]j~`Wq
 Xl,y1a!(>6`UM{~'X[Y_,Bv+}=L\SS*mA8=s;!=O`ja|@PEzb&i0}Qp,`Z\:6:OmRi*
X-Hashcash: 1:25:050911:[EMAIL 
PROTECTED]::64eBfgV8sKL5lbBs:000000000000000000000000000000000074Rr
X-Hashcash: 1:25:050911:[EMAIL 
PROTECTED]::l9deg/qw3SWiCNUe:00000000000000000000000000000000000000000000r8I
X-Hashcash: 1:25:050911:[EMAIL PROTECTED]::WPtWccZmHP7jGN5H:0002XHnM
X-Hashcash: 1:25:050911:[EMAIL 
PROTECTED]::Bm65fvYogbXGhh+w:00000000000000000000000000000000000000000yc6M
X-Hashcash: 1:25:050911:[EMAIL PROTECTED]::xV6/SKFJHMTfVDUR:005xSub
Date: Sun, 11 Sep 2005 08:12:22 -0500
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-CRM114-Score: -25.0617
X-CRM114-Status: Good  ( pR: -25.0617 )
X-SA-Orig: -9.899, -25.0617
X-Spam-Value: -15.7357611111111
X-Grey: White
X-SA-Rep: -15.7357611111111 ALL_TRUSTED,BAYES_00,HASHCASH_25
X-Scanned-By: MIMEDefang version 2.51 (www . roaringpenguin . com / mimedefang) 
on 192.168.1.10
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
        version=2.60-bugs.debian.org_2005_01_02

Hi,

        Please look at the SUSv3 reference quoted in this bug report:

,----[ 
http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html#tag_08 ]
| The value of an environment variable is a string of characters. For
| a C-language program, an array of strings called the environment shall
| be made available when a process begins. The array is pointed to by
| the external variable environ, which is defined as: 
|
| extern char **environ;
|
|  These strings have the form name=value; names shall not contain the
|  character '='. For values to be portable across systems conforming to
|  IEEE Std 1003.1-2001, the value shall be composed of characters from
|  the portable character set (except NUL and as indicated below). There
|  is no meaning associated with the order of strings in the
|  environment. If more than one string in a process' environment has
|  the same name, the consequences are undefined. 
`----

        You have two strings in Make's environment with the same
 name. You expect Make to look at the value of these, look for "() {",
 and make distinctions based on that (in other words, assign meaning
 to the opening bytes of the value of duplicate variables); but this
 is not an expectation the standard assures you shall be met.

        I am copying make upstream on this; but at this point, this is
 not a bug in Make. This is what "undefined consequences" means.

        manoj
-- 
Parents often talk about the younger generation as if they didn't have
much of anything to do with it.
Manoj Srivastava     <[EMAIL PROTECTED]>    <http://www.golden-gryphon.com/>
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to