Segfault under Linux Mint 18 with ui threads
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
My custom compiled Vice segfaults after switching to Linux Mint 18 (previously used 17). I svn up'd to the latest (as of a few days ago - r31690), configured and compiled from scratch, and still have the same segfault.
Here's uname -a:
Linux mephistopheles 4.4.0-34-generic #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Here's the configure command I used:
./configure --enable-arch=native --with-resid --with-x --enable-gnomeui --with-uithreads --enable-ethernet --with-pulse --enable-fullscreen --enable-memmap --enable-vte --enable-static-ffmpeg --prefix=$HOME/apps/vice
If I configure without --with-uithreads it seems to work fine. Otherwise, here's what I get when trying to run:
> src/x64sc Detecting ISA HardSID boards. Could not open '/dev/port'. Cannot get permission to access $300. Detecting PCI HardSID boards. No PCI HardSID boards found. ui-threads: failed to set realtime priority for VICE - this is no problem! refer to Readme-Unix.txt (http://vice-emu.svn.sourceforge.net/viewvc/vice-emu/trunk/vice/doc/readmes/Readme-Unix.txt) Segmentation fault
Turns out it's not just x64sc, I get the same thing with x64, x128, etc.
Here's what I get running gdb on it:
> gdb src/x64sc GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from src/x64sc...done. (gdb) run Starting program: /home/stephenk/src/vice-emu-code.kruthers/vice/src/x64sc [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Detecting ISA HardSID boards. Could not open '/dev/port'. Cannot get permission to access $300. Detecting PCI HardSID boards. No PCI HardSID boards found. [New Thread 0x7fffebd29700 (LWP 6291)] [New Thread 0x7fffeb528700 (LWP 6292)] ui-threads: failed to set realtime priority for VICE - this is no problem! refer to Readme-Unix.txt (http://vice-emu.svn.sourceforge.net/viewvc/vice-emu/trunk/vice/doc/readmes/Readme-Unix.txt) Thread 2 "x64sc" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffebd29700 (LWP 6291)] 0x00007ffff59e2c24 in glClear () from /usr/lib/nvidia-367/libGL.so.1 (gdb)
FYI, I initially had the recommended nvidia driver (I think 361) installed but upgraded to 367. Made no difference to these segfaults.
Thanks for the detailed bug report. So far I have been unable to reproduce this bug. I installed Linux Mint 18 on an old dual core AMD laptop with Radeon HD4570 and everything seems to run fine. (using open source driver).
Could be an nVidia driver problem. I have an old box with a Geforce 7300SE card but that supports only the legacy driver, if it works at all, so I'm not sure I can test on that. But I'll try.
Linux Mint has always been a bit buggy for me. I sometimes get random WM lockups using the Gtk3 port when moving through the menu, no such bugs using Ubuntu, Debian,etc. This was using the Cinnamon desktop, which seems to have a few problems, also with other programs, not just Vice.
uithreads are a work in progress, so you don't really win much by enabling those. But I'll try to look into it.
Ok, thanks for checking it out. Should have mentioned though that I'm using the Mate edition of Mint, and my nvidia card is a pretty old GeForce GTS 450. But those shouldn't matter too much since they were the same when it was working. Most likely a driver or library change that broke things. I'll try a few more nvidia drivers.
But if there's any other debugging help or info I can provide I'll gladly help out. Really miss the alpha blending feature from ui threads!
Mate is Gtk2, which makes sense since uithreads is disabled on Gtk3 or xaw. I'll try to install a Mate version of Mint 18 on my nVidia box.
You could help by passing --enable-debug and --enable -debug-code to configure and running x64(sc) through valgrind like so:
valgrind --leak-check=full --show-leak-kinds=all src/x64 2>&1 > ~/vg.log
This will severly slow down VICE and spit out a lot of errors in libraries used by VICE, but it may help with identifying the segfault.
The output of that is huge, so perhaps paste it on pastebin, and post the link here.
That's all I can do now.
Ok did that but heh, the output was too big even to pastebin it. Attempting to include it gzipped w/ this post, hope it works.
Thanks for the log. Seems to me like a driver problem.
I installed Mint 18 (Cinnamon) on an old Core 2 Duo box with an nVidia 7300SE card. First I compiled and ran VICE on the open source nouveau driver. Both x64 and x64sc ran fine, watched Fantasmolytic till the end twice.
Then I enabled the binary driver (304.131, I can't test the 'current' nvidia because my card is ancient). Ran x64 and x64sc again, which also ran fine.
Then I tried running xplus4, which segfaulted immediately. Running xplus4 through gdb or valgrind made xplus4 actually run, but with warnings about uninitialized values in nvidia's gl library. Running xplus4 straight from console would always result in a segfault.
After disabling nvidia and enabled nouveau again, xplus4 runs fine. So it would seem uithreads don't work nicely with the binary nvidia driver. So until nvidia comes up with some update which may or may not fix the bug, either forget about uithreads for now or remove the nivida driver.
Sorry I can't be of more help.
Thank you! Appreciate the effort.
I still haven't gone through and tried all the nvidia drivers since it takes a while. But if I find one that seems to work I'll update here in case it helps someone.
That would be helpful. Thank you.
Well you were right, it's definitely related to the nvidia driver, though it's only later ones. I ran through all the drivers currently on my system and here's what I came up with:
works:
- nvidia-304 (304.131-0ubuntu3)
- nvidia-304-updates (304.131-0ubuntu3)
- nvidia-340 (340.96-0ubuntu3+gpu16.04.1)
- nvidia-358 (358.16-0ubuntu0~gpu16.04.5)
- xserver-xorg-video-nouveau (1:1.0.12-1build2)
segfaults:
- nvidia-361 (361.45.18-0ubuntu0~gpu16.04.1)
- nvidia-364 (364.19-0ubuntu0~gpu16.04.6)
- nvidia-367 (367.44-0ubuntu0~gpu16.04.1)
- nvidia-370 (370.28-0ubuntu0~gpu16.04.1)
Was bad luck that I had only tried drivers 361 and higher originally and scratched the driver off my list of suspects.
Thanks for testing a few more drivers, that helps. I'll close this bug now since it's we can't fix nvidia's bugs.