[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-09-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed in r84489 (3.x), r84490 (3.1) and r84491 (2.7). Thank you! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: -Python 2.6 ___ Python tracker

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Another "+1" on the patch if it is needed. Posix module consistently releases the GIL while making system calls and this is a good idea independent of this particular issue. Looking at the patch made me wonder whether existing Py_BEGIN

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-02-16 Thread Nikolaus Rath
Nikolaus Rath added the comment: Does this patch still need review? Both Martin and Antoine already commented that the patch is ok, so it'd be great if someone could actually apply it... -- ___ Python tracker

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-24 Thread Martin v . Löwis
Martin v. Löwis added the comment: I think the bug here is really in the application, which makes a system call to fuse and the fuse callback in the same process. This isn't supported, and IMO doesn't need to be. Python makes no promises that it will accept callbacks while a system call is in

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-22 Thread Nikolaus Rath
Nikolaus Rath added the comment: The patch works fine for me too. Also, I did not discover any other such problems for other syscalls (but I did not systematically try all os.* functions). -- ___ Python tracker _

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Marcin Bachry
Marcin Bachry added the comment: > Still, I'd be extremly grateful if someone could tell me the trick how to create a backtrace in such a deadlock situation Sorry, I should have mentioned that. In order to get backtrace you let the process freeze, attach gdb to it (it will freeze too), then g

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Well, now that I know what to look for, tracking down more of these > problems should be significantly faster and easier. Are you generally > going to accept similar patches for other unprotected syscalls? Until now the rule of thumb was to consider only ti

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 01/20/2010 07:19 AM, Antoine Pitrou wrote: > Ah, thanks for the explanation. Yes indeed the patch looks ok for the > job. You should just be aware that similar problems may appear with > other system calls. I don't think we have ever considered that common C >

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Nikolaus Rath
Nikolaus Rath added the comment: I have used both of them in the past, but in the end I wrote my own bindings (currently only available as part of the http://code.google.com/p/s3ql source code, but I intend to factor it out at some point), since neither fuse.py (http://code.google.com/p/fusep

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, thanks for the explanation. Yes indeed the patch looks ok for the job. You should just be aware that similar problems may appear with other system calls. I don't think we have ever considered that common C calls such as opendir() could call back into Python

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Nikolaus Rath
Nikolaus Rath added the comment: In this simple example, FUSE does not fork and does not start any threads. Note that PyGILState_Ensure() cannot do anything here. What happens is this: - call_hello.py calls FUSE in a new thread, releasing the GIL. - FUSE mounts the file system and waits for

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Releasing the GIL when calling C library functions (e.g. opendir()) is not a requirement, it's just an optimization for slightly better multi-threading. Also, as shown in the backtrace, PyGILState_Ensure() is called which should only try to acquire the GIL if

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-20 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-19 Thread Brian Curtin
Changes by Brian Curtin : -- keywords: +needs review nosy: +brian.curtin priority: -> normal stage: -> patch review versions: +Python 3.2 ___ Python tracker ___

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-01-19 Thread Nikolaus Rath
Changes by Nikolaus Rath : -- title: ctypes freezes/deadlocks process -> os.listdir hangs since opendir() and closedir() do not release GIL ___ Python tracker ___ ___