How to add debug info?

*nix specific usage questions
Makarov
Blank Cone
Blank Cone
Posts: 29
Joined: 19 Mar 2010 15:33
Location: Saint-Petersburg, Russia
Contact:

How to add debug info?

Postby Makarov » 26 May 2010 12:18

I found segfault in vlc and can't fill correctly bug report. I can't view full trace in gdb, I can't understand how add debug info.

OS FreeBSD 7.3.

I compiled vlc (1.1-rc) with "--disable-optimizations--enable-debug" and add to CFLAGS (-O0 -g3).

Code: Select all

> gdb /usr/local/bin/vlc

Code: Select all

run -vvv udp://@239.195.0.2:1234 :sout='#transcode{vcodec=WMV2,vb=650,fps=10,width=320,height=240,acodec=wma2,ab=32,channels=1,samplerate=22050}:std{access=mmsh,mux=asfh,dst=:8001}'
After 10-15 seconds SEGFAULT. And you can see that gdb don't know debug symbols.

Code: Select all

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x2a310260 (LWP 100231)] 0x289838fd in ff_dnxhd_init_mmx () from /usr/local/lib/libavcodec.so.52 (gdb) bt #0 0x289838fd in ff_dnxhd_init_mmx () from /usr/local/lib/libavcodec.so.52 #1 0x2a434000 in ?? () #2 0x00000001 in ?? () #3 0x288577e0 in MPV_frame_start () from /usr/local/lib/libavcodec.so.52 #4 0x00095880 in ?? () #5 0x00000003 in ?? () #6 0x2a4f4730 in ?? () #7 0x00000003 in ?? () #8 0x2a4f4000 in ?? () #9 0x00000000 in ?? () #10 0x2b800724 in ?? () #11 0x28174f20 in ?? () from /usr/local/lib/libvlccore.so.4 #12 0x0000000c in ?? () #13 0x0000000b in ?? () #14 0xbf6778e8 in ?? () #15 0x28100d52 in picture_NewFromResource (p_fmt=Error accessing memory address 0x18: Bad address. ) at video_output/vout_pictures.c:792 Previous frame inner to this frame (corrupt stack?)

This is dump of udp stream (http://88.85.76.18/stream.dump)

SEGFAULT can also be replicated with a dumpfile.

Code: Select all

vlc -vvv ./stream.dump :sout='#transcode{vcodec=WMV2,vb=650,fps=10,width=320,height=240,acodec=wma2,ab=32,channels=1,samplerate=22050}:std{access=mmsh,mux=asfh,dst=:8001}'

xtophe
Big Cone-huna
Big Cone-huna
Posts: 1209
Joined: 24 Nov 2003 10:12
Location: Bristol, England

Re: How to add debug info?

Postby xtophe » 26 May 2010 13:10

make install might be stripping the binaries. try running from your buildtree
Xtophe

Makarov
Blank Cone
Blank Cone
Posts: 29
Joined: 19 Mar 2010 15:33
Location: Saint-Petersburg, Russia
Contact:

Re: How to add debug info?

Postby Makarov » 26 May 2010 14:10

make install might be stripping the binaries. try running from your buildtree

Code: Select all

ls -l ./bin/.libs/ -rwxr-xr-x 1 root igor 93455 May 21 20:30 vlc -rwxr-xr-x 1 root igor 31913 May 21 20:30 vlc-cache-gen
vlc have size 93455. I see that vlc contain only symbols from vlc.c.

Code: Select all

.... .... 080491cc t getsym U libvlc_add_intf U libvlc_get_changeset U libvlc_get_version U libvlc_new U libvlc_playlist_play U libvlc_release U libvlc_wait 080491a9 t logbug 08048db4 T main 0804ac8c b object.4336 0804aca4 b override 0804aca8 b prng U pthread_atfork@@FBSD_1.0 U pthread_mutex_lock@@FBSD_1.0 U pthread_mutex_unlock@@FBSD_1.0 U pthread_sigmask@@FBSD_1.0 08049212 T putenv .... ....

Should vlc have debug symbols from libvlc.so?

Rémi Denis-Courmont
Developer
Developer
Posts: 15287
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to add debug info?

Postby Rémi Denis-Courmont » 26 May 2010 18:40

No. The debug symbols for libvlc(core) are in libvlc(core). Make sure you ran "make install" and not "make installstrip". Also, you seem to have a stripped libavcodec library...

As Xtophe said, it might be simpler to run and debug VLC from the build tree (gdb ./vlc).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Makarov
Blank Cone
Blank Cone
Posts: 29
Joined: 19 Mar 2010 15:33
Location: Saint-Petersburg, Russia
Contact:

Re: How to add debug info?

Postby Makarov » 26 May 2010 19:31

No. The debug symbols for libvlc(core) are in libvlc(core). Make sure you ran "make install" and not "make installstrip". Also, you seem to have a stripped libavcodec library...

As Xtophe said, it might be simpler to run and debug VLC from the build tree (gdb ./vlc).
I understand you Remi.

I made "gmake install", and configure and build with "--enable-debug --disable-optimizations".

And i run from local tree. On my freebsd compiled binary of vlc in local tree located in ./bin/.libs/vlc.
See my early post, where i wrote that size of vlc in local tree is 93455 (same size after install in ( /usr/local/bin/vlc).

Makarov
Blank Cone
Blank Cone
Posts: 29
Joined: 19 Mar 2010 15:33
Location: Saint-Petersburg, Russia
Contact:

Re: How to add debug info?

Postby Makarov » 28 May 2010 11:33

Can someone download this file (http://88.85.76.18/stream.dump) and reproduce segfault?
This udp transcode is very important to me. This file is udp dump stream.

Code: Select all

vlc -vvv ./stream.dump :sout='#transcode{vcodec=WMV2,vb=650,fps=10,width=320,height=240,acodec=wma2,ab=32,channels=1,samplerate=22050}:std{access=mmsh,mux=asfh,dst=:8001}'

Rémi Denis-Courmont
Developer
Developer
Posts: 15287
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to add debug info?

Postby Rémi Denis-Courmont » 29 May 2010 09:17

Works fine here. The crash seems to occur in FFmpeg anyway, so your version may be buggy.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Makarov
Blank Cone
Blank Cone
Posts: 29
Joined: 19 Mar 2010 15:33
Location: Saint-Petersburg, Russia
Contact:

Re: How to add debug info?

Postby Makarov » 31 May 2010 11:28

Works fine here. The crash seems to occur in FFmpeg anyway, so your version may be buggy.
I updated ffmpeg to latest svn (SVN-r23391) and again segfault.

I tryed:

Code: Select all

ffmpeg -i ./stream.dump -r 10 -acodec wmav2 -vcodec wmv2 -ar 22050 -ac 1 -ab 32k -vb 650k -s 320x240 test.asf
FFMpeg work ok without warnings and errors.

But:

Code: Select all

vlc -vvv ./stream.dump :sout='#transcode{vcodec=WMV2,vb=650,fps=10,width=320,height=240,acodec=wma2,ab=32,channels=1,samplerate=22050}:std{access=mmsh,mux=asfh,dst=:8001}'
Works with many errors and then segfault

Code: Select all

ac-tex damaged at 3 5 mb incr damaged ac-tex damaged at 40 14 slice mismatch ac-tex damaged at 35 24 ac-tex damaged at 9 30 ac-tex damaged at 14 32 ac-tex damaged at 1 33 vbv buffer overflow ... ac-tex damaged at 26 8 ac-tex damaged at 35 13 mb incr damaged mb incr damaged ac-tex damaged at 9 24 ac-tex damaged at 25 27 mb incr damaged ac-tex damaged at 7 32 invalid mb type in P Frame at 33 33 end mismatch left=1540 2380C Missing picture start code [0x2ae0d240] stream_out_transcode stream out debug: drift is too high, resetting master sync [0x2ae19840] avcodec encoder warning: almost fed libavcodec with a frame in the past (current: 1275297501905485, last: 1275297502085485) Segmentation fault: 11 (core dumped)


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 37 guests