Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 729002 - games-roguelike/dwarf-fortress-0.47.04 segfaults at startup
Summary: games-roguelike/dwarf-fortress-0.47.04 segfaults at startup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-06-21 13:10 UTC by Guillaume BRUN
Modified: 2022-07-06 08:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emergeinfo,16.95 KB, text/plain)
2020-06-21 13:32 UTC, Guillaume BRUN
Details
Fix for df-0.44.12 segfault in alGetError() (df_openal.patch,767 bytes, patch)
2022-05-01 13:05 UTC, Martin Doucha
Details | Diff
Fix for df-0.44.12 segfault in alGetError() (df_openal.patch,1.29 KB, patch)
2022-05-01 13:23 UTC, Martin Doucha
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume BRUN 2020-06-21 13:10:13 UTC
FWIW, this is merely a copy of the ebuild currently in Portage, with modified version number, so I expect the Portage version to also be affected.

Everything in the title. This is what I get by default:

cheaterman@cmans-laptop /tmp/df_linux $ dwarf-fortress                                                                                                                                                              
Sound devices available:
OpenAL Soft
Picking OpenAL Soft. If your desired device was missing, make sure you have the appropriate 32-bit libraries installed. If you wanted a different device, configure ~/.openalrc appropriately.
Perfect OpenAL context attributes GET
Loading bindings from data/init/interface.txt
Segmentation fault (core dumped)

I should instead have:

cheaterman@cmans-laptop /tmp/df_linux $ dwarf-fortress                                                                                                                                                              
Sound devices available:
OpenAL Soft
Picking OpenAL Soft. If your desired device was missing, make sure you have the appropriate 32-bit libraries installed. If you wanted a different device, configure ~/.openalrc appropriately.
Perfect OpenAL context attributes GET
Loading bindings from data/init/interface.txt
New window size: 640x300
Font size: 8x12
Resizing grid to 80x25
Resizing font to 8x12
Resetting textures

(and more)

Is it an upstream issue? But also, it seems to work for other people, so possibly related to GCC version? I'm using 8.3.0-r3 here although I also have 9.2.0-r2 installed. Seeing as this looks like some sort of implicit return statement, I'd expect the compiler to be involved?

The way I fixed it is as follows: 

In the file g_src/music_and_sound_openal.cpp L493, you'll notice a line like this:

ALenum alGetError( void ) { _alGetError(); }

Pretty weird, since the _alGetError() result should be returned. Fix it as follows:

ALenum alGetError( void ) { return _alGetError(); }

And that's it. It works.

I mean, I still can't close the game (goes into some sort of infinite loop trying to set up a new window? makes Xorg process take half of the CPU, DF taking the other half) ; but at least I can start it.

Thanks in advance for your support! We could possibly bundle a patch to fix this, or ask upstream to see what they can do.
Comment 1 Guillaume BRUN 2020-06-21 13:12:42 UTC
_VERY_ likely to be related: https://bugs.gentoo.org/703384
Comment 2 Guillaume BRUN 2020-06-21 13:32:53 UTC
Created attachment 645516 [details]
emerge --info
Comment 3 Rick Foland 2020-06-25 22:44:37 UTC
Is this version dependent for you? Did you also have it on 44.12? I also am running 47.04 from a modified version of the current e-build and I am not running into the issue. I'm just curios if it started for you with this version.
Comment 4 Martin Doucha 2022-05-01 13:05:49 UTC
Created attachment 775769 [details, diff]
Fix for df-0.44.12 segfault in alGetError()

I can confirm that this patch fixes the OpenAL segfault for me. I also have the problem with DF getting stuck in a loop when I try to quit it.
Comment 5 Martin Doucha 2022-05-01 13:23:29 UTC
Created attachment 775775 [details, diff]
Fix for df-0.44.12 segfault in alGetError()

And since alIsEnabled() has the same problem, let's throw it in the patch as well.
Comment 6 Larry the Git Cow gentoo-dev 2022-07-06 08:39:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97a24df3591ca7bebd0fcd189e1da5f16240715c

commit 97a24df3591ca7bebd0fcd189e1da5f16240715c
Author:     Joshua Goins <josh@redstrate.com>
AuthorDate: 2022-06-28 23:57:28 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2022-07-06 08:37:53 +0000

    games-roguelike/dwarf-fortress: add 0.47.05
    
    Signed-off-by: Joshua Goins <josh@redstrate.com>
    Co-authored-by: Sven Eusewig <sveneusewig@yahoo.de>
    Co-authored-by: Wolfgang E. Sanyer <ezzieyguywuf@gmail.com>
    Closes: https://bugs.gentoo.org/703384
    Closes: https://bugs.gentoo.org/703386
    Closes: https://bugs.gentoo.org/717752
    Closes: https://bugs.gentoo.org/729002
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 games-roguelike/dwarf-fortress/Manifest            |  2 +
 .../dwarf-fortress/dwarf-fortress-0.47.05.ebuild   | 97 ++++++++++++++++++++++
 .../files/dwarf-fortress-0.47.05-fix-cmath.patch   | 11 +++
 ...warf-fortress-0.47.05-segfault-fix-729002.patch | 49 +++++++++++
 4 files changed, 159 insertions(+)