Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.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.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'languages,': 0.04; 'say,': 0.05; 'c++,': 0.07; 'bug.': 0.09; 'occasionally': 0.09; 'cc:addr :python-list': 0.11; 'thread': 0.14; 'c/c++.': 0.16; 'cc:name:python list': 0.16; 'higher-level': 0.16; 'language)': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'acquired': 0.19; 'properly': 0.19; 'memory': 0.22; '(in': 0.22; 'email addr:gmail.com>': 0.22; 'portion': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'subject:problem': 0.24; "i've": 0.25; 'source': 0.25; 'least': 0.26; 'somewhere': 0.26; 'header:In- Reply-To:1': 0.27; 'appear': 0.29; 'tim': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'slot': 0.31; 'critical': 0.32; 'languages': 0.32; 'run': 0.32; 'quite': 0.32; 'could': 0.34; 'subject:with': 0.35; 'common': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'turn': 0.37; 'being': 0.38; 'jason': 0.38; 'days': 0.60; 'skip:u 10': 0.60; 'subject:"': 0.60; 'most': 0.60; 'our': 0.64; 'subject:The': 0.64; 'to:addr:gmail.com': 0.65; 'due': 0.66; 'increase': 0.74; '100%': 0.77; 'protect': 0.79; ':).': 0.84; 'fortunately,': 0.84; 'timings': 0.84; 'reducing': 0.93; '2013': 0.98 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:to :cc:content-type; bh=UKYHCJQ8QPGupjX8TH5xnWohMUEAZLroRjyWHGJGUUY=; b=Oh1krPWfSUKFK25eT7tR85yto92IoXA/AeJss73lDJ3OzjSxna/EICfWL8mL4qPpZR QpFnaZR9to7Ii7A1BmOS1M0Qd28rh2zrFdtPDcaJ74iPL35/OXodoYaSpKngxcaZcfHE QuaANP//cCmjnUO100nnHDTVfwikYLbbZ+8d1naM2CitMMR3CK2waICE+XsaSGSqk6vY MiUBv3sxMH1I4M0JcY5g3EZGUD+QSIeVutDEwdJbVNDnrhKZ27PVpHwb2rFBFnXM1M50 xiPWJqhA+EoHmAyg693ivdQmGPhlPiRC9g/qoHxoy6JWe0Q9TBXLfmaPS/5KjBEOnns2 Trvg== MIME-Version: 1.0 X-Received: by 10.182.102.234 with SMTP id fr10mr9109509obb.85.1370230647118; Sun, 02 Jun 2013 20:37:27 -0700 (PDT) In-Reply-To: References: <687dea63-84da-4c45-9366-cb5a10665d1f@googlegroups.com> Date: Mon, 3 Jun 2013 13:37:27 +1000 Subject: Re: PyWart: The problem with "print" From: Tim Delaney To: Jason Swails Content-Type: multipart/alternative; boundary=089e0129526afb63ed04de37aed9 Cc: python list , Dan Sommers 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: 56 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370230651 news.xs4all.nl 15890 [2001:888:2000:d::a6]:38485 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46759 --089e0129526afb63ed04de37aed9 Content-Type: text/plain; charset=UTF-8 On 3 June 2013 13:23, Jason Swails wrote: > Yea, I've only run into Heisenbugs with Fortran or C/C++. Every time I've > seen one it's been due to an uninitialized variable somewhere -- something > valgrind is quite good at pinpointing. (And yes, a good portion of our > code is -still- in Fortran -- but at least it's F90+ :). > With the increase in use of higher-level languages, these days Heisenbugs most often appear with multithreaded code that doesn't properly protect critical sections, but as you say, with lower-level languages uninitialised memory is a common source of them. I had a fun one once (in C++, but could have happened in any language) where a semaphore was being acquired twice on the one thread. There were 10 semaphore slots available, and very occasionally the timings would result in one of the threads deadlocking. Fortunately, by reducing to a single thread + single semaphore slot I was able to turn it from a Heisenbug to a 100% replicable bug. Tim Delaney --089e0129526afb63ed04de37aed9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 3 June 2013 13:23, Jason Swails <<= a href=3D"mailto:jason.swails@gmail.com" target=3D"_blank">jason.swails@gma= il.com> wrote:
Yea, I've on= ly run into Heisenbugs with Fortran or C/C++. =C2=A0Every time I've see= n one it's been due to an uninitialized variable somewhere -- something= valgrind is quite good at pinpointing. =C2=A0(And yes, a good portion of o= ur code is -still- in Fortran -- but at least it's F90+ :).

With the increase i= n use of higher-level languages, these days Heisenbugs most often appear wi= th multithreaded code that doesn't properly protect critical sections, = but as you say, with lower-level languages uninitialised memory is a common= source of them.

I had a fun= one once (in C++, but could have happened in any language) where a semapho= re was being acquired twice on the one thread. There were 10 semaphore slot= s available, and very occasionally the timings would result in one of the t= hreads deadlocking. Fortunately, by reducing to a single thread + single se= maphore slot I was able to turn it from a Heisenbug to a 100% replicable bu= g.

Tim Delaney=
--089e0129526afb63ed04de37aed9--