Bug 1045632 - [abrt] celestia: luaD_throw(): celestia killed by SIGABRT
Summary: [abrt] celestia: luaD_throw(): celestia killed by SIGABRT
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: celestia
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Steven Pritchard
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:c0eef30cabaeaab512a4da48b41...
: 1047403 1063063 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-20 21:44 UTC by Couret Charles-Antoine
Modified: 2015-01-03 12:54 UTC (History)
21 users (show)

Fixed In Version: celestia-1.6.1-15.fc20
Clone Of:
Environment:
Last Closed: 2014-07-03 18:29:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (15.64 KB, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
File: cgroup (172 bytes, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
File: core_backtrace (4.43 KB, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
File: dso_list (11.64 KB, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
File: environ (1.37 KB, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
File: limits (1.29 KB, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
File: maps (61.19 KB, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
File: open_fds (455 bytes, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
File: proc_pid_status (927 bytes, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
File: var_log_messages (857 bytes, text/plain)
2013-12-20 21:44 UTC, Couret Charles-Antoine
no flags Details
Reimplement openLuaLibrary for Lua 5.2. (455 bytes, patch)
2014-02-09 23:31 UTC, Chris Rankin
no flags Details | Diff

Description Couret Charles-Antoine 2013-12-20 21:44:06 UTC
Description of problem:
Launch Celestia, we can see the splashscreen and after some seconds… crash

Version-Release number of selected component:
celestia-1.6.1-14.fc20

Additional info:
reporter:       libreport-2.1.10
backtrace_rating: 4
cmdline:        celestia
crash_function: luaD_throw
executable:     /usr/bin/celestia
kernel:         3.12.5-301.fc20.x86_64
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (10 frames)
 #2 luaD_throw at ldo.c:119
 #3 luaG_errormsg at ldebug.c:569
 #4 luaG_runerror at ldebug.c:578
 #5 luaG_typeerror at ldebug.c:515
 #6 luaV_settable at lvm.c:163
 #7 lua_setfield at lapi.c:764
 #8 LuaState::allowLuaPackageAccess at celx.cpp:4122
 #9 LuaState::init at celx.cpp:3540
 #10 CelestiaCore::initLuaHook at celestiacore.cpp:5013
 #11 CelestiaCore::initSimulation at celestiacore.cpp:4153

Comment 1 Couret Charles-Antoine 2013-12-20 21:44:12 UTC
Created attachment 839820 [details]
File: backtrace

Comment 2 Couret Charles-Antoine 2013-12-20 21:44:14 UTC
Created attachment 839821 [details]
File: cgroup

Comment 3 Couret Charles-Antoine 2013-12-20 21:44:18 UTC
Created attachment 839822 [details]
File: core_backtrace

Comment 4 Couret Charles-Antoine 2013-12-20 21:44:21 UTC
Created attachment 839823 [details]
File: dso_list

Comment 5 Couret Charles-Antoine 2013-12-20 21:44:23 UTC
Created attachment 839824 [details]
File: environ

Comment 6 Couret Charles-Antoine 2013-12-20 21:44:25 UTC
Created attachment 839825 [details]
File: limits

Comment 7 Couret Charles-Antoine 2013-12-20 21:44:29 UTC
Created attachment 839826 [details]
File: maps

Comment 8 Couret Charles-Antoine 2013-12-20 21:44:31 UTC
Created attachment 839827 [details]
File: open_fds

Comment 9 Couret Charles-Antoine 2013-12-20 21:44:33 UTC
Created attachment 839828 [details]
File: proc_pid_status

Comment 10 Couret Charles-Antoine 2013-12-20 21:44:35 UTC
Created attachment 839829 [details]
File: var_log_messages

Comment 11 Chris Rankin 2013-12-31 16:18:58 UTC
*** Bug 1047403 has been marked as a duplicate of this bug. ***

Comment 12 mastaiza 2014-01-09 23:56:33 UTC
Another user experienced a similar problem:

When you start the application falls

reporter:       libreport-2.1.10
backtrace_rating: 4
cmdline:        celestia
crash_function: luaD_throw
executable:     /usr/bin/celestia
kernel:         3.12.5-302.fc20.x86_64
package:        celestia-1.6.1-14.fc20
reason:         celestia killed by SIGABRT
runlevel:       N 5
type:           CCpp
uid:            1000

Comment 13 Chris Rankin 2014-02-09 18:26:48 UTC
It seems that there is a problem porting Celestia from Lua 5.1 to Lua 5.2:

http://216.231.48.101/forum/viewtopic.php?f=4&t=17371

Comment 14 Chris Rankin 2014-02-09 22:19:53 UTC
OK, I'm a complete Lua n00b, but I've dived into the code and have discovered that Celestia is breaking in two places:

In celestia-1.6.1/src/celestia/celx.cpp:

void LuaState::allowLuaPackageAccess()

and:

void LuaState::setLuaPath(const string& s)

However, it appears to be breaking for the same reason:

#if LUA_VER >= 0x050100
    lua_getglobal(state, "package");
    lua_pushstring(state, s.c_str());
    lua_setfield(state, -2, "path");
    lua_pop(state, 1);
#else

As I understand it, this code is trying to do the following:

"package"["path"] = s

Unfortunately, whatever "package" is supposed to be, Lua is pushing "null" onto the stack instead. I have hacked this code thus:

    lua_getglobal(state, "package");
    if (lua_istable(state, -1)) {
        lua_pushstring(state, s.c_str());
        lua_setfield(state, -2, "path");
    }
    lua_pop(state, 1);

and similarly for allowLuaPackageAccess(). This allows Celestia to start up, but doesn't qualify as a "fix" because it misses the point of what "package" is supposed to be.

Comment 15 Chris Rankin 2014-02-09 23:21:35 UTC
I think the problem is that openLuaLibrary() in celx.cpp is implemented incorrectly for Lua 5.2. The key is to use the luaL_requiref() function, which can be instructed to load the missing global table:

#if LUA_VER >= 0x050100
// Load a Lua library--in Lua 5.1, the luaopen_* functions cannot be called
// directly. They most be invoked through the Lua state.
static void openLuaLibrary(lua_State* l,
                           const char* name,
                           lua_CFunction func)
{
#if LUA_VER >= 0x050200
    luaL_requiref(l, name, func, 1);
#else
    lua_pushcfunction(l, func);
    lua_pushstring(l, name);
    lua_call(l, 1, 0);
#endif
}
#endif

Comment 16 Chris Rankin 2014-02-09 23:31:55 UTC
Created attachment 861181 [details]
Reimplement openLuaLibrary for Lua 5.2.

Comment 17 Chris Rankin 2014-02-10 00:17:25 UTC
Of course, now that I can actually run Celestia, I am able to notice that Fedora's "cleaning pixies" have been at it again. In fact, they've done such a good job that Jupiter is now white!

Comment 18 denis.belanger50 2014-04-18 06:21:29 UTC
Another user experienced a similar problem:

Started the app from the menu MATE desktop

reporter:       libreport-2.2.1
backtrace_rating: 4
cmdline:        celestia
crash_function: luaD_throw
executable:     /usr/bin/celestia
kernel:         3.13.9-200.fc20.i686+PAE
package:        celestia-1.6.1-14.fc20
reason:         celestia killed by SIGABRT
runlevel:       N 5
type:           CCpp
uid:            1000

Comment 19 Chris Rankin 2014-04-18 10:36:22 UTC
(In reply to denis.belanger50 from comment #18)
> Another user experienced a similar problem:
> 
> Started the app from the menu MATE desktop

You can fix this yourself by rebuilding the RPM with the patch I attached to this bug back in February. (For bonus points, you can replace the source tarball with the "pristine" source from SourceForge as well).

Basically: the fix is known, but I don't recommend waiting for Fedora to pick it up.

Comment 20 Daniel 2014-04-19 09:48:41 UTC
I confirm Chris' patch and "bonus" replacement from original source 
allowed me to recompile the rpm (fc20 X86_64).  
Now celestia starts correctly and displays reasonable pictures of planets like Jupiter.  

Chris patch celestia-lua-52-fix.patch has to be put in the /root/rpmbuild/SOURCES directory as well 
as the original celestia-1.6.1.tar.gz from sourceforge.  
Then the file /root/rpmbuild/SPECS/celestia.spec has to be modified 
(see lines begining with Source0, Patch4 and patch4):
------------------------------------------------------------------------------------------------
...
License:        GPLv2+
Source0:        http://downloads.sourceforge.net/celestia/celestia-%%{version}.tar.gz
Source3:        celestia.desktop
URL:            http://www.shatters.net/celestia/
Patch0:         celestia-1.6.1-gcc47.patch
Patch1:         celestia-1.6.1-zlib.patch
Patch2:         celestia-1.6.1-lua-5.2.patch
Patch3:         celestia-1.6.1-gcc48.patch
Patch4:         celestia-lua-52-fix.patch
BuildRequires:  zlib-devel
...
...
%prep
%setup -q
%patch0 -p1 -b .gcc47
%patch1 -p1 -b .zlib
%patch2 -p1 -b .lua-52
%patch3 -p1
%patch4 -p1 

# Make sure we compile with the right CFLAGS/CXXFLAGS (from Hans de Goede).
...
----------------------------------------------------------------------------------------

Then recompile with 
# rpmbuild -bb /root/rpmbuild/SPECS/celestia.spec

If needed yum install the packages necessary for compiling. 

Delete the old celestia if already installed:
# rpm -e celestia

Install the new celestia:

# rpm -Uvh /root/rpmbuild/RPMS/x86_64/celestia-1.6.1-14.fc20.x86_64.rpm

Comment 21 thebudjr 2014-07-02 17:01:50 UTC
Another user experienced a similar problem:

used command 'sudo yum install celestia' to install celestia
opened menu, selected celestia, error popped up and celestia did not open

reporter:       libreport-2.2.2
backtrace_rating: 4
cmdline:        celestia
crash_function: luaD_throw
executable:     /usr/bin/celestia
kernel:         3.14.9-200.fc20.x86_64
package:        celestia-1.6.1-14.fc20
reason:         celestia killed by SIGABRT
runlevel:       N 5
type:           CCpp
uid:            1000

Comment 22 Fedora Update System 2014-07-03 18:27:45 UTC
celestia-1.6.1-15.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/celestia-1.6.1-15.fc20

Comment 23 François Cami 2014-08-21 13:44:20 UTC
*** Bug 1063063 has been marked as a duplicate of this bug. ***

Comment 24 Fedora Update System 2014-08-23 01:56:59 UTC
celestia-1.6.1-15.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Daniel 2014-08-23 07:58:09 UTC
Many images from the original sources are still removed, which is a bug IMHO because NASA data is public domain (see the exact terms at http://www.jpl.nasa.gov/imagepolicy/).  The removed images are very important for anybody interested in using this program.   

To restore them (for fedora 20 x86_64) I had to fetch the source code (https://kojipkgs.fedoraproject.org//packages/celestia/1.6.1/15.fc20/src/celestia-1.6.1-15.fc20.src.rpm) 
and install it as root:
# rpm -ivh celestia-1.6.1-15.fc20.src.rpm
The new source link in 
/root/rpmbuild/SPECS/celestia.spec 
has been updated:

Source0: http://sourceforge.net/projects/celestia/files/Celestia-source/%%{version}/celestia-%%{version}.tar.gz

and as root 

cd /rooot/rpmbuild/SOURCES
wget http://sourceforge.net/projects/celestia/files/Celestia-source/1.6.1/celestia-1.6.1.tar.gz
rpmbuild -bb /root/rpmbuild/SPECS/celestia.spec

Then I installed the complete celestia with 

rpm -ivh /root/rpmbuild/RPMS/x86_64/celestia-1.6.1-15.fc20.x86_64.rpm

Comment 26 Ken Sinner 2015-01-02 19:50:44 UTC
celestia 1.6.1 15 fc20 now dies with SIGTRAP.

Comment 27 Chris Rankin 2015-01-03 12:54:37 UTC
(In reply to Ken Sinner from comment #26)
> celestia 1.6.1 15 fc20 now dies with SIGTRAP.

Please open a new bug for your issue. The issue described by bug #1045632 has been fixed.


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