2004-10-20 01:46
by Vasil KolevThe most important thing for today – I found the problem with ffserver. In fact, it turned out to be a problem with ffmpeg, but took a lot of time to be found, and after that I discovered that it got fixed in the latest versions (and have broken a lot of other stuff :) ).
The problem is in libavformat/tcp.c, it’s as follows (I’ve removed some ifdefs for clarity):
ret = write(s->fd, buf, size); if (ret < 0 && errno != EINTR && errno != EAGAIN) return -errno; size -= ret; buf += ret;
Which at EAGAIN or EINTR in fact moves the buffer backwards, because ret=-1. This way the stream sent by ffmpeg get screwed, and ffserver goes mad.
I went to take a look at the cvs, and found out that the problem is fixed here, right after the 0.4.8 release. If I had looked at the way ffmpeg worked, I would've caught it with the first strace, here's the output:
write(4, "fm\0\0\0\3\346\323\337\326< |\10\r\35?\225j\234G\260\263"..., 32768) = 3432 write(4, "\23\21\330\214V1WD\6\347;\305\213\24A\265C\323g\3238/\310"..., 29336) = -1 EAGAIN (Resource temporarily unavailable) write(4, "\v\23\21\330\214V1WD\6\347;\305\213\24A\265C\323g\3238"..., 29337) = -1 EAGAIN (Resource temporarily unavailable) write(4, "M\v\23\21\330\214V1WD\6\347;\305\213\24A\265C\323g\323"..., 29338) = -1 EAGAIN (Resource temporarily unavailable) write(4, "\vM\v\23\21\330\214V1WD\6\347;\305\213\24A\265C\323g\323"..., 29339) = -1 EAGAIN (Resource temporarily unavailable) write(4, "%\vM\v\23\21\330\214V1WD\6\347;\305\213\24A\265C\323g\323"..., 29340) = -1 EAGAIN (Resource temporarily unavailable)
And for the search engines to be able to catch it in a better way, a short description of the problem: ffserver dies with segmentation fault (e.g. SIGSEGV) when network problems occur on the link between ffmpeg and ffserver.
Another thing for today was my work on a Itanium2, that we'll be showing at openfest - I'll be downloading some other distro, at the moment it has a SLES8 on it, which is really outdated. The machine also roars like two 32b servers, and my head hurts... I don't like its speed, either - looks like for something to work ok on it, it has to be compiled with ICC, and that's pretty hard task for linux, not only because not everything compiled with icc works (for example - the kernel, with removed GNUisms).
November 10th, 2004 at 13:40
5028 ya know eredclips