[Fwd: Re: [IPython-dev] A plea for help with a threading bug...]

Fernando Perez Fernando.Perez at colorado.edu
Sat Mar 19 14:47:47 EST 2005


I'm forwarding Yariv's response, which was killed by the non-subscriber filter 
(Yariv, I just whitelisted this address for you manually, let me know if you 
use others).

best,

f

-------- Original Message --------
Subject: Re: [IPython-dev] A plea for help with a threading bug...
Date: Sat, 19 Mar 2005 16:17:41 +0200
From: Yariv Ido <yariv at vipe.stud.technion.ac.il>
Reply-To: yariv at vipe.stud.technion.ac.il
To: Prabhu Ramachandran <prabhu_r at users.sourceforge.net>
CC: Fernando Perez <Fernando.Perez at colorado.edu>,        IPython-dev List 
<ipython-dev at scipy.net>,        IPython-user List <ipython-user at scipy.net>, 
      Yariv <yariv at vipe.stud.technion.ac.il>
References: <423B66F1.3060705 at colorado.edu>	 
<16956.1488.412879.700277 at monster.linux.in>

Hi,

First of all, the segmentation fault is caused by some race condition.
Setting the TIMEOUT to 1 just increases the probability of that
happening, so you could debug it more efficiently. If you would like to
avoid setting it, try running ipython with the -gthread flag, and
pressing 'tab' repeatedly...
More thoughts on the subject:
1. This bug has nothing to do with the runcode method. You can just
return True as the first statement of the on_timer() method, and a
segfault would still occur.
2. I haven't had enough time to debug it, but by taking a look at the
readline built-in module, it seems that it releases the GIL every now
and then. My guess is that this is somehow related.
3. I've noticed that IPython's code has no
threads_enter()/threads_leave(). I don't know if it would solve this
particular problem, but it may fix the threads_init() call in win32 (And
thus fix the tremendous slowdown as reported on the bug tracker).

Yariv

On Sat, 2005-03-19 at 16:28 +0530, Prabhu Ramachandran wrote:
> >>>>> "FP" == Fernando Perez <Fernando.Perez at colorado.edu> writes:
> 
>     FP> Hi all, I got this bug report:
> 
>     FP> http://www.scipy.net/roundup/ipython/issue30
> [...]
>     FP> Since this is caused by some race condition, in order to
>     FP> reproduce the problem, the TIMEOUT variable of
>     FP> IPShellWX/IPShellGTK can be set to 1.
> 
> Well, why should you set the TIMEOUT to 1 in the first place?  Thats 1
> millisecond between calls to the on_timer function.  Theoretically, if
> it takes more than 1 millisecond to execute the runcode method this is
> asking for trouble isn't it?
> 
> cheers,
> prabhu
> 




More information about the IPython-dev mailing list