Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal handlers aren't reentrent #39

Open
colin-scott opened this issue May 12, 2014 · 0 comments
Open

Signal handlers aren't reentrent #39

colin-scott opened this issue May 12, 2014 · 0 comments
Labels

Comments

@colin-scott
Copy link
Member

STS assumes single-threaded execution, but signal handlers from the console (^C and ^D) break that assumption.

This causes a few problems, such as:

  • When switching back to Fuzzer mode from interactive
  • When switching to Interactive to Fuzzer the second time

I believe the problem may be related to io_master.raw_input's BackgroundIOThread?

The symptoms are usually that io_workers are closed due to empty reads (I believe because MuxSelect.select is interrupted, and doesn't properly handle syscall error codes)

Interrupt handlers are defined in a few places:

  • simulator.py handles sigint
  • fuzzer.py adds a shim layer for sigint that drops to interactive upon the first sigint
  • replayer.py also adds a shim layer.

Here's an example stack trace:

STS [next] >ERROR:core:Exception while handling OpenFlowBuffer!PendingMessage...
Traceback (most recent call last):
File "/home/mininet/sts/pox/pox/lib/revent/revent.py", line 233, in raiseEventNoErrors
return self.raiseEvent(event, args, *kw)
File "/home/mininet/sts/pox/pox/lib/revent/revent.py", line 280, in raiseEvent
rv = event._invoke(handler, args, *kw)
File "/home/mininet/sts/pox/pox/lib/revent/revent.py", line 158, in _invoke
return handler(self, args, *kw)
File "/home/mininet/sts/sts/openflow_buffer.py", line 88, in _pass_through_handler
self.schedule(pending_message)
File "/home/mininet/sts/sts/openflow_buffer.py", line 141, in schedule
raise ValueError("No such pending message %s" % pending_message)
TypeError: not all arguments converted during string formatting

TODO:

  • in python, does an async signal fork another thread? Or temporarily move the main thread?
  • How many theads are running when this thing crashes? Is it possible that multiple BackgroundIOThreads are running?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant