Bug 1461595 - Sumwars segfaults with current lua
Sumwars segfaults with current lua
Status: NEW
Product: Fedora
Classification: Fedora
Component: sumwars (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Martin Preisler
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2017-06-14 18:00 EDT by Göran Uddeborg
Modified: 2017-06-14 18:00 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Göran Uddeborg 2017-06-14 18:00:41 EDT
Description of problem:
Sumwars on F26 crashes with a segmentation violation during startup.

Version-Release number of selected component (if applicable):

How reproducible:
Every time

Steps to Reproduce:
1. sumwars

Actual results:
A segmentation violation crash.

Expected results:
The game should start.

Additional info:
I installed the debuginfo packages and took a quick look.  I believe the below code src/code/eventsystem.cpp is guilty.  It initializes m_lua differently depending on the LUA_VERSION_NUM value.  But the lua in F26 sets this value to 503.  None of the cases match, and m_lua remains 0.  The following call of luaL_openlibs can't handle that, it expects it to have a valid value.  Googling a little, it seems the 502 version is to be used in 503 too.  Most likely, changing to "LUA_VERSION_NUM >= 502" is a better fix.

void EventSystem::init()
	if (m_lua !=0)

#if LUA_VERSION_NUM == 501
	m_lua = lua_open();
#elif LUA_VERSION_NUM == 502
    m_lua = luaL_newstate();


Note You need to log in before you can comment on or make changes to this bug.