Segfault on play

General discussions
Locked
tiliqua
Posts: 21
Joined: Wed Dec 08, 2010 5:31 pm

Segfault on play

Post by tiliqua »

Guayadeque segfaults 100% of the time for me when trying to play tracks. I open guayadeque, select a song and double click it or click play in the context menu and the program immediately crashes.

This occurs running guayadeque compiled from svn (1379) and the guayadeque-svn (1374) package from the PPA on ubuntu 10.04 32bit. It doesn't happen using guayadeque 0.2.7 (1224) from the PPA.

gdb backtrace below:


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xab2ffb70 (LWP 3424)]
0x025597e2 in _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
(gdb) bt
#0 0x025597e2 in _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
#1 0x02559b2f in _nss_wins_gethostbyname2_r () from /lib/libnss_wins.so.2
#2 0x00ffeb03 in ?? () from /lib/tls/i686/cmov/libc.so.6
#3 0x01000a65 in getaddrinfo () from /lib/tls/i686/cmov/libc.so.6
#4 0x00bbf83d in ?? () from /usr/lib/libcurl-gnutls.so.4
#5 0x00bb93ef in ?? () from /usr/lib/libcurl-gnutls.so.4
#6 0x00b90073 in ?? () from /usr/lib/libcurl-gnutls.so.4
#7 0x00b90257 in ?? () from /usr/lib/libcurl-gnutls.so.4
#8 0x00ba5655 in ?? () from /usr/lib/libcurl-gnutls.so.4
#9 0x00ba588d in ?? () from /usr/lib/libcurl-gnutls.so.4
#10 0x00bae7e4 in ?? () from /usr/lib/libcurl-gnutls.so.4
#11 0x00baf583 in curl_easy_perform () from /usr/lib/libcurl-gnutls.so.4
#12 0x083a90be in wxCurlBase::Perform (this=0xbc8ff4) at /home/tiliqua/build/guayadeque/src/curl/base.cpp:517
#13 0x083aa7d8 in wxCurlHTTP::Get (this=0xab2ff020, buffer=..., szRemoteFile=...)
at /home/tiliqua/build/guayadeque/src/curl/http.cpp:299
#14 0x0828b124 in GetUrlContent (url=..., referer=..., gzipped=false) at /home/tiliqua/build/guayadeque/src/Utils.cpp:428
#15 0x081857bd in guLyricPluginEngine::SearchLyric (this=0xab302fd0)
at /home/tiliqua/build/guayadeque/src/LyricsPanel.cpp:1393
#16 0x08177eae in guSearchLyricEngine::Entry (this=0xab302fd0) at /home/tiliqua/build/guayadeque/src/LyricsPanel.cpp:914
#17 0x00211138 in wxThreadInternal::PthreadStart(wxThread*) () from /usr/lib/libwx_baseu-2.8.so.0
#18 0x0021119d in wxPthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#19 0x00ce896e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#20 0x01026a4e in clone () from /lib/tls/i686/cmov/libc.so.6
User avatar
anonbeat
Posts: 2048
Joined: Thu Sep 16, 2010 9:47 pm

Segfault on play

Post by anonbeat »

This crash happens into libcurl and not in guayadeque itself.

Can you do a couple of more backtraces to check if its happening all the times in the same place ?

Thanks for your help
tiliqua
Posts: 21
Joined: Wed Dec 08, 2010 5:31 pm

Segfault on play

Post by tiliqua »

A couple more backtraces below. They both occur in libcurl. The first happened trying to update radio stations, the last crash happened even after I'd unchecked follow player on the LastFM and Lyrics tabs.


23:13:07: Updating radiostations for genre 'Alternative'

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb1afdb70 (LWP 19465)]
0x022437e2 in _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
(gdb) bt
#0 0x022437e2 in _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
#1 0x02243b2f in _nss_wins_gethostbyname2_r () from /lib/libnss_wins.so.2
#2 0x00ffeb03 in ?? () from /lib/tls/i686/cmov/libc.so.6
#3 0x01000a65 in getaddrinfo () from /lib/tls/i686/cmov/libc.so.6
#4 0x00bbf83d in ?? () from /usr/lib/libcurl-gnutls.so.4
#5 0x00bb93ef in ?? () from /usr/lib/libcurl-gnutls.so.4
#6 0x00b90073 in ?? () from /usr/lib/libcurl-gnutls.so.4
#7 0x00b90257 in ?? () from /usr/lib/libcurl-gnutls.so.4
#8 0x00ba5655 in ?? () from /usr/lib/libcurl-gnutls.so.4
#9 0x00ba588d in ?? () from /usr/lib/libcurl-gnutls.so.4
#10 0x00bae7e4 in ?? () from /usr/lib/libcurl-gnutls.so.4
#11 0x00baf583 in curl_easy_perform () from /usr/lib/libcurl-gnutls.so.4
#12 0x083aec1e in wxCurlBase::Perform (this=0xbc8ff4) at /home/tiliqua/build/guayadeque-trunk/src/curl/base.cpp:517
#13 0x083b0338 in wxCurlHTTP::Get (this=0xb1afcee0, buffer=..., szRemoteFile=...)
at /home/tiliqua/build/guayadeque-trunk/src/curl/http.cpp:299
#14 0x0828f284 in GetUrlContent (url=..., referer=..., gzipped=false)
at /home/tiliqua/build/guayadeque-trunk/src/Utils.cpp:428
#15 0x08241f9f in guShoutCast::GetStations (this=0x9122e48, source=0, flags=0, GenreName=..., GenreId=4,
Stations=0xb1afd23c, MinBitRate=128) at /home/tiliqua/build/guayadeque-trunk/src/Shoutcast.cpp:141
#16 0x082355d3 in guUpdateRadiosThread::Entry (this=0x91b0fc0)
at /home/tiliqua/build/guayadeque-trunk/src/RadioPanel.cpp:1958
#17 0x00211138 in wxThreadInternal::PthreadStart(wxThread*) () from /usr/lib/libwx_baseu-2.8.so.0
---Type to continue, or q to quit---
#18 0x0021119d in wxPthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#19 0x00ce896e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#20 0x01026a4e in clone () from /lib/tls/i686/cmov/libc.so.6
(gdb)



Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xac27cb70 (LWP 19731)]
0x0254a7e2 in _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
(gdb) bt
#0 0x0254a7e2 in _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
#1 0x0254ab2f in _nss_wins_gethostbyname2_r () from /lib/libnss_wins.so.2
#2 0x00ffeb03 in ?? () from /lib/tls/i686/cmov/libc.so.6
#3 0x01000a65 in getaddrinfo () from /lib/tls/i686/cmov/libc.so.6
#4 0x00bbf83d in ?? () from /usr/lib/libcurl-gnutls.so.4
#5 0x00bb93ef in ?? () from /usr/lib/libcurl-gnutls.so.4
#6 0x00b90073 in ?? () from /usr/lib/libcurl-gnutls.so.4
#7 0x00b90257 in ?? () from /usr/lib/libcurl-gnutls.so.4
#8 0x00ba5655 in ?? () from /usr/lib/libcurl-gnutls.so.4
#9 0x00ba588d in ?? () from /usr/lib/libcurl-gnutls.so.4
#10 0x00bae7e4 in ?? () from /usr/lib/libcurl-gnutls.so.4
#11 0x00baf583 in curl_easy_perform () from /usr/lib/libcurl-gnutls.so.4
#12 0x083aec1e in wxCurlBase::Perform (this=0xbc8ff4) at /home/tiliqua/build/guayadeque-trunk/src/curl/base.cpp:517
#13 0x083b0338 in wxCurlHTTP::Get (this=0xac27bdc0, buffer=..., szRemoteFile=...)
at /home/tiliqua/build/guayadeque-trunk/src/curl/http.cpp:299
#14 0x083b05c9 in wxCurlHTTP::Get (this=0xac27bdc0, buffer=@0xac27bdb0, szRemoteFile=...)
at /home/tiliqua/build/guayadeque-trunk/src/curl/http.cpp:271
#15 0x0812dd61 in guLastFMRequest::DoRequest (this=0xac27c028, AddSign=false, IsGetAction=true)
at /home/tiliqua/build/guayadeque-trunk/src/LastFM.cpp:138
#16 0x08133955 in guLastFM::TrackGetSimilar (this=0x86bc340, Artist=..., Track=...)
at /home/tiliqua/build/guayadeque-trunk/src/LastFM.cpp:1576
#17 0x081c927e in guSmartAddTracksThread::AddSimilarTracks (this=0x8dcdae0, artist=..., track=..., songs=0xac27c218)
---Type to continue, or q to quit---
at /home/tiliqua/build/guayadeque-trunk/src/PlayerPanel.cpp:3032
#18 0x081d1a29 in guSmartAddTracksThread::Entry (this=0x8dcdae0)
at /home/tiliqua/build/guayadeque-trunk/src/PlayerPanel.cpp:3074
#19 0x00211138 in wxThreadInternal::PthreadStart(wxThread*) () from /usr/lib/libwx_baseu-2.8.so.0
#20 0x0021119d in wxPthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#21 0x00ce896e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#22 0x01026a4e in clone () from /lib/tls/i686/cmov/libc.so.6
(gdb)
User avatar
anonbeat
Posts: 2048
Joined: Thu Sep 16, 2010 9:47 pm

Segfault on play

Post by anonbeat »

Update to latest svn 1380 and let me know if that solves the problem.
Also what is your libcurl version ? Im here with ubuntu 10.10 using libcurl4-gnutls-dev 7.21.0-1ubuntu1

Thanks for your help
tiliqua
Posts: 21
Joined: Wed Dec 08, 2010 5:31 pm

Segfault on play

Post by tiliqua »

I have ubuntu 10.04 with libcurl4-gnutls-dev 7.19.7-1ubuntu1
Same crash and backtrace with r1380.

Also, I just tried r1380 on 10.10 (on a VM running on my PC) with libcurl4-gnutls-dev 7.21.0-1ubuntu1 and got a similar crash, backtrace below:


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb2ab0b70 (LWP 13000)]
0x0224031a in _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
(gdb) bt
#0 0x0224031a in _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
#1 0x0224061f in _nss_wins_gethostbyname2_r () from /lib/libnss_wins.so.2
#2 0x010612de in ?? () from /lib/libc.so.6
#3 0x010633b5 in getaddrinfo () from /lib/libc.so.6
#4 0x00bb0bed in Curl_getaddrinfo_ex () from /usr/lib/libcurl-gnutls.so.4
#5 0x00ba9e8f in Curl_getaddrinfo () from /usr/lib/libcurl-gnutls.so.4
#6 0x00b7e066 in Curl_resolv () from /usr/lib/libcurl-gnutls.so.4
#7 0x00b7e193 in Curl_resolv_timeout () from /usr/lib/libcurl-gnutls.so.4
#8 0x00b90426 in ?? () from /usr/lib/libcurl-gnutls.so.4
#9 0x00b941b7 in ?? () from /usr/lib/libcurl-gnutls.so.4
#10 0x00b95046 in Curl_connect () from /usr/lib/libcurl-gnutls.so.4
#11 0x00b9caad in ?? () from /usr/lib/libcurl-gnutls.so.4
#12 0x00b9dba3 in curl_easy_perform () from /usr/lib/libcurl-gnutls.so.4
#13 0x0839cfbe in wxCurlBase::Perform (this=0xbc0ff4) at /home/tiliquavm/build/guayadeque/src/curl/base.cpp:517
#14 0x0839e6f8 in wxCurlHTTP::Get (this=0xb2aafde0, buffer=..., szRemoteFile=...) at /home/tiliquavm/build/guayadeque/src/curl/http.cpp:299
#15 0x0828018c in GetUrlContent (url=..., referer=..., gzipped=false) at /home/tiliquavm/build/guayadeque/src/Utils.cpp:428
#16 0x08233983 in guShoutCast::GetStations (this=0x86f2f90, source=0, flags=0, GenreName=..., GenreId=4, Stations=0xb2ab013c, MinBitRate=128) at /home/tiliquavm/build/guayadeque/src/Shoutcast.cpp:141
#17 0x08227373 in guUpdateRadiosThread::Entry (this=0x8814240) at /home/tiliquavm/build/guayadeque/src/RadioPanel.cpp:1958
#18 0x0020bfb8 in wxThreadInternal::PthreadStart(wxThread*) () from /usr/lib/libwx_baseu-2.8.so.0
#19 0x0020c01d in wxPthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#20 0x00ce2cc9 in start_thread () from /lib/libpthread.so.0
#21 0x0108a6be in clone () from /lib/libc.so.6
User avatar
anonbeat
Posts: 2048
Joined: Thu Sep 16, 2010 9:47 pm

Segfault on play

Post by anonbeat »

I had installed libcurl ssl instead of libcurl tls.
Installing now to check

Thanks for your help
User avatar
anonbeat
Posts: 2048
Joined: Thu Sep 16, 2010 9:47 pm

Segfault on play

Post by anonbeat »

Now Im sure Im using libcurl-gnutls and its working fine here

ldd ./guayadeque | grep curl
libcurl-gnutls.so.4 => /usr/lib/libcurl-gnutls.so.4 (0x00007f72c615c000)

There must be something wrong with libcurl in your system
tiliqua
Posts: 21
Joined: Wed Dec 08, 2010 5:31 pm

Segfault on play

Post by tiliqua »

Yes, it seem like there must be an issue. I have tried on a third computer (Ubuntu 10.04) at work using both the guayadeque-svn (2.8-1374) package and r1380 compiled from SVN with no problems.

I still find it strange that I had the same crash on 2 different computers at home, running 2 different versions of Ubuntu and libcurl.

I will build fresh Ubuntu 10.10 & 10.04 VMs at home and see if I can still reproduce.
tiliqua
Posts: 21
Joined: Wed Dec 08, 2010 5:31 pm

Segfault on play

Post by tiliqua »

The problem is in the winbind package (which I have used to mount Windows CIFS network shares), specifically _nss_wins_gethostbyname_r () from /lib/libnss_wins.so.2
See https://bugs.launchpad.net/ubuntu/+sour ... bug/369274 and https://bugs.launchpad.net/ubuntu/+sour ... bug/529714

The fix is to either remove the winbind package or move the 'wins' entry in /etc/nsswitch.conf after the 'dns' entry. i.e
#hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4
hosts: files mdns4_minimal [NOTFOUND=return] dns wins mdns4

Removing winbind will definitely break mounting Windows CIFS shares, but I don't know if changing nsswitch.conf will too as I no longer mount Windows CIFS shares in fstab, I just use Gnome VFS instead to connect to my Windows server.
User avatar
anonbeat
Posts: 2048
Joined: Thu Sep 16, 2010 9:47 pm

Segfault on play

Post by anonbeat »

Great findings. Thanks for report it back

Thanks for your help
Locked