Skip to contentSkip to conversation

RT Sigio broken on 2.4.19-pre8

DISCUSSION Dan Kegel 2 participants 5 messages May 28, 2002

lore
Share & tools
lore

Dan Kegel

author
#0 lore raw
Quoted 4 lines · Aaron Sethman
Quoted 4 lines
Quoted 4 lines

Using the Dan Kegel's Poller_bench utility I noticed that RT SIGIO is not working on 2.4.19-pre8. Basically sigtimedwait() is always returning SIGIO. Note that 2.4.18 works fine.
... It seems rtsig-nr keeping rising slowly as the system runs.

That sounds like the way I'm clearing the signal queue is not working. Here's a minimal test case for clearing the signal queue. Could you try it and tell me what it says?
- Dan

#include <stdio.h>
#include <signal.h>
#include <assert.h>

int main(int argc, char **argv)

{
        sigset_t sigset;
        siginfo_t info;
        static struct timespec timeout = {0,0};

        // block delivery of SIGRTMIN
        sigemptyset(&sigset);
        sigaddset(&sigset, SIGRTMIN);
        assert(0 == sigprocmask(SIG_BLOCK, &sigset, NULL));

        // clear signal queue
        assert(0 == signal(SIGRTMIN, SIG_IGN)); // POSIX says this clears the queue

        // Make sure that cleared the queue.  (Note that timeout is zero here.)
        assert(sigtimedwait(&sigset, &info, &timeout) != SIGRTMIN);

        printf("test passed\n");
        exit(0);
}
author
#1 lore raw
Quoted 10 lines · Dan Kegel
Quoted 4 lines · Aaron Sethman
Quoted 4 lines
Quoted 4 lines

Using the Dan Kegel's Poller_bench utility I noticed that RT SIGIO is not working on 2.4.19-pre8. Basically sigtimedwait() is always returning SIGIO. Note that 2.4.18 works fine.
... It seems rtsig-nr keeping rising slowly as the system runs.

That sounds like the way I'm clearing the signal queue is not working. Here's a minimal test case for clearing the signal queue. Could you try it and tell me what it says?

Er, forgot to send the signal. Corrected test case:

#include <stdio.h>
#include <signal.h>
#include <assert.h>

int main(int argc, char **argv)

{
    sigset_t sigset;
    siginfo_t info;
    static struct timespec timeout = {0,0};

    // block delivery of SIGRTMIN
    sigemptyset(&sigset);
    sigaddset(&sigset, SIGRTMIN);
    assert(0 == sigprocmask(SIG_BLOCK, &sigset, NULL));

    raise(SIGRTMIN);

    // clear signal queue
    assert(0 == signal(SIGRTMIN, SIG_IGN)); // POSIX says this clears the queue

    // Make sure that cleared the queue.  (Note that timeout is zero here.)
    assert(sigtimedwait(&sigset, &info, &timeout) != SIGRTMIN);

    printf("test passed\n");
    exit(0);
}
#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Dan Kegel

Er, forgot to send the signal. Corrected test case:

Just tried the corrected version, still passed.

Regards,

Aaron

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE88uY3bNIhrdTeJVMRAhAVAJ41B1bC7q++8FCgZf+NDKN9mOaY6QCg2XKe EtuaFO1o403xHAP+KjY3VHs=
=PjcP
-----END PGP SIGNATURE-----

#3 lore raw
In reply to Dan Kegel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Dan Kegel

That sounds like the way I'm clearing the signal queue is not working. Here's a minimal test case for clearing the signal queue. Could you try it and tell me what it says?
- Dan

The test passed. What it looks like is, the kernel for some reason is not decrementing the queued count for some reason. I have a server doing RT sigio and after a while, the rtsig-nr count goes up to 1024 and never comes back down even if I kill that process.

Regards,

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE88uW7bNIhrdTeJVMRApXSAKCMolB/rzDvdin1byJo36ZYRw6mmACbBkLl JGH5UDNRpg0AE0VK3lDaPGw=
=NUCR
-----END PGP SIGNATURE-----

author
#4 lore raw
In reply to Dan Kegel
Quoted 10 lines · Aaron Sethman
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Using the Dan Kegel's Poller_bench utility I noticed that RT SIGIO is not working on 2.4.19-pre8. Basically sigtimedwait() is always returning SIGIO. Note that 2.4.18 works fine.
... It seems rtsig-nr keeping rising slowly as the system runs.

That sounds like the way I'm clearing the signal queue is not working. Here's a minimal test case for clearing the signal queue. Could you try it and tell me what it says?

Just tried the corrected version, still passed.

I can't reproduce the problem here.

What version of dkftpbench are you using? What parameters? Can you send me your kernel .config file?

I did notice and fix an embarassing problem in Poller_bench of dkftpbench-0.42; it aborted when Poller_sigio sent its initial readiness notification (it's spurious, but programs are supposed to
be able to handle that). Fix is at
http://www.kegel.com/dkftpbench/pb.patch

Thanks,
Dan