Re: [Linuxptp-users] ptp4l is dead with Segmentation Fault
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Richard C. <ric...@gm...> - 2012-03-10 07:26:21
|
On Fri, Mar 09, 2012 at 11:30:17PM +0900, Takahiro Shimizu wrote: > Hello Richard, > > Thank you for the information. > > Please forget what I said. > > > > I think I see the bug. I will send a patch to try out soon. > > > > > I will wait your patch. I think you are sometimes not getting any time stamp at all, and this causes the try_again loop to end without ever calling recvmsg() successfully. When this happens, the control[] buffer contains uninitialized data from the stack. Can you please try the following patch? Thanks, Richard --- diff --git a/udp.c b/udp.c index 8a3dc7b..d097f98 100644 --- a/udp.c +++ b/udp.c @@ -257,6 +257,7 @@ static int receive(int fd, void *buf, int buflen, struct msghdr msg; struct timespec *ts = NULL; + memset(control, 0, sizeof(control)); memset(&msg, 0, sizeof(msg)); msg.msg_iov = &iov; msg.msg_iovlen = 1; |