-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
netserver on OSv doesn't work in TCP_MAERTS mode with test duration limited by time #44
Comments
Explanation by Nadav Har'El: alarm() isn't supported in OSv because it uses signals. Signals (other than SIGSEGV and SIGFPE which happen synchronously) aren't supported on OSv, because they can arrive at any time, including during non-reentrant kernel function calls. The signal handler can then call the same or other kernel functions, and cause a disaster. Unix has a solution for this, with a list of signal-safe systemcalls, and system call restart, but this isn't really something we can do in OSv where there is no concept of system call, and they are just functions like any function. It's not like OSv is losing any functionality this way - alarm() and signal handlers is a really archaic interface, and most modern programs would use threads that go to sleep instead of signal handlers. The problem is that by not supporting alarm() we're making it hard to port programs. Maybe we should implement alarm() (and also signal()) in a naive way that ignores the potential reentrancy disasters, and it will end up working in 90% of the cases. But it will be really safer if we don't... :( |
Warning clause to be added to osv/tools/netperf.txt |
@dmitryfleytman @nyh I think we should keep this issue open for further discussion whether or not we should fix it. I certainly think we should. |
@nyh what do you think? |
On Wed, Sep 25, 2013 at 11:33 AM, Pekka Enberg [email protected]:
I'll try to explain again what I think. We will not be able to fully support kill(2)/signal(2) (and similarly, But we can write a working kill(2) that will work under certain
I think we can pretty easily implement kill(2) which will work in these After we have kill(2) working, we'll need to implement alarm(2). An easy This should be a new issue - it's not a netperf-specific issue. |
On Wed, Sep 25, 2013 at 10:04 PM, Nadav Har'El [email protected]:
I started writing a kill() and alarm() which will work using trick #3 above We'll have to see if/how it helps in concrete cases we previously Nadav Har'El |
On Wed, Sep 25, 2013 at 10:56 PM, Nadav Har'El [email protected]:
Ok, I just sent two patches, for implementing kill() and alarm() I would be grateful if you could check if this implementation of alarm() If it doesn't work, maybe you can tell me how/why it doesn't work.
Nadav Har'El |
@nyh, I've tested your patches, netserver issue resolved. Thanks. |
Added alarm(), making this netperf mode work. Closing this issue. |
It turned out that netperf relies on send_/receive_ syscalls being interrupted by SIG_ALRM in some cases. The issue needs to be reopen. |
I believe Dmitry already solved this issue. Dmitry, or someone with super-powers - can you please close this issue? Github doesn't allow a mere mortal like me to do it :( |
* apps 922711c...8ccc734 (18): > cassandra: update JNA version and download site > cassandra: remove redundant line from manifest > Merge pull request #48 from davedoesdev/master > Merge pull request #47 from glauciom/patch-1 > Merge pull request #46 from bhuztez/otp-18.0 > Upgraded ONOS to 1.2.1 > perl: fix build > Merge pull request #42 from russt/OSV-APPS-39 > cado: fix module.py > cado: some Makefile fixes > Merge pull request #44 from russt/OSV-APPS-43 > Merge pull request #41 from cosmo0920/update-jruby-sinatra-example > perl-hello: support for scripts/build > perl: add default command line for scripts/build > perl: support for scripts/build > perl: fix Makefile for parallel make > perl: use tabs in Makefile > Merge pull request #40 from russt/OSV-APPS-39 Signed-off-by: Avi Kivity <[email protected]>
Netserver relies on alarm() to set test completion timer and this part is disabled by osv.patch.
As a workaround test duration may be limited by amount of data sent instead of amount of time passed. Then netserver is working.
The text was updated successfully, but these errors were encountered: