Comment 3 for bug 1486146

Revision history for this message
Dan Searle (dan-censornet) wrote :

Hi Joseph,

I re-created the issue on a new install of Ubuntu 14.04.3 (amd64) running the linux-image-3.19.0-26-generic kernel using the following code:

#include <stdlib.h>
#include <netinet/ip.h>

int main(void)
{
                struct sockaddr_in addr = {
                                .sin_family = AF_INET,
                                .sin_port = htons(1234),
                                .sin_addr = { INADDR_ANY }
                };
                int conn;
                char buf[16];

                int s = socket(AF_INET, SOCK_STREAM, 0);

                bind(s, (void *)&addr, sizeof addr);
                listen(s, 1);

                conn = accept(s, NULL, 0);

                recv(conn, buf, sizeof buf, MSG_PEEK|MSG_WAITALL);
}
----
$ gcc x.c
$ ./a.out &

$ nc 127.0.0.1 1234
1234<enter>

--> 'a.out' consumes 100% CPU

----

After downloading and installing kernel packages from http://kernel.ubuntu.com/~jsalisbury/lp1486146/ I rebooted, and re-ran the test as above, this time 'a.out' does not consume 100% CPU any more, so the bug seems fixed at least in this simple test case using the replacement kernel.