Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when playing any radio stream #737

Open
ekatko1 opened this issue Dec 8, 2020 · 16 comments
Open

Segmentation fault when playing any radio stream #737

ekatko1 opened this issue Dec 8, 2020 · 16 comments

Comments

@ekatko1
Copy link

ekatko1 commented Dec 8, 2020

Thanks you for the grerat application! I just installed Sparky Linux Gamer Edition and anytime I double click on a radio stream to start playing it, the application crashes silently. Thanks for your help!

Steps to Reproduce (for bugs)

  1. Run exaile
  2. Open Radio tab > Radio Streams
  3. Open any radio stream.
  4. Double click on one of the stream's tracks to begin playback.

Expected Behavior

Start playing the stream, or at least provide an error as to why the stream cannot be played.

Current Behavior

Application closes unexpectedly. The termnal output is the following:

INFO    : Playing http://ice4.somafm.com/bagel-64-aac
Fatal Python error: Aborted

Thread 0x00007f1fd5952740 (most recent call first):
  File "/usr/lib/exaile/xl/player/gst/engine.py", line 432 in get_gst_state
  File "/usr/lib/exaile/xl/player/gst/engine.py", line 436 in get_position
  File "/usr/lib/exaile/xl/player/gst/engine.py", line 213 in get_position
  File "/usr/lib/exaile/xl/player/player.py", line 303 in get_position
  File "/usr/lib/exaile/xl/player/player.py", line 312 in get_time
  File "/usr/lib/exaile/xl/player/player.py", line 321 in get_progress
  File "/usr/lib/exaile/xlgui/widgets/playback.py", line 145 in on_timer
  File "/usr/lib/exaile/xlgui/widgets/playback.py", line 126 in __enable_timer
  File "/usr/lib/exaile/xlgui/widgets/playback.py", line 155 in on_playback_track_start
  File "/usr/lib/exaile/xl/event.py", line 359 in _emit
  File "/usr/lib/exaile/xl/event.py", line 300 in emit
  File "/usr/lib/exaile/xl/event.py", line 78 in log_event
  File "/usr/lib/exaile/xl/player/player.py", line 446 in engine_notify_track_start
  File "/usr/lib/exaile/xl/player/gst/engine.py", line 332 in _next_track
  File "/usr/lib/exaile/xl/player/gst/engine.py", line 250 in play
  File "/usr/lib/exaile/xl/player/player.py", line 194 in play
  File "/usr/lib/exaile/xl/player/queue.py", line 243 in play
  File "/usr/lib/exaile/xlgui/widgets/playlist.py", line 1051 in _play_track_at
  File "/usr/lib/exaile/xlgui/widgets/playlist.py", line 1270 in on_row_activated
  File "/usr/lib/exaile/xlgui/widgets/playlist.py", line 1364 in do_button_press_event
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1649 in main
  File "/usr/lib/exaile/xl/main.py", line 585 in __init__
  File "/usr/lib/exaile/exaile.py", line 60 in main
  File "/usr/lib/exaile/exaile.py", line 64 in <module>
Aborted

Environment

  • Operating System and version:
OS Name: SparkyLinux
OS Version: 6
OS Code Name: Po-Tolo

Arch: x86_64
Kernel: 5.9.0-4-amd64
RAM Total: 8080072 kB
SWAP Total: 0 kB
Window Manager: Xfwm4
Locale: en_CA.UTF-8
Foreign Architecturer Enabled: i386
  • Exaile Version: 4.1.0-beta1-1
devel
GStreamer: 1.18.1
GTK+: 3.24.23
GTK+ theme: Sparky6
Locale: en_CA UTF-8
Mutagen: 1.45.1
PyGObject: 3.38.0
Python: 3.9.1rc1
@rokm
Copy link
Member

rokm commented Dec 8, 2020

I've reproduced this in Sparky Linux GameOver edition in a VM. Playing any radio stream causes a segmentation fault, which brings exaile down. Unfortunately, the origin of segmentation fault is beyond exaile's reach, and therefore it is impossible to notify the user about the error and its cause.

For what is worth, this is the backtrace from the offending thread.

Thread 16 (Thread 0x7fffd7fff700 (LWP 13494) "pool-exaile"):
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7c50537 in __GI_abort () at abort.c:79
#2  0x00007ffff37e6301 in base_of_encoded_value (encoding=<optimized out>, context=<optimized out>) at /build/gcc-10-Pzlurt/gcc-10-10.2.0/src/libstdc++-v3/../libgcc/unwind-pe.h:120
#3  0x00007ffff37f1233 in __cxxabiv1::__gxx_personality_v0 (version=<optimized out>, actions=2, exception_class=5138137972254386944, ue_header=0x7fffb4001c40, context=0x7fffd7ffe430) at ../../../../src/libstdc++-v3/libsupc++/eh_personality.cc:455
#4  0x00007ffff3518e81 in __libunwind_Unwind_Resume () from /lib/x86_64-linux-gnu/libunwind.so.8
#5  0x00007fffd6fb0fd5 in __gnu_cxx::new_allocator<libproxy::url>::~new_allocator (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/10/ext/new_allocator.h:89
#6  std::allocator<libproxy::url>::~allocator (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/10/bits/allocator.h:162
#7  std::_Vector_base<libproxy::url, std::allocator<libproxy::url> >::_Vector_impl::~_Vector_impl (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/10/bits/stl_vector.h:128
#8  std::_Vector_base<libproxy::url, std::allocator<libproxy::url> >::~_Vector_base (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/10/bits/stl_vector.h:337
#9  std::vector<libproxy::url, std::allocator<libproxy::url> >::~vector (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/10/bits/stl_vector.h:683
#10 envvar_config_extension::get_config (this=<optimized out>, dst=...) at /usr/include/c++/10/bits/stl_vector.h:678
#11 0x00007fffd6fa823c in libproxy::proxy_factory::get_config (this=0x7fffe0010ae0, realurl=..., config=std::vector of length 0, capacity 0, ignore="") at ./libproxy/proxy.cpp:265
#12 0x00007fffd6fa8656 in libproxy::proxy_factory::get_proxies (this=0x7fffe0010ae0, realurl="http://ice2.somafm.com:80/") at ./libproxy/proxy.cpp:206
#13 0x00007fffd6fa8ad1 in px_proxy_factory_get_proxies (self=0x7fffe0010ae0, url=url@entry=0x7fffe030da30 "http://ice2.somafm.com:80/") at ./libproxy/proxy.cpp:465
#14 0x00007fffe823f55f in get_libproxy_proxies (task=0x7fffcc005c80, source_object=0x12d1420, task_data=0x7fffe030da30, cancellable=<optimized out>) at ../proxy/libproxy/glibproxyresolver.c:152
#15 0x00007ffff6e06fbe in g_task_thread_pool_thread (thread_data=0x7fffcc005c80, pool_data=<optimized out>) at ../../../gio/gtask.c:1417
#16 0x00007ffff70b96e4 in g_thread_pool_thread_proxy (data=<optimized out>) at ../../../glib/gthreadpool.c:354
#17 0x00007ffff70b8dfd in g_thread_proxy (data=0x7fffe000b640) at ../../../glib/gthread.c:820
#18 0x00007ffff7f95ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#19 0x00007ffff7d28d8f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

There's an uncaught exception coming from libproxy::proxy_factory::get_config. This is in turn called from px_proxy_factory_get_proxies and get_libproxy_proxies from GLib's proxy resolver, and from their parameters we can see that the functions are called to resolve proxy settings when trying to access the somafm server (http://ice2.somafm.com:80/).

libproxy/libproxy#68 makes an interesting note regarding crashes in libproxy:

GNOME users almost never notice this because glib-networking goes to pains to ensure that libproxy is only used when running outside of GNOME. The exception is if proxy autoconfig is enabled. So I guess almost everyone hitting this crash will be people using GNOME apps in KDE or other desktops.

And indeed, if GNOME session is installed and used instead of the default XFCE in Sparky Linux, the segfault goes away and the radio stream plays normally. I'd say that's a pretty good indicator that the issue is indeed with libproxy (the commit/patch that closed the quoted issue does seem to be part of libproxy1v5 0.4.15-15 on debian, so perhaps its not exactly the same issue as the quoted one...).

@rokm
Copy link
Member

rokm commented Dec 8, 2020

The issue is not specific to exaile, either: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970687

@rokm
Copy link
Member

rokm commented Dec 8, 2020

As a work-around, renaming /usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so to /usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so.bak seems to do the trick for the XFCE session. But I have no idea if it breaks anything else...

@sjohannes
Copy link
Member

#10 envvar_config_extension::get_config (this=<optimized out>, dst=...) at /usr/include/c++/10/bits/stl_vector.h:678

Here is envvar_config_extension::get_config. The file hasn't had significant changes since 2012, so it should be the same code. Unfortunately the crashing line number is optimized away in the stack trace. The frames above that are related to std::vector destruction, but the vector<url> usage in the code looks fine to me, so I don't know where the problem could be.

It may be worth checking if installing/uninstalling the various libproxy* packages makes the issue go away (the one that caught my eye in particular is libproxy1-plugin-gsettings).

@ekatko1 ekatko1 changed the title Segmentation fault when playibng any radio stream Segmentation fault when playing any radio stream Dec 11, 2020
@sjohannes sjohannes added this to the Exaile 4.1.0 milestone Dec 19, 2020
@sjohannes
Copy link
Member

Installing the libproxy1-plugin-* packages doesn't fix this.

I also tried compiling libproxy from source, and it still crashes, but strangely with a different backtrace involving the std::string constructor. I've been poking at this since yesterday and it still doesn't make sense. Maybe the problem is related to libproxy's plugin loader (libmodman)?

I was hoping to at least find a workaround for this before the Exaile 4.1.0 release, but it's not looking promising; we might have to release with this as a known issue.

@luzip665
Copy link
Contributor

luzip665 commented Dec 21, 2022

I have the same problem on Xubuntu 22.10 without libproxy1 installed.
But there is a special point:

If I start exaile from the installed package, playing a radio stream fails with segfault.
If I start exaile from PyCharm, playing a radio stream works.

So I checked with different environment variables set by PyCharm and found out, that playing radio streams works if I export GTK_DEBUG=interactive.

Working is

export GTK_DEBUG=interactive
/usr/bin/python3.10 exaile.py --startgui

But, from here I have no idea what to test further. Can someone help?

I tried different options for GTK_DEBUG, but only interactive seem to work.

@sjohannes
Copy link
Member

@luzip665 Are you able to get a stack trace? If libproxy is not involved then yours may be a different issue.

@luzip665
Copy link
Contributor

luzip665 commented Dec 23, 2022

stack trace is the same as above, I assume. For that I came across here.

INFO    : Playing http://ice6.somafm.com/beatblender-128-aac
Fatal Python error: Segmentation fault

Thread 0x00007fce6320e740 (most recent call first):
  File "/usr/lib/exaile/xl/player/gst/engine.py", line 438 in get_gst_state
  File "/usr/lib/exaile/xl/player/gst/engine.py", line 216 in get_state
  File "/usr/lib/exaile/xl/player/player.py", line 385 in get_state
  File "/usr/lib/exaile/xl/xldbus.py", line 690 in emit_state_changed
  File "/usr/lib/exaile/xl/event.py", line 359 in _emit
  File "/usr/lib/exaile/xl/event.py", line 300 in emit
  File "/usr/lib/exaile/xl/event.py", line 78 in log_event
  File "/usr/lib/exaile/xl/player/player.py", line 446 in engine_notify_track_start
  File "/usr/lib/exaile/xl/player/gst/engine.py", line 338 in _next_track
  File "/usr/lib/exaile/xl/player/gst/engine.py", line 250 in play
  File "/usr/lib/exaile/xl/player/player.py", line 194 in play
  File "/usr/lib/exaile/xl/player/queue.py", line 250 in play
  File "/usr/lib/exaile/xlgui/widgets/playlist.py", line 1070 in _play_track_at
  File "/usr/lib/exaile/xlgui/widgets/playlist.py", line 1313 in on_row_activated
  File "/usr/lib/exaile/xlgui/widgets/playlist.py", line 1407 in do_button_press_event
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1689 in main
  File "/usr/lib/exaile/xl/main.py", line 594 in __init__
  File "/usr/lib/exaile/exaile.py", line 60 in main
  File "/usr/lib/exaile/exaile.py", line 64 in <module>

Extension modules: gi._gi, cairo._cairo, gi._gi_cairo, bsddb3._pybsddb, _dbus_bindings, _dbus_glib_bindings (total: 6)

@sjohannes
Copy link
Member

Oh, I meant the C stack trace using GDB. Quick guide:

$ gdb python
> run exaile.py --startgui
... trigger the segfault
> backtrace

@luzip665
Copy link
Contributor

Result from backtrace

#0  0x00007ffff335d590 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007ffff335d8f1 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007ffff335da07 in __gxx_personality_v0 () at /lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff2fe0fe9 in __libunwind_Unwind_Resume () at /lib/x86_64-linux-gnu/libunwind.so.8
#4  0x00007fffd518f86d in  () at /lib/x86_64-linux-gnu/libproxy.so.1
#5  0x00007fffd5198827 in px_proxy_factory_get_proxies () at /lib/x86_64-linux-gnu/libproxy.so.1
#6  0x00007ffff0006827 in  () at /usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so
#7  0x00007ffff60f2194 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#8  0x00007ffff63756b4 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007ffff6372a51 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff7a6cb43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#11 0x00007ffff7afea00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Ok, libproxy1v5 is installed, but no libproxy1-plugin-* package

@luzip665
Copy link
Contributor

So, it's the same thing as before.
What I wonder is that it's working if I start Exaile with GTK_DEBUG=interactive.

Any idea how to find the difference?

@sjohannes
Copy link
Member

What I wonder is that it's working if I start Exaile with GTK_DEBUG=interactive.

Any idea how to find the difference?

I think it starts with the gtk_window_set_interactive_debugging call: from gtkmain.c, to gtkwindow.c.

Following that further, the part that catches my eye is this "GIO extensions" thing in gtk_inspector_window_init. If the libgiolibproxy module (which is involved in the crash) is considered a GIO extension, then maybe that lookup changes something somewhere.

@luzip665
Copy link
Contributor

It seems to work in Xubuntu 23.04 which uses libproxy1v5 in 0.4.18

@luzip665
Copy link
Contributor

It works also on a fresh Xubuntu 22.04.02 installation and is broken right after installation of gstreamer1.0-plugins-bad.
Finally I pointed out libmodplug1 which comes as dependency of gtreamer1.0-plugins-bad.

After removing libmodplug1 playing streams works again.

@kurt-2 Can you confirm?

@kurt-2
Copy link

kurt-2 commented Apr 26, 2023

yes, it helped.

but removing libmodplug1 also removes
audacious audacious-plugins gstreamer1.0-plugins-bad knowthelist libmodplug1 libsdl2-mixer-2.0-0 trackballs
and probably others (at the moment I can live wihtout them ;-)).

thanks!

@luzip665
Copy link
Contributor

Other changes in ubuntu23.04 are gstreamer (1.22) and XFCE (4.18)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants