FS#39676 - [vlc] vlc_cache_gen segfaults

Attached to Project: Arch Linux
Opened by McLenin (McLenin) - Saturday, 29 March 2014, 14:14 GMT
Last edited by Jan de Groot (JGC) - Monday, 08 September 2014, 19:28 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Giovanni Scafora (giovanni)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 18
Private No

Details

Description:

The same buf was reported in https://bbs.archlinux.org/viewtopic.php?pid=1395040

When upgrading I got the error
[ALPM-SCRIPTLET] /tmp/alpm_i6DWYp/.INSTALL: line 1: 8271 Segmentation fault (core dumped) usr/lib/vlc/vlc-cache-gen -f /usr/lib/vlc/plugin

VLC was installed but not working returning the error:
[0x1ccf058] main libvlc warning: cannot read /usr/lib/vlc/plugins/plugins.dat (No such file or directory)

As reported in the forum post, removing /usr/lib/vlc/plugin/codec/libkate_plugin.so and manually running usr/lib/vlc/vlc-cache-gen -f /usr/lib/vlc/plugin fixed the error.

Additional info:
* 2.1.4-2
* config and/or log files etc.


Steps to reproduce:
For me just trying to install the file gave the error and a non working VLC
This task depends upon

Closed by  Jan de Groot (JGC)
Monday, 08 September 2014, 19:28 GMT
Reason for closing:  Fixed
Comment by shawarov (shawarov) - Saturday, 29 March 2014, 14:52 GMT
I got the same error today when I updated vlc
Comment by MzE2OWM2 (warriant) - Sunday, 30 March 2014, 01:16 GMT
Downgrading {vlc,qt4,...} doesn't help, deleting the said plugin doesn't help here either. Both vlc and vlc-cache-gen segfault in the same function, see forum post.

This seems to be a reoccurring pain in the arse with a complicated cause: http://forums.gentoo.org/viewtopic-t-966108.html https://bbs.archlinux.org/viewtopic.php?pid=1269782

There's even more information in here: https://bugs.gentoo.org/show_bug.cgi?id=405173 with a patch at the end that seems to resolve the issue: https://bugzilla.gnome.org/show_bug.cgi?id=707298

I suggest changing the severity to at least medium, as it renders vlc completely unusable.

Workaround to fix installation:
# export LD_PRELOAD=/usr/lib/libgobject-2.0.so.0
# pacman -S vlc

Similar workaround for running vlc:
$ export LD_PRELOAD=/usr/lib/libgobject-2.0.so.0
$ vlc

If you want a permanent solution, here's a patch against the current glib2 in ABS: http://pastebin.com/raw.php?i=V2PRySkY
Comment by KF (kecef) - Monday, 31 March 2014, 19:19 GMT
Same here after update. Vlc is now usless. But for me vlc-cache-gen didn't segfault, just did nothing.
Comment by Eduardo Moreira Barbosa (edu_emb) - Wednesday, 02 April 2014, 17:42 GMT
Include
export LD_PRELOAD=/usr/lib/libgobject-2.0.so.0
on /etc/environment

Logout, and done! VLC is ON.
Comment by Max (silverhammermba) - Tuesday, 08 April 2014, 02:37 GMT
Yep, the LD_PRELOAD in /etc/environment did the trick for me too. No need to reinstall or anything. I still have no idea what the actual problem is.
Comment by MzE2OWM2 (warriant) - Tuesday, 08 April 2014, 10:09 GMT
Remember that your solution is still a (very ugly) workaround. Now every time you execute any application, ld.so loads GObject together with its dependencies and tries to resolve symbols from them first.

The problem should be described in the links I have posted: VLC tries to unload GLib but GLib doesn't support it, eventually leading to a failure such as this one. Patching GLib so that it can't be unloaded resolves the issue.

To make vlc-cache-gen segfault, run it as root, as it is supposed to be run.
Comment by sam (asg1448) - Tuesday, 22 July 2014, 03:37 GMT
I had this problem before and LD_PRELOAD in /etc/environment is not a solution, as it breaks a lot more stuff. This bug indeed has to be escalated
Comment by sam (asg1448) - Tuesday, 22 July 2014, 03:46 GMT
Maybe if LD_PRELOAD is indeed the only way, resolve this issue by temporarily renaming vlc binary to something else and providing a launcher, such as shell script?
Comment by McLenin (McLenin) - Tuesday, 22 July 2014, 06:13 GMT
On July 9th a soltion was posted on the Arch wiki, that I just became aware of yesterday.

sudo LD_PRELOAD=/usr/lib/libgobject-2.0.so.0 pacman -S vlc

On my system this seems to install a perfectly working version of vlc, which doesn't segfaultson install and doesn't require preloads to run. If some other users would be willing to test it out and it is proven to work, such a solution could probably be patched into the package.
Comment by Swift Geek (swiftgeek) - Tuesday, 22 July 2014, 09:00 GMT
@McLenin I can confirm that
Comment by {16/7} (hexadecagram) - Wednesday, 23 July 2014, 01:59 GMT
Also confirmed.
Comment by sam (asg1448) - Wednesday, 23 July 2014, 02:27 GMT
I too confirm this fixed an issue for me
Comment by patrick (potomac) - Thursday, 31 July 2014, 19:54 GMT
I have this bug,

I use the workaround but now vlc has a problem about the resampler audio, it seems that vlc-cache-gen didn't do his job despite the workaround,

see the bug  FS#41414  and this thread :

https://bbs.archlinux.org/viewtopic.php?pid=1442284
Comment by patrick (potomac) - Thursday, 31 July 2014, 20:56 GMT
in fact I found the solution,

my mistake was to split the workaround in 2 lines :

export LD_PRELOAD=/usr/lib/libgobject-2.0.so.0
pacman -S vlc

this method will trigger a bug in vlc-cache-gen, the plugin.dat file will be generated in a wrong way,

the solution is to type in one line without exporting LD_PRELOAD :

LD_PRELOAD=/usr/lib/libgobject-2.0.so.0 pacman -S vlc

another solution :

LD_PRELOAD=/usr/lib/libgobject-2.0.so.0 /usr/lib/vlc/vlc-cache-gen -f /usr/lib/vlc/plugins

now all is ok
Comment by patrick (potomac) - Thursday, 31 July 2014, 21:07 GMT
I notice also that the "vlc-cache-gen" bug occurs only on 64 bits installation, not on i686 architecture,

and deleting manualy the file /usr/lib/vlc/plugins/plugins.dat and then regnerate it with vlc-cache-gen is more secure,

because the problem is that sometimes vlc-cache-gen generates a corrupt or incorrect plugins.dat file, even if we use the LD_PRELOAD workaround, vlc will work ( no segfault ) but some plugins will not be in the cache file ( plugins.dat ),

in my case I had to delete manualy the file /usr/lib/vlc/plugins/plugins.dat and then regenerate a new plugins.dat file,

if I don't delete the plugins.dat file then vlc-cache-gen still generates an incomplete plugins.dat file
Comment by Jan de Groot (JGC) - Friday, 05 September 2014, 08:37 GMT
This should be fixed with glib2 from testing.

Loading...