System rebooted with "KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1193)" in RHEL 5.
Environment
- Red Hat Enterprise Linux 5
Issue
-
System rebooted with
KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1193). -
Server rebooted with below messages.
Apr 1 13:10:44 Server01 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1193)
Apr 1 13:10:44 Server01 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1193)
Apr 1 13:10:45 Server01 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at net/ipv4/tcp.c (1257)
Apr 1 13:10:45 Server01 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1193)
Apr 1 13:10:45 Server01 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at net/ipv4/tcp.c (1257)
Apr 1 13:10:45 Server01 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1193)
Apr 1 13:10:45 Server01 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at net/ipv4/tcp.c (1257)
Apr 1 13:10:45 Server01 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1193)
Resolution
- Switch to Red Hat shipped driver.
Root Cause
-
kernel assertionmessages is kernel's way representing that there is some problem here in this case its at1193and1257line fromnet/ipv4/tcp.c. -
In
net/ipv4/tcp.ceverything happening in this scenario happened intcp_recvmsgroutine. -
This routine is used to copy the data from the socket to the user buffer
- net/ipv4/tcp.c
if (copied) {
if (sk->sk_err ||
sk->sk_state == TCP_CLOSE ||
(sk->sk_shutdown & RCV_SHUTDOWN) ||
!timeo ||
signal_pending(current) ||
1193 (flags & MSG_PEEK)) <======
break;
(flags & MSG_PEEK)) checks if there is any data in the socket to copied.
The break leads us to calling the Bug trap which kernel way of handling the exception
1242 BUG_TRAP(tp->copied_seq == tp->rcv_nxt ||
(flags & (MSG_PEEK | MSG_TRUNC))); <<----
- when the packet reaches the
1193line number it checks if data lenth is zero (the data to copied to the user buffer). - As backlog is already checked the kernel expects that there should be no data here. If the data length is not zero it enters the loop.
- Further for confirmation it finds data using
(flags & MSG_PEEK)flag.Which is problem and here it calls the BugTrap. - Now this flag
MSG_PEEKis managed by the driver as the system is using HP driver we wont be able to troubleshoot it further.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
