Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

os.path.abspath causes thread to freeze

0 views
Skip to first unread message

Austin Luminais

unread,
Dec 29, 2002, 11:24:39 PM12/29/02
to
I'm experiencing a strange problem with ActivePython 2.2.2, Windows
2000 SP3, in a wxPython application. It seems that an executing
thread freezes when it gets to a call to os.path.abspath.

The strange thing is that the code was working perfectly before for a
long time, but now it consistently freezes. The thread does resume
when I quit the main application thread.

My first thought was that it might be the most recent version of
wxPython (although I'm pretty sure it was working when I initially
installed 2.3.4.2 anyway), so I tried the previous two versions of
wxPython, but it didn't make a difference.

It seems someone else was having a very similar problem recently in
this message: http://groups.google.com/groups?selm=bd993a2f.0212162226.356a3d5c%40posting.google.com&oe=UTF-8&output=gplain

It seems to work ok if I don't call abspath, but I'm worried what
other hidden problems may exist with the threading in my program. Is
there some kind of thread locking issue with the os module?

"Martin v. Löwis"

unread,
Dec 30, 2002, 6:41:59 AM12/30/02
to Austin Luminais
Austin Luminais wrote:
> It seems to work ok if I don't call abspath, but I'm worried what
> other hidden problems may exist with the threading in my program. Is
> there some kind of thread locking issue with the os module?

I believe some of the calls in abspath release the interpreter lock, so
that other threads could acquire it and run. If those threads then don't
release the interpreter lock in a timely manner, the abspath call will
block; this problem could exist for about any system call where Python
releases the GIL. Of course, the bug is in that other thread which won't
return the GIL.

To be really sure what is happening, you need to attach a debugger to
the process and find out what all the threads are doing. Without that
information, this is all guesswork.

Regards,
Martin


0 new messages