[MPlayer-dev-eng] workaround for SEGFAULTs during rtsp download

Willem de Bruijn wdb at few.vu.nl
Thu Mar 10 17:47:32 CET 2005


dear mplayer developers,

   I've been experiencing frequent Mplayer crashes during realvideo stream 
playback. To be precise, the player got killed with signal 11 (SEGFAULT) 
during stream_open (or open_stream, I forgot). 

  Some browsing on the internet showed that there are two types of rtsp files, 
which explained why this only happened occasionally. The bug is related to 
the libmpdemux realvideo code. With gdb I traced the error to a seemingly 
safe malloc at line 204 of libmpdemux/realrtsp/sdpplin.c

  I'm not sure what goes wrong here, but some printf statements showed that it 
hanged the second time this line was executed. It is always executed twice, 
first for 417 characters, then for 384 (for one specific download).

Replacing the 'sizeof(char)' which evaluates to 1 in the expression with '2', 
- to be on the safe side - fixed the issue. That is, I'm now happily 
downloading a realvideo file that used to make MPlayer crash. 

  This problem was reproducible under 1.0-pre5, 1.0pre6 and today's CVS 
tarball. It is probably related to my 64 bit platform. To make this report 
complete here are my system's vital stats:

amd64 3000+, gcc 3.4.3, patched gentoo linux 2.6.7 (ugh, I didn't know I was 
running a patched kernel). The mplayer build I used was full autodetect 
except from the debug option.

  In short: there appears to be some issue with allocing data. A hack is 
easily implemented. Fixing the bug nicely might not be.

I honestly can't see how a malloc of sizeof(char) * 384 can crash a system. 
Perhaps it doesn't directly, but it did appear to be the main problem. Could 
this be related to a thread that is waiting on this data? In any case, 
increasing the buffer size helped.

cheers,

  Willem
-- 

Willem de Bruijn

PhD student at the Computer Systems group, 
Vrije Universiteit Amsterdam

office +31 20 598 7790   |  VU-FEW Room R5.23
mobile +31 6 2695 2446   |  De Boelelaan 1081
www.wdebruij.dds.nl   |  1081 HV Amsterdam, NL




More information about the MPlayer-dev-eng mailing list