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

include/fcntl.h: mismatch between O_NONBLOCK and FNONBLOCK causes a blocking socket for redis on AArch64 #20

Closed
mariasfiraiala opened this issue Aug 3, 2022 · 1 comment
Assignees

Comments

@mariasfiraiala
Copy link
Contributor

Describe the bug

redis doesn't accept requests when run on AArch64.

There seems to be a mismatch between O_NONBLOCK and FNONBLOCK. FNONBLOCK shoud be an alias for O_NONBLOCK used by vfscore to create a nonblocking socket. However, redis makes use of the O_NONBLOCK flag, and even though the value for these 2 flags should be the same, it isn't.

That is because on AArch64 the O_NONBLOCK flag is redefined in include/fcntl.h, while, FNONBLOCK isn't.

The result is a blocking socket, which makes it impossible for redis to accept further requests.

Steps to reproduce

Build and run redis using newlib support on AArch64.

Download this executable and run it using this command:

$./redis-cli -h 172.44.0.2 -p 6379

Expected behavior

redis to be responding to requests:

$./redis-cli -h 172.44.0.2 -p 6379
172.44.0.2:6379> PING
PONG
172.44.0.2:6379> exit

Which architectures were you using or does this bug affect?

AArch64

Which platforms were you using or does this bug affect?

KVM

@eduardvintila
Copy link
Member

Can confirm this issue is present on my end, as well. This seems to affect all apps which are using newlibc and the internal library vfscore to manage blocking/non-blocking I/O.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants