Description
When I press <Ctrl-C> to close MoinMoin Desktop Edition, it generates a traceback, complaining of select.error: (4, 'Interrupted system call').
Steps to reproduce
- Start with a Mac running OS X 10.4.11.
Install Python 2.6.1 from www.python.org.
Install MoinMoin 1.8.2.
Launch MoinMoin from Terminal.app command line
Press <Ctrl-c> to close MoinMoin.
Example
Component selection
- general
Details
MoinMoin Version |
1.8.2 |
OS and Version |
OS X 10.4.11 Intel |
Python Version |
2.6.1 from www.python.org |
Server Setup |
none |
Server Details |
none |
Language you are using the wiki in (set in the browser/UserPreferences) |
<Browser setting>. If it matters, I am using Safari 3.2.1, with Safari's default encoding set to Western (ISO Latin 1). |
Transcripts from Terminal.app follow.
The first one shows the build of Python used.
Mac:~/Desktop/moin-1.8.2 username$ echo $PATH /usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin Mac:~/Desktop/moin-1.8.2 username$ which python /usr/local/bin/python Mac:~/Desktop/moin-1.8.2 username$ python Python 2.6.1 (r261:67515, Dec 6 2008, 16:42:21) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type "help", "copyright", "credits" or "license" for more information.
The second one shows exactly what happens when launching MoinMoin from Terminal.app using the above-mentioned build of Python.
Mac:~/Desktop/moin-1.8.2 username$ python wikiserver.py 2009-03-25 20:19:23,111 INFO MoinMoin.log:126 using logging configuration read from "/Users/username/Desktop/moin-1.8.2/wikiserverlogging.conf" 2009-03-25 20:19:23,315 INFO MoinMoin.server.server_standalone:72 ThreadPoolServer serving on 127.0.0.1:8080 ^C2009-03-25 20:19:25,422 INFO MoinMoin.server.server_standalone:491 Thanks for using MoinMoin! Traceback (most recent call last): File "wikiserver.py", line 38, in <module> MoinScript().run() File "/Users/davidbiovision/Desktop/moin-1.8.2/MoinMoin/script/__init__.py", line 138, in run self.mainloop() File "/Users/davidbiovision/Desktop/moin-1.8.2/MoinMoin/script/__init__.py", line 255, in mainloop plugin_class(args[2:], self.options).run() # all starts again there File "/Users/davidbiovision/Desktop/moin-1.8.2/MoinMoin/script/__init__.py", line 138, in run self.mainloop() File "/Users/davidbiovision/Desktop/moin-1.8.2/MoinMoin/script/server/standalone.py", line 131, in mainloop run(Config) File "/Users/davidbiovision/Desktop/moin-1.8.2/MoinMoin/server/server_standalone.py", line 638, in run httpd.serve_forever() File "/Users/davidbiovision/Desktop/moin-1.8.2/MoinMoin/server/server_standalone.py", line 189, in serve_forever SimpleServer.serve_forever(self) File "/Users/davidbiovision/Desktop/moin-1.8.2/MoinMoin/server/server_standalone.py", line 77, in serve_forever self.handle_request() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py", line 262, in handle_request fd_sets = select.select([self], [], [], timeout) select.error: (4, 'Interrupted system call') Mac:~/Desktop/moin-1.8.2 username$
Workaround
Discussion
Python issue 7978 ("SocketServer doesn't handle syscall interruption") may be the cause of this. A thread on Python-dev discusses it.
From Python issue 7978:
SocketServer's handle_request function uses "select" call to handle io, but sending POSIX signal will result in 'Interrupted system call' exception raised. After that Paste (http://pythonpaste.org/) http server will crash.
I suppose EINTR must be handled properly (i.e. syscall must be restarted silently) on SocketServer's side. That must be pretty easy task. . . .
- Wrapping select in (taken from twisted sources) can help:
def untilConcludes(f, *a, **kw): while True: try: return f(*a, **kw) except (IOError, OSError), e: if e.args[0] == errno.EINTR: continue raise
The bug may also happen in 1.8.7 I am not sure about this. But please for many reasons (SecurityFixes) please do this update to 1.8.7. -- ReimarBauer 2010-04-08 20:02:15
Plan
- Priority:
- Assigned to:
- Status: