Created attachment 16454 [details] Patch for v4-14-test From time to time we see deadlocks on socket_reset_mutex in combination with forking. These problems should be fixed in socket_wrapper 1.3.2.
Created attachment 16455 [details] Patch for v4-13-test
Created attachment 16456 [details] Patches for v4-12-test
We'll need socket_wrapper 1.3.3
The problem with 1.3.2 is this: #7 abort + 0x12b [ip=0x7f14fb670859] [sp=0x7fffd08856f0] #8 _swrap_mutex_lock + 0x102 [ip=0x7f14fc207a7d] [sp=0x7fffd0885820] #9 swrap_sendmsg_before + 0xd0 [ip=0x7f14fc212f0e] [sp=0x7fffd0885880] #10 swrap_write + 0x129 [ip=0x7f14fc214ca6] [sp=0x7fffd0885920] #11 write + 0x3b [ip=0x7f14fc214d8c] [sp=0x7fffd0885a50] #12 swrap_pcap_dump_packet + 0xc5 [ip=0x7f14fc20ca19] [sp=0x7fffd0885a90] #13 swrap_accept + 0x821 [ip=0x7f14fc20d9e2] [sp=0x7fffd0885b00] #14 accept + 0x3d [ip=0x7f14fc20db26] [sp=0x7fffd0886050] #15 prefork_listen_accept_handler + 0x1c0 [ip=0x7f14fbc4e06f] [sp=0x7fffd0886090] #16 tevent_common_invoke_fd_handler + 0x118 [ip=0x7f14fbcc3219] [sp=0x7fffd0886180] #17 epoll_event_loop + 0x3a9 [ip=0x7f14fbccf785] [sp=0x7fffd08861d0] #18 epoll_event_loop_once + 0x13c [ip=0x7f14fbccfe9f] [sp=0x7fffd0886230] #19 std_event_loop_once + 0x6f [ip=0x7f14fbccc0da] [sp=0x7fffd0886280] #20 _tevent_loop_once + 0x126 [ip=0x7f14fbcc20cd] [sp=0x7fffd08862c0] It happens with a stale fd closed via __close_nocancel() in nss_host. While socket() is a weak symbol in libc.so.6, so swrap_socket can be injected into the resolver code in libc.so.6, but the socket is closed with __close_nocancel, which is not a weak symbol in libc.so.6, and it's not possible to catch the close of the fd and it remains stale in the socket_wrapper table.
This bug was referenced in samba master: 10c198827d977e07b411897556578d3aedce2184
Created attachment 16564 [details] Patches for v4-14-test
Created attachment 16565 [details] Patches for v4-13-test
Karolin, could you please apply the patches to the relevant branches? Thanks!
Pushed to autobuild-v4-{14,13}-test.
This bug was referenced in samba v4-13-test: f2be1673edee566088df92e2b9ecbe1678293780
This bug was referenced in samba v4-14-test: a0862d6d6dee5f21bebf8987e3e7a21a42198b3b
Pushed to both branches. Closing out bug report. Thanks!
This bug was referenced in samba v4-14-stable (Release samba-4.14.3): a0862d6d6dee5f21bebf8987e3e7a21a42198b3b
This bug was referenced in samba v4-13-stable: f2be1673edee566088df92e2b9ecbe1678293780