Subject: Re: python & rebase [Was: cygwin-setup & rebaseall]
From: Jason Tishler <[email-masked]>
To: Satish Balay <[email-masked]>
Cc: [email-masked]
Date: Fri, 28 Oct 2005 07:40:25 -0400

Satish,

On Thu, Oct 27, 2005 at 03:04:52PM -0500, Satish Balay wrote:
> On Thu, 27 Oct 2005, Jason Tishler wrote:
> > On Thu, Oct 27, 2005 at 02:15:01PM -0500, Satish Balay wrote:
> > > I've tried using python after doing a complete 'reinstall' and so
> > > far It works fine. I'll keep track of any future breakages.
> > > 
> > > It will be great if rebase is not required at all...
> > 
> > The following is a good test:
> > 
> >     $ python /usr/lib/python2.4/test/regrtest.py
> > 
> > Do you get any "unable to remap" errors?
> 
> I don't see any remap errors,

Good.

> but the first time I tried - it gave thread errros. The second time -
> it completed fine.
> sem_init: Resource temporarily unavailable
> Unhandled exception in thread started by <bound method SmallBufferedFileObjectCl
> assTestCase.clientRun of <test.test_socket.SmallBufferedFileObjectClassTestCase
> testMethod=testFullRead>>
> Traceback (most recent call last):
>   File "/tmp/python.572/usr/lib/python2.4/test/test_socket.py", line 121, in cli
> entRun
>   File "/usr/lib/python2.4/threading.py", line 348, in wait
>     self.__cond.wait(timeout)
>   File "/usr/lib/python2.4/threading.py", line 197, in wait

The above is a known problem:

    http://www.cygwin.com/ml/cygwin/2005-07/msg01378.html

> BTW: we disable threads on cygwin+python-2.4. Is this problem likely
> to get fixed?

I can only say that it is on my list.  If this is important to you, then
why not help debug the problem?

> [I'm guessing its upstream issue - where I see sem_xx errors on AIX as
> well]

Actually, Python configure.in has the following:

      # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
      case  $ac_sys_system/$ac_sys_release in
      SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1,
                       Defined for Solaris 2.6 bug in pthread header.)
               ;;
      SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
               Define if the Posix semaphores do not work on your system)                      ;;
      esac

So, you can workaround this problem, by the following:

    $ configure
    $ sed 's=/\* #undef HAVE_BROKEN_POSIX_SEMAPHORES \*/=#define HAVE_BROKEN_POSIX_SEMAPHORES 1=' pyconfig.h >foo
    $ mv foo pyconfig.h
    $ make

FWIW, I have tried this and it solves the problem reported in the post
above.

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/