Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.06; 'binary': 0.07; 'linux,': 0.07; 'ugly': 0.07; 'boundaries.': 0.09; 'skip:/ 10': 0.09; 'cc:addr:python-list': 0.11; '(when': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'happily': 0.16; 'invocation': 0.16; 'invocations': 0.16; 'itself,': 0.16; 'letting': 0.16; 'nonetheless': 0.16; 'safely.': 0.16; 'subject:Was': 0.16; 'sudo': 0.16; 'wrote:': 0.18; 'example': 0.22; '(in': 0.22; 'cc:addr:python.org': 0.22; 'deleted.': 0.24; 'typical': 0.24; 'versions': 0.24; 'file.': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; 'program,': 0.31; 'code': 0.31; '13,': 0.31; 'file': 0.32; 'probably': 0.32; 'run': 0.32; 'open': 0.33; 'linux': 0.33; 'running': 0.33; 'checking': 0.33; 'actual': 0.34; 'subject: (': 0.35; 'created': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'instances': 0.36; 'next': 0.36; 'half': 0.37; 'same.': 0.38; 'version,': 0.38; 'pm,': 0.38; 'rather': 0.38; 'little': 0.38; 'changed': 0.39; 'even': 0.60; 'ago,': 0.61; 'new': 0.61; 'you.': 0.62; 'pick': 0.64; 'subject:The': 0.64; 'relatively': 0.65; 'situation': 0.65; 'fact,': 0.69; 'subject:have': 0.80; 'actually,': 0.84; 'apt-get': 0.84; 'heh.': 0.84; 'dozen': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=Vq/Mvj4+nhsOGwdiiEp+I/zfUYLwcxiAv70mwN8QhDA=; b=keltRxHplmQACZLyH17S5Og0Dj/H4V6ycIl/P5uW+/ovKPQ92FLRJJ9SY2Lr/RLtG2 MRHaTc1cVdgvU2nXH2kGSDrbh9vsxPEAIju5nmkOcNPxtfqmG7FsffsC9ZktHAm7oof5 A+kYQ1k1N1Sz4w+itsTD5Snf6Zm504dPMRrdVSHT2ReoRwH4SUtdaeL2iCoPiXArL09A iL+HWc82FQP8EMvQknf/XcRFKMFKU5pHJoo4uXH8BcX7Q0jlcoT59CLMzDxnYWJy8A8d 4i9D6HPC4Vz1MEltDUcx8Pc1cmCPBxeEOERdunfHk+bPX3vCb7Bt/LIoc84naySRNLc6 6+Zw== MIME-Version: 1.0 X-Received: by 10.52.116.101 with SMTP id jv5mr24082680vdb.11.1399978204557; Tue, 13 May 2014 03:50:04 -0700 (PDT) In-Reply-To: <1bd9fc22-8d4b-4a9d-872f-d76591cfb205@googlegroups.com> References: <87tx91warf.fsf@elektro.pacujo.net> <85eh05cdjx.fsf@benfinney.id.au> <87ha50hagu.fsf@elektro.pacujo.net> <536b8411$0$29965$c3e8da3$5496439d@news.astraweb.com> <536b9308$0$29965$c3e8da3$5496439d@news.astraweb.com> <536bab23$0$29965$c3e8da3$5496439d@news.astraweb.com> <87mweotfe5.fsf@dpt-info.u-strasbg.fr> <87iopbtmh1.fsf@dpt-info.u-strasbg.fr> <5371b23a$0$11109$c3e8da3@news.astraweb.com> <5371e737$0$11109$c3e8da3@news.astraweb.com> <1bd9fc22-8d4b-4a9d-872f-d76591cfb205@googlegroups.com> Date: Tue, 13 May 2014 20:50:04 +1000 Subject: Re: Fortran (Was: The "does Python have variables?" debate) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399978206 news.xs4all.nl 2886 [2001:888:2000:d::a6]:48372 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71466 On Tue, May 13, 2014 at 8:44 PM, Rustom Mody wrote: > On Tuesday, May 13, 2014 3:30:36 PM UTC+5:30, Chris Angelico wrote: >> Actually, even the file system can do some of this to you. I was >> checking lsof on one of my Linux systems a little while ago, and found >> that I had half a dozen old versions of a program, all with the same >> file name, all deleted. (When you unlink a running binary on Linux, >> the program keeps running the old version, and then you can put a new >> version in its place, with the same file name. Any new invocation will >> pick up the new binary; existing ones keep what they have.) So a >> program can unlink itself, write out a new version of itself, and >> happily keep going - letting new invocations take the changed version, >> safely. Again, not exactly self-modifying code... or is it? Again, >> tamed by boundaries. > > Your lsof example looks like a rather typical case of ugly self-modifying code > Self-modifying code has many flavours; consider: > > $ sudo apt-get upgrade apt-get > > relatively harmless but self-modifying nonetheless > Heh. Those are going to be exactly the same. (In actual fact, it was a "sudo make install" that created the situation I described.) The only difference is that you probably don't have any other instances of apt-get running, meaning the change takes place for the next run - but while that's running, you would see the old /usr/bin/apt-get as a deleted and open file. ChrisA