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

net: TCP: echo server deadlock from TCP packet #21949

Closed
rmstoi opened this issue Jan 15, 2020 · 0 comments · Fixed by #21956
Closed

net: TCP: echo server deadlock from TCP packet #21949

rmstoi opened this issue Jan 15, 2020 · 0 comments · Fixed by #21956
Assignees
Labels
area: native port Host native arch port (native_posix) area: Networking bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@rmstoi
Copy link
Collaborator

rmstoi commented Jan 15, 2020

echo server blocks from TCP packet with EOL TCP options. After this packet echo server consumes 100% CPU and does not reply to any other messages.

It seems this issue is introduced by commit d7d3462

A working solution is to use k_yield, to let also other threads to run

+++ b/drivers/ethernet/eth_native_posix.c
@@ -375,6 +375,7 @@ static void eth_rx(struct eth_context *ctx)
                if (net_if_is_up(ctx->iface)) {
                        while (!eth_wait_data(ctx->dev_fd)) {
                                read_data(ctx, ctx->dev_fd);
+                               k_yield();
                        }
                }


Attached pcap from this test

tcp-eol-options.pcap.gz

@rmstoi rmstoi added bug The issue is a bug, or the PR is fixing a bug area: Networking labels Jan 15, 2020
@jukkar jukkar added area: native port Host native arch port (native_posix) priority: low Low impact/importance bug labels Jan 15, 2020
rmstoi added a commit to rmstoi/zephyr that referenced this issue Jan 16, 2020
TCP segment with several EOL TCP options causes echo server to block and
use 100% of CPU. This patch fixes that issue by using k_yield to let
also other threads to run.

Fixes zephyrproject-rtos#21949

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
jukkar pushed a commit that referenced this issue Jan 17, 2020
TCP segment with several EOL TCP options causes echo server to block and
use 100% of CPU. This patch fixes that issue by using k_yield to let
also other threads to run.

Fixes #21949

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: native port Host native arch port (native_posix) area: Networking bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants