Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #4603
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.003 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.04; 'handler': 0.05; 'onto': 0.05; 'variant': 0.07; 'python': 0.07; 'flush': 0.09; 'initialized': 0.09; 'terminate': 0.09; 'pm,': 0.11; 'wrote:': 0.14; 'called,': 0.16; 'expected.': 0.16; 'forking': 0.16; 'goals.': 0.16; 'itself).': 0.16; 'terminates.': 0.16; 'termination': 0.16; 'timely': 0.20; '(or': 0.22; 'code': 0.22; 'header:In-Reply-To:1': 0.22; 'trying': 0.23; 'received:209.85.214.174': 0.23; 'received:mail- iw0-f174.google.com': 0.23; 'subject:code': 0.23; 'script': 0.26; 'ago': 0.26; 'environment': 0.26; "i'm": 0.26; 'chris': 0.27; 'message-id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'thanks': 0.29; 'depends': 0.29; 'sat,': 0.29; 'assuming': 0.29; '(the': 0.30; 'this.': 0.30; 'it.': 0.31; 'perhaps': 0.32; 'to:addr :python-list': 0.32; 'done': 0.32; "i've": 0.33; 'generally': 0.33; 'on,': 0.33; 'running': 0.36; 'think': 0.36; 'received:209.85': 0.37; 'run': 0.37; 'apr': 0.38; 'dylan': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'received:209.85.214': 0.39; 'signal': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'header:Received:5': 0.40; 'straight': 0.60; 'back': 0.61; '2011': 0.62; 'gone': 0.77; '30,': 0.80; 'isolate': 0.84; 'evans': 0.91; 'killed': 0.91; 'promptly': 0.93; 'died': 0.97 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=UNsJ9ItN0T79z3BHvbiJTSci5pHfMStN2hEh6sc6Yag=; b=N0g4ju0qYnnPgniRRNaUrdllMFQf1QtIT+PpWEZn6fk+bwfROdX4ZO6tSClYg/d4l0 QXc3FopqMWfBa1dA+ggAqD80AaI2KxKNBfr9MitIFgHyVJ341+K1m0ScAjWa+eGumPFi GTYh5ADqJUu7ennswNEXE0X2hJ+ka99s94LSs= |
| DomainKey-Signature | a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=EuyB25NbNWP4zOrZzVrNK4IaOL7Ev3yXmLXWu0+OUe9nunz2lLNXLaMW6hv9OACAoY SGqu7ycFVLAeJY2Z86AQxLjGj6cdt0EKLAzqfbpjZfNqTaLndmlBcVgADrxr4LPFYuuk GOapmoOqirmVcrDtInVoj2R8K+0HIp/DXu34w= |
| MIME-Version | 1.0 |
| In-Reply-To | <BANLkTinOWxFtq-cSCk18d7HbKUYAyLCp9g@mail.gmail.com> |
| References | <mailman.974.1304041735.9059.python-list@python.org> <c63e7579-16d1-4bfa-8486-8ab791343dba@glegroupsg2000goo.googlegroups.com> <BANLkTik1V3CwUY41-F0U3nxhFV=j2Bvk1g@mail.gmail.com> <BANLkTinOWxFtq-cSCk18d7HbKUYAyLCp9g@mail.gmail.com> |
| Date | Wed, 4 May 2011 19:02:40 +1000 |
| Subject | Re: Aborting Python from C code |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1144.1304499763.9059.python-list@python.org> (permalink) |
| Lines | 25 |
| NNTP-Posting-Host | 82.94.164.166 |
| X-Trace | 1304499764 news.xs4all.nl 81474 [::ffff:82.94.164.166]:50547 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:4603 |
Show key headers only | View raw
On Sat, Apr 30, 2011 at 7:29 PM, Dylan Evans <dylan@contentfree.info> wrote: > I think i see what you are trying to do but it depends on the environment > and your goals. > Generally i think you need to separate your code by forking (or perhaps you > have already done that?), > then you can run a check to see if the process died as expected. I don't > know though, this not much > information to go on, but if you are running untrusted code then you need to > be able to isolate and kill it. Well, I've gone with a slight variant on this. If the Python script doesn't terminate in a timely manner, the process will be killed with a longjmp straight from the signal handler (the setjmp having been done long long ago back when the process initialized itself). So Py_Finalize() will be called, but no other Python-related functions _at all_, and the process promptly terminates. I'm assuming that Python will flush out all its state on process termination (that is, it doesn't hang onto any system-global resources). Thanks for the advice! Chris Angelico
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Aborting Python from C code Miki Tebeka <miki.tebeka@gmail.com> - 2011-04-30 01:08 -0700 Re: Aborting Python from C code Chris Angelico <rosuav@gmail.com> - 2011-04-30 18:17 +1000 Re: Aborting Python from C code Chris Angelico <rosuav@gmail.com> - 2011-05-04 19:02 +1000 newbie needs help with cookielib "Sells, Fred" <fred.sells@adventistcare.org> - 2011-05-04 13:16 -0400
csiph-web