Bug 215803 - emulators/dolphin-emu doesn't start anymore
Summary: emulators/dolphin-emu doesn't start anymore
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Ganael LAPLANCHE
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-05 18:31 UTC by Christian Zigotzky
Modified: 2017-01-16 21:19 UTC (History)
0 users

See Also:


Attachments
Test patch (522 bytes, patch)
2017-01-12 21:47 UTC, Ganael LAPLANCHE
no flags Details | Diff
2nd test patch (thr only) (522 bytes, patch)
2017-01-14 21:56 UTC, Ganael LAPLANCHE
no flags Details | Diff
3rd test patch (link order only) (518 bytes, patch)
2017-01-15 09:58 UTC, Ganael LAPLANCHE
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Zigotzky 2017-01-05 18:31:47 UTC

    
Comment 1 Christian Zigotzky 2017-01-05 18:37:13 UTC
Hi All,

I installed the latest Dolphin-emu version 5.0.3 via pkg upgrade today. Unfortunately Dolpin doesn't start. (core dump)
Dolphin 5.0.r_2 works without any problems.

Cheers,

Christian
Comment 2 Ganael LAPLANCHE freebsd_committer freebsd_triage 2017-01-07 15:52:43 UTC
Hi,

Have you tried starting off a new configuration ? Try to move (or remove) ~/.config/dolphin-emu and start dolphin again.

If it still dumps core, can you post a backtrace or a log message ?

Best regards,

Ganael.
Comment 3 Christian Zigotzky 2017-01-07 18:17:30 UTC
Hi Ganael,

Many thanks for your fast reply! :-)

The config directory of Dolphin is in the home directory directly.

I renamed it but unfortunately it doesn't work either.

gdb /usr/local/bin/dolphin-emu

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)...

(gdb) run
Starting program: /usr/local/bin/dolphin-emu 
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...[New LWP 100487]
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...warning: Lowest section in /usr/local/lib/libicudata.so.58 is .hash at 0000000000000120
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 100487]
0x0000000800a6b2a2 in _rtld_is_dlopened () from /libexec/ld-elf.so.1

Cheers,
Christian
Comment 4 Ganael LAPLANCHE freebsd_committer freebsd_triage 2017-01-07 22:46:47 UTC
Hmmm, nothing very useful here. It seems to have crashed while loading a shared library.

I cannot reproduce the problem on my machine (FreeBSD 11.0-RELEASE-p2, amd64) with Dolphin installed from packages. On what FreeBSD version / arch are you trying to run it ? Also, are all packages' dependencies up to date ?

Can you try to rebuild Dolphin from ports to see if it still crashes ?

You can enable debug symbols to produce a (hopefully) more detailed backtrace :

# cd /usr/ports/emulators/dolphin-emu
# make WITH_DEBUG=yes install

Best regards,
Ganael.
Comment 5 Christian Zigotzky 2017-01-08 20:52:36 UTC
I run it on FreeBSD 10.3-RELEASE amd64. Yes, all packages' dependencies are up to date.

I compiled it with debug symbols today.

run

Starting program: /usr/local/bin/dolphin-emu 
[New LWP 100234]
warning: Lowest section in /usr/local/lib/libicudata.so.58 is .hash at 0000000000000120

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 100234]
0x000000080102b2a2 in _rtld_is_dlopened () from /libexec/ld-elf.so.1

bt

#0  0x000000080102b2a2 in _rtld_is_dlopened () from /libexec/ld-elf.so.1
#1  0x0000000801024c8d in _r_debug_postinit () from /libexec/ld-elf.so.1
#2  0x000000080102246d in .text () from /libexec/ld-elf.so.1
#3  0x0000000818e60715 in _nv003glcore () from /usr/local/lib/libnvidia-glcore.so.1
#4  0x0000000818ab3830 in _nv023glcore () from /usr/local/lib/libnvidia-glcore.so.1
#5  0x0000000818e441ec in _nv015glcore () from /usr/local/lib/libnvidia-glcore.so.1
#6  0x000000080afa2aab in glXCreateNewContext () from /usr/local/lib/libGL.so.1
#7  0x000000080af695ca in .init () from /usr/local/lib/libGL.so.1
#8  0x0000000801024a9f in r_debug_state () from /libexec/ld-elf.so.1
#9  0x00000008010240ee in __tls_get_addr () from /libexec/ld-elf.so.1
#10 0x0000000801022439 in .text () from /libexec/ld-elf.so.1
#11 0x0000000000000000 in ?? ()
Comment 6 Ganael LAPLANCHE freebsd_committer freebsd_triage 2017-01-09 20:00:41 UTC
It does not seem to be related to Dolphin itself, but to OpenGL and more precisely to the (proprietary) nvidia driver.

I have found the same kind of backtrace here :

http://pastebin.com/6VA42etE

Can you run glxinfo without any problem ?

I imagine you can run Dolphin-emu with :

$ env LIBGL_ALWAYS_SOFTWARE=yes dolphin-emu

Have you tried contacting Nvidia ? Another option would be to ask on Dolphin forums, maybe they are aware of instabilities/bugs related to that driver.

Hope this helps...

Best regards,

Ganael.
Comment 7 Christian Zigotzky 2017-01-10 18:00:11 UTC
Yes, glxinfo works without any problems.

glxinfo | grep -i opengl

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 680/PCIe/SSE2
OpenGL core profile version string: 4.5.0 NVIDIA 367.44
OpenGL core profile shading language version string: 4.50 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5.0 NVIDIA 367.44
OpenGL shading language version string: 4.50 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 367.44
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Unfortunately 'env LIBGL_ALWAYS_SOFTWARE=yes dolphin-emu' doesn't work either. (core dumped)
Comment 8 Ganael LAPLANCHE freebsd_committer freebsd_triage 2017-01-10 22:17:10 UTC
Digging into that problem a bit further reveals other seemingly-related PRs :

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205149
(and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206899)
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=186565

and also that discussion :

https://lists.freebsd.org/pipermail/freebsd-threads/2015-December/005807.html

In short, Nvidia driver seems to have a problem when the main application linking to LibGL also links to another library that links to libthr. One fix seems to be to link the main application to libthr too. I'll prepare a patch for you ASAP to test that fix.

Best regards,

Ganael.
Comment 9 Ganael LAPLANCHE freebsd_committer freebsd_triage 2017-01-12 21:47:09 UTC
Created attachment 178842 [details]
Test patch

Hi,

Can you try the attached patch ? Just copy it to the files/ folder of the port and rebuild dolphin-emu.

It implements both fixes suggested in PR #205149 :

- It links to OpenGL libs earlier 
- It explicitly links the main application to libthr

I don't know if that will fix you crash. It is quite difficult to debug the problem because I cannot reproduce it myself (I don't have a Nvidia card).

If that does not work, have you checked if that problem occurs with the nv driver ? Also, as a last resort, have you tried to raise the problem on freebsd-x11 or freebsd-threads lists ?
Comment 10 Christian Zigotzky 2017-01-13 20:26:18 UTC
Dolphin works with your patch! :-)

I tested it with a Wii game and a GameCube game today.

Fantastic! Well done!

Thank you very much!
Comment 11 Ganael LAPLANCHE freebsd_committer freebsd_triage 2017-01-14 21:56:45 UTC
Created attachment 178893 [details]
2nd test patch (thr only)

Good news, thanks for your feedback.

The previous patch implements both suggestions from PR #205149 :

- linking to OpenGL libs earlier 
- linking the main application to libthr

but linking to libthr should be enough.

May I ask you to test another (simpler) patch ? Could you replace the previous patch in the files/ directory of the port by the new attached patch, rebuild and reinstall Dolphin and tell me if it is enough to fix the problem ?

Best regards,
Ganael.
Comment 12 Christian Zigotzky 2017-01-15 00:10:00 UTC
I compiled Dolphin with your 2nd patch today. Unfortunately Dolphin doesn't start. (core dump)
Comment 13 Ganael LAPLANCHE freebsd_committer freebsd_triage 2017-01-15 09:58:18 UTC
Created attachment 178903 [details]
3rd test patch (link order only)

Good, so I presume only the link order is relevant here. Can you confirm this and test that (last) patch ?

Thanks a lot :)
Comment 14 Christian Zigotzky 2017-01-15 21:17:55 UTC
Dolphin works with your 3rd test patch. :-)

Many thanks for your work!
Comment 15 commit-hook freebsd_committer freebsd_triage 2017-01-16 21:11:58 UTC
A commit references this bug:

Author: martymac
Date: Mon Jan 16 21:11:09 UTC 2017
New revision: 431702
URL: https://svnweb.freebsd.org/changeset/ports/431702

Log:
  Link to OpenGL libraries earlier to avoid crash with Nvidia's libGL

  PR:		215803
  Submitted by:	Christian Zigotzky <chzigotzky@xenosoft.de>

Changes:
  head/emulators/dolphin-emu/Makefile
  head/emulators/dolphin-emu/files/patch-Source-Core-Common-CMakeLists.txt
Comment 16 Ganael LAPLANCHE freebsd_committer freebsd_triage 2017-01-16 21:19:17 UTC
Fixed, thanks  Christian!