2004-10-19 04:40

by Vasil Kolev

ffserver, et tu mama tambien!

The day wasn’a anything special, my glasses are undergoing repairs, I went through the project to check on some things, after which we had a meeting for OpenFest, and to test the camera. It turned out that we don’t have the required cable, today I’ll be looking at the stores.

After that I went home, with some lasagna, ate, and started looking for a problem in ffserver, it was segfaulting at times.

I tried gdb, valgrind and strace on in, read the sources of 0.4.8, 0.4.7, the cvs snapshot from their page and the latest one… I got to the following conclusion – it does screw the .ffm file SOMEWHERE, in which he keeps the current stream, because of network problems, and when the clients reach that, it dies with SIGSEGV. My night passed in looking at things like this:

193.110.159.41 - - [Tue Oct 19 01:10:15 2004] "GET /test2.avi HTTP/1.0" 200 5309590
193.110.159.41 - - [Tue Oct 19 01:12:06 2004] "GET /test1.avi HTTP/1.0" 200 10399138
Segmentation fault (core dumped)
marla:/home/vasil$ gdb --core=core ffmpeg-0.4.8/ffserver
....
#0  0x400c31b7 in memcpy () from /lib/libc.so.6
(gdb) bt
#0  0x400c31b7 in memcpy () from /lib/libc.so.6
#1  0x08062db1 in ffm_read_data (s=0x8288260, buf=0x82cbcc3 "....", size=6421, 
    first=0) at ffm.c:354
#2  0x080632fe in ffm_read_packet (s=0x8288260, pkt=0xbfffbc88) at ffm.c:511
#3  0x0805da4c in av_read_packet (s=0x8288260, pkt=0xbfffbc88) at utils.c:424
#4  0x08054998 in http_prepare_data (c=0x8295270) at ffserver.c:2116
#5  0x0805501a in http_send_data (c=0x8295270) at ffserver.c:2384
#6  0x08051f60 in handle_connection (c=0x8295270) at ffserver.c:879
#7  0x0805191d in http_server () at ffserver.c:625
#8  0x0805b0f2 in main (argc=3, argv=0xbffffd94) at ffserver.c:4654
(gdb) frame 4
#4  0x08054998 in http_prepare_data (c=0x8295270) at ffserver.c:2116
2116        return av_read_packet(s, pkt);
(gdb) print c->state
$1 = HTTPSTATE_SEND_DATA
(gdb) print  c->stream->feed
$2 = (struct FFStream *) 0x827fed0
....
(gdb) print ffm->file_size  
$37 = 117878784
(gdb) print size
$38 = 6421
(gdb) print len 
$39 = -24191
(gdb) print fill_size
$40 = 28273
(gdb) print frame_offset
$41 = -24191
(gdb) q

It’s especially strange that the return value of a function that reads 2 bytes and makes a two-byte number from them, are something that is over 65536 0 and Valgrind didn’g catch any oveflows.

Because I got tired, I made some toast, had breakfast, and I’ll probably sleep until the afternoon.

One Response to “2004-10-19 04:40”

  1. debt consolidation Says:

    7173 ya know eredclips

Leave a Reply