Can anyone help me understand why a busy database server gets these kernel warnings? It comes from this WARN_ON macro, apparently because the socket is still owned by the user process. Why would that happen?
WARN_ON(sock_owned_by_user(sk)); [726780.788201] WARNING: CPU: 15 PID: 52245 at net/ipv4/tcp.c:2278 tcp_close+0x40f/0x430 [726780.794947] Modules linked in: binfmt_misc nf_conntrack_netlink nfnetlink_queue tcp_diag inet_diag isofs ip6table_mangle ip6table_raw ip6table_nat nf_nat_ipv6 iptable_security xt_CT iptable_raw iptable_nat nf_nat_ipv4 nf_nat iptable_mangle xt_pkttype xt_NFLOG nfnetlink_log xt_u32 xt_multiport xt_set xt_conntrack ip_set_hash_netport ip_set_hash_ipport ip_set_hash_net ip_set_hash_ip ip_set nfnetlink nf_conntrack_proto_gre nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables xt_LOG nf_conntrack_tftp nf_conntrack_ftp nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack iptable_filter zfs(PO) zunicode(PO) zavl(PO) icp(PO) sb_edac intel_powerclamp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel crypto_simd glue_helper cryptd cirrus snd_seq zcommon(PO) ttm intel_rapl_perf snd_seq_device [726780.848696] drm_kms_helper znvpair(PO) snd_pcm snd_timer spl(O) drm snd soundcore syscopyarea sysfillrect pcspkr sysimgblt input_leds fb_sys_fops i2c_piix4 ip_tables xfs libcrc32c ata_generic pata_acpi ata_piix xen_blkfront crc32c_intel libata ena(O) serio_raw floppy sunrpc [726780.863916] CPU: 15 PID: 52245 Comm: mysqld Tainted: P W O 4.16.13-1.el7.elrepo.x86_64 #1 [726780.869486] Hardware name: Xen HVM domU, BIOS 4.2.amazon 08/24/2006 [726780.873756] RIP: 0010:tcp_close+0x40f/0x430 [726780.877049] RSP: 0018:ffffc90063a87dd0 EFLAGS: 00010202 [726780.880913] RAX: 0000000000000001 RBX: ffff8839cbb4b300 RCX: 0000000000000001 [726780.885708] RDX: 0000000000400001 RSI: 0000000000023540 RDI: 000000000000002b [726780.890412] RBP: ffffc90063a87df0 R08: 0000000000000000 R09: 0000000000000101 [726780.895192] R10: 00000000000003ff R11: 0000000000002057 R12: ffff8839cbb4b388 [726780.900029] R13: 0000000000000009 R14: ffff8839cbb4b3c8 R15: ffff883c5ed14900 [726780.904777] FS: 00007f6acd467700(0000) GS:ffff883c8b1c0000(0000) knlGS:0000000000000000 [726780.909964] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [726780.914078] CR2: 00007f6cd5d430c8 CR3: 0000003c7e6b6005 CR4: 00000000001606e0 [726780.918837] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [726780.923433] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [726780.927882] Call Trace: [726780.930410] inet_release+0x42/0x70 [726780.933423] inet6_release+0x30/0x40 [726780.936439] sock_release+0x25/0x80 [726780.939421] sock_close+0x12/0x20 [726780.942342] __fput+0xea/0x220 [726780.945170] ____fput+0xe/0x10 [726780.947963] task_work_run+0x8c/0xb0 [726780.951052] exit_to_usermode_loop+0x6b/0x95 [726780.954480] do_syscall_64+0x182/0x1b0 [726780.957586] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 [726780.961288] RIP: 0033:0x7fd82b27085d [726780.964349] RSP: 002b:00007f6acd466b50 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 [726780.969280] RAX: 0000000000000000 RBX: 00007f65b2418220 RCX: 00007fd82b27085d [726780.973987] RDX: 0000000000000003 RSI: 00007f6d5e9990c0 RDI: 00000000000002d8 [726780.978689] RBP: 00007f6acd466c00 R08: 0000000001622848 R09: 00000000000001f8 [726780.983373] R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 [726780.988049] R13: 00007f6d5e9990c0 R14: 0000000001d87cc0 R15: 00000000000002d8 [726780.992700] Code: ff 48 8b 43 28 31 f6 48 89 df 48 8b 40 10 e8 49 2d 4e 00 48 8b 43 30 48 8b 80 98 01 00 00 65 48 ff 80 90 01 00 00 e9 49 ff ff ff <0f> 0b e9 ab fc ff ff 48 8b 43 28 31 f6 48 89 df 48 8b 40 10 e8 [726781.004156] ---[ end trace 8525f27644ac4631 ]---