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

dns/bind 9.16.2 crashes with libuv v1.36.0 #2791

Closed
thierry-FreeBSD opened this issue Apr 16, 2020 · 8 comments
Closed

dns/bind 9.16.2 crashes with libuv v1.36.0 #2791

thierry-FreeBSD opened this issue Apr 16, 2020 · 8 comments

Comments

@thierry-FreeBSD
Copy link
Contributor

Yesterday I upgraded the FreeBSD port of libuv to 1.36.0.
Since then, several users reported crashes of Bind: see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245653
An experimental patch has been proposed by Tatsuki Makino: see https://bz-attachments.freebsd.org/attachment.cgi?id=213441&action=diff&format=raw&headers=1

@bnoordhuis
Copy link
Member

#2736 looks like the most likely culprit, cc @saghul.

That PR was a fix for #2532 but looking at it again, I think that feature may be backwards incompatible. The idea is that UV_UDP_MMSG_CHUNK signifies the callback shouldn't free the buffer but existing code isn't aware of that flag.

bnoordhuis added a commit to bnoordhuis/libuv that referenced this issue Apr 16, 2020
This reverts commit 3d71366.
This reverts commit d9cd7d4.

The first reverted commit is the sendmmsg/recvmmsg support, the second
one a fix-up to deliver datagrams in order. The second commit has been
implicated in causing bind9 to crash on freebsd.

A quick review of the code suggests that downstream code written against
pre-v1.35.0 libuv can't safely deal with multi-datagram support because
they are unaware of the `UV_UDP_MMSG_CHUNK` flag and what that implies
for buffer management, hence I'm moving to revert it.

The `UV_UDP_MMSG_CHUNK` flag remains part of `uv_udp_flags` for
API/ABI backwards compatibility reasons but it is no longer used.

Fixes: libuv#2791
Refs: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245653
@bnoordhuis
Copy link
Member

I've opened a revert: #2792

@saghul
Copy link
Member

saghul commented Apr 16, 2020

👋 The original feature was. backwards-incompatible...ish. As in, if you passwd a huge buffer nothing special happend.

How about adding a flag to uv_udp_init_ex to turn the behavior on (it being off by default)?

@bnoordhuis
Copy link
Member

A flag is a good way forward but if it takes you some time to come up with a patch, I'd like to land the revert first and release it. You can then revert the revert. :-)

@saghul
Copy link
Member

saghul commented Apr 16, 2020

I'll try to get to it tonight!

uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Apr 16, 2020
…ns/bind916).

See <libuv/libuv#2791>
and <libuv/libuv#2792>

PR:		245653
Reported by:	lysfjord.daniel(at)smokepit.net and many


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@531835 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Apr 16, 2020
…ns/bind916).

See <libuv/libuv#2791>
and <libuv/libuv#2792>

PR:		245653
Reported by:	lysfjord.daniel(at)smokepit.net and many
@SoLoR1
Copy link

SoLoR1 commented Apr 16, 2020

Can confirm this same issue on Gentoo Linux as well.

15-Apr-2020 23:05:57.838 general: critical: netmgr.c:1000: REQUIRE(worker->recvbuf_inuse) failed, back trace

15-Apr-2020 23:05:57.838 general: critical: #0 0x5629318abbaf in ??

15-Apr-2020 23:05:57.838 general: critical: #1 0x7fc037259d0c in ??

15-Apr-2020 23:05:57.838 general: critical: #2 0x7fc037271eda in ??

15-Apr-2020 23:05:57.838 general: critical: #3 0x7fc0372768fb in ??

15-Apr-2020 23:05:57.838 general: critical: #4 0x7fc03615beea in ??

15-Apr-2020 23:05:57.838 general: critical: #5 0x7fc03615c4eb in ??

15-Apr-2020 23:05:57.838 general: critical: #6 0x7fc03615edd0 in ??

15-Apr-2020 23:05:57.838 general: critical: #7 0x7fc03614e0ca in ??

15-Apr-2020 23:05:57.838 general: critical: #8 0x7fc0372740e9 in ??

15-Apr-2020 23:05:57.838 general: critical: #9 0x7fc03646cea7 in ??

15-Apr-2020 23:05:57.838 general: critical: #10 0x7fc03639ee8f in ??

15-Apr-2020 23:05:57.838 general: critical: exiting (due to assertion failure)

Jehops pushed a commit to Jehops/freebsd-ports-legacy that referenced this issue Apr 16, 2020
…ns/bind916).

See <libuv/libuv#2791>
and <libuv/libuv#2792>

PR:		245653
Reported by:	lysfjord.daniel(at)smokepit.net and many


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@531835 35697150-7ecd-e111-bb59-0022644237b5
@thierry-FreeBSD
Copy link
Contributor Author

Yesterday I pushed this commit to the FreeBSD port of libuv, and everything seems OK.
=> closing.
Thanks for your reactivity!

saghul added a commit to saghul/libuv that referenced this issue Apr 18, 2020
Instead of implicitly enabling it by checking the supplied buffer size
to alloc_cb, have a dedicated flag that must be set on `uv_udp_init_ex`.

Fixes: libuv#2791
Closes: libuv#2792
saghul added a commit to saghul/libuv that referenced this issue Apr 18, 2020
Instead of implicitly enabling it by checking the supplied buffer size
to alloc_cb, have a dedicated flag that must be set on `uv_udp_init_ex`.

Fixes: libuv#2791
Closes: libuv#2792
@namarrgon
Copy link

I think this should have been left open until a release is available so that other people don't start filing duplicates.

@saghul saghul reopened this Apr 19, 2020
saghul added a commit to saghul/libuv that referenced this issue Apr 19, 2020
Instead of implicitly enabling it by checking the supplied buffer size
to alloc_cb, have a dedicated flag that must be set on `uv_udp_init_ex`.

Fixes: libuv#2791
Closes: libuv#2792
PR-URL: libuv#2799
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
ericbsd pushed a commit to ghostbsd/ghostbsd-ports that referenced this issue Apr 22, 2020
…ns/bind916).

See <libuv/libuv#2791>
and <libuv/libuv#2792>

PR:		245653
Reported by:	lysfjord.daniel(at)smokepit.net and many
svmhdvn pushed a commit to svmhdvn/freebsd-ports that referenced this issue Jan 10, 2024
…ns/bind916).

See <libuv/libuv#2791>
and <libuv/libuv#2792>

PR:		245653
Reported by:	lysfjord.daniel(at)smokepit.net and many
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants