EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Problem with cothread-1-12 on MacOSX (Leopard)
From: "Abbott, MG (Michael)" <[email protected]>
To: "EPICS Tech Talk" <[email protected]>
Date: Tue, 10 Mar 2009 08:46:45 -0000
Dear Juan,

Thank you for an interesting bug report.

First the easy ones:

> 2) Even with Python 2.5.4, the select module does not have 
> the POLLMSG attribute. 

Ah.  For the moment you can delete that from your code altogether -- it's not used anywhere by cothread, and I only provided it for completeness (so that I'm fully emulating poll).  Looking more closely at Python's Modules/select.c I see that all of the extra POLL constants (the ones without comments in coselect.py!) are guarded by #ifdefs, so I'll update coselect.py to be more careful.  Anyhow, this is nothing to do with the real problem...

> A few things I found trying to make it work on my Mac:
> 1) MacOSX comes with Python 2.5.1 which for some reason, the select  
> module does not support poll() method and therefore the cothread  
> library fails when assigning POLL's constants. I recommend to 
> upgrade to Python 2.5.4 which fixes that issue.

Gosh.  Well, I suppose I could try to emulate poll just using select, but that would be pretty horrible.  Thanks for finding out about this one, guess I'll just have to write a note on this.  Most of my work on cothread has been with Python 2.4, but on Linux...


Ok, now for the hard one:

From: Juan Carlos Guzman [mailto:[email protected]] 
> I tried to run the cothread library on MacOSX (Leopard) with Python  
> 2.5.4 and the following error is displayed:
> 
>  >>> from cothread.catools import *
>  >>> Exception caught by readline hook
> Traceback (most recent call last):
>    File "build/bdist.macosx-10.3-i386/egg/cothread/input_hook.py",  
> line 72, in _readline_hook
>      poll_list, timeout = _scheduler.poll_scheduler(ready_list)
>    File 
> "build/bdist.macosx-10.3-i386/egg/cothread/cothread.py", line  
> 282, in __scheduler
>      self.__schedule_loop()
>    File 
> "build/bdist.macosx-10.3-i386/egg/cothread/cothread.py", line  
> 355, in __schedule_loop
>      self.__wakeup_poll(self.__poll_suspend(delay))
>    File 
> "build/bdist.macosx-10.3-i386/egg/cothread/cothread.py", line  
> 507, in __wakeup_poll
>      for poller in self.__poll_queue[file]:
> KeyError: 0
> 
> This error is repeated multiple times and the only way to kill it is  
> via kill command. I'm using numpy 1.1.1 and greenlet 0.2

Ok, I think I can see what's going on here, but it's a little strange.  My best guess is that poll() is telling us that stdin is ready with an event other than POLLIN.  Can you try two things for me please?

First, can you apply the attached debug.patch with the command (run this in the cothread distribution directory)
	patch -p0 </path/to/debug.patch
run your program and let me know what output you get?  I expect to see a line of the form
	debug: 00000001
before the traceback, except I'm expecting something other than 1!  (If you can verify that coselect.POLLIN has value 1 at the same time that will be helpful.)

Then try reverting the patch and applying the attached cothread.patch -- this *may* fix the problem, depending on what exactly is going on -- or if we're unlucky, it'll just loop!  Here are the commands to run:
	patch -p0 -R </path/to/debug.patch
	patch -p0 </path/to/cothread.patch

Unfortunately I don't have access to a sufficiently recent version of OSX to reproduce this.
<DIV><FONT size="1" color="gray">This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
</FONT></DIV> 

-- 

Scanned by iCritical.

Attachment: debug.patch
Description: debug.patch

Attachment: cothread.patch
Description: cothread.patch


Navigate by Date:
Prev: makeBaseApp Zhichu Chen
Next: RE: Problem with cothread-1-12 on MacOSX (Leopard) Abbott, MG (Michael)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: makeBaseApp Zhichu Chen
Next: RE: Problem with cothread-1-12 on MacOSX (Leopard) Abbott, MG (Michael)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·