You are not logged in.

#1 2011-09-05 06:34:30

neok
Member
From: Cyprus
Registered: 2003-12-14
Posts: 190
Website

linphone seg faulting, bug in ffmpeg/libswscale?

Hi,

After struggling for a few days to find an alternative to skype that works with my x86-64 box, I finally ended up trying linphone. However the GUI version crashed with segmentation fault at startup. I used valgrind to debug and the fault is caused when the jpeg2yuv() function in linphone-3.4.3/mediasteamer2/src/nowebcam.c is called when no webcam is present. In this function its the call of sws_scale() at around line 82 that causes a segfault in libswscale of ffmpeg.

I installed ffmpeg from source and eventually I found that the bug clears when I configure ffmpeg with the --disable-optimizations option for configure. Now I can't really tell if the bug is in ffmpeg or if gcc breaks the binary when optimizing. Any ideas please?

linphone: very nice! now works out of the box with both audio and video and no problems with my symmetric NAT wireless router.


Regards

Neoklis ... Ham Radio Call: 5B4AZ

Offline

#2 2011-09-05 20:00:04

pigiron
Member
From: USA
Registered: 2009-07-14
Posts: 150

Re: linphone seg faulting, bug in ffmpeg/libswscale?

First, let me say that I'm very impressed with your debugging work (and it is work) before coming here. So refreshing from the usual posts.

Now, having said that, when I've hit similar situations, the way I got to the "root" of the problem was to get it back into failure mode, and then step through the failing section in (dis)assembler mode... using gdb's nexti, stepi, disassemble, etc. commands.

Sometimes compilers optimize code out that may cause a problem. But, every time (except once) I've found it to be a code bug (as opposed to a compiler bug). For example, not adding a "volatile" tag to a C code variable.

Last edited by pigiron (2011-09-05 20:21:38)

Offline

#3 2011-09-06 04:36:44

neok
Member
From: Cyprus
Registered: 2003-12-14
Posts: 190
Website

Re: linphone seg faulting, bug in ffmpeg/libswscale?

pigiron wrote:

First, let me say that I'm very impressed with your debugging work (and it is work) before coming here. So refreshing from the usual posts.

Now, having said that, when I've hit similar situations, the way I got to the "root" of the problem was to get it back into failure mode, and then step through the failing section in (dis)assembler mode... using gdb's nexti, stepi, disassemble, etc. commands.

Sometimes compilers optimize code out that may cause a problem. But, every time (except once) I've found it to be a code bug (as opposed to a compiler bug). For example, not adding a "volatile" tag to a C code variable.

OK thanks for the reply and good words pigiron. I will try to continue debugging and will report any findings. I am re-installing Arch with the latest installer so it will have to wait a bit....


Regards

Neoklis ... Ham Radio Call: 5B4AZ

Offline

#4 2011-09-07 08:20:37

neok
Member
From: Cyprus
Registered: 2003-12-14
Posts: 190
Website

Re: linphone seg faulting, bug in ffmpeg/libswscale?

Apparently this is a bug that effects 64-bit machines with ffmpeg compiled with optimizations by gcc 4.6. There is a bug report already at the ffmpeg bug tracker but having tried the latest nightly build, the bug is still there. It can be avoided by configuring and compiling with the --disable-optimizations flag, however this means I had to overwite ffmpeg as installed by pacman.

Perhaps the ffmpeg package in the repos should be recompiled as above, till a bug fix is available?


Regards

Neoklis ... Ham Radio Call: 5B4AZ

Offline

#5 2011-09-07 09:46:14

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: linphone seg faulting, bug in ffmpeg/libswscale?

neok wrote:

Apparently this is a bug that effects 64-bit machines with ffmpeg compiled with optimizations by gcc 4.6. There is a bug report already at the ffmpeg bug tracker but having tried the latest nightly build, the bug is still there. It can be avoided by configuring and compiling with the --disable-optimizations flag, however this means I had to overwite ffmpeg as installed by pacman.

Perhaps the ffmpeg package in the repos should be recompiled as above, till a bug fix is available?

Just use the ffmpeg ABS package, adjust the PKGBUILD and recompile yourself. The result will be installed like any other Arch package.


To know or not to know ...
... the questions remain forever.

Offline

#6 2011-09-08 08:43:04

neok
Member
From: Cyprus
Registered: 2003-12-14
Posts: 190
Website

Re: linphone seg faulting, bug in ffmpeg/libswscale?

bernarcher wrote:
neok wrote:

Apparently this is a bug that effects 64-bit machines with ffmpeg compiled with optimizations by gcc 4.6. There is a bug report already at the ffmpeg bug tracker but having tried the latest nightly build, the bug is still there. It can be avoided by configuring and compiling with the --disable-optimizations flag, however this means I had to overwite ffmpeg as installed by pacman.

Perhaps the ffmpeg package in the repos should be recompiled as above, till a bug fix is available?

Just use the ffmpeg ABS package, adjust the PKGBUILD and recompile yourself. The result will be installed like any other Arch package.

Thanks! I tried it and it worked. There are issues in linphone also and I will try to fix them in this way.


Regards

Neoklis ... Ham Radio Call: 5B4AZ

Offline

#7 2011-09-29 15:25:19

bagheera
Member
Registered: 2009-06-13
Posts: 84

Re: linphone seg faulting, bug in ffmpeg/libswscale?

I have the same problem with linphone. What exactly i have to change in PKGBUILD ? Can i do that in yaourt?


arch linux user

Offline

#8 2011-09-29 15:36:28

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: linphone seg faulting, bug in ffmpeg/libswscale?

Forget yaourt. Do this (or similar) as your normal user:

mkdir ~/abs && cd ~/abs
ABSROOT=. abs extra/ffmpeg
cd extra/ffmpeg
$EDITOR PKGBUILD
# edit it as you want
makepkg -si

Edit: make sure you have the base-devel group and abs package installed.

Last edited by Mr.Elendig (2011-09-29 15:37:12)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#9 2011-09-30 19:30:35

bagheera
Member
Registered: 2009-06-13
Posts: 84

Re: linphone seg faulting, bug in ffmpeg/libswscale?

I just installed ffmpeg and issue is gone (official version from repo). Thanks.


arch linux user

Offline

Board footer

Powered by FluxBB