View Issue Details

IDProjectCategoryView StatusLast Update
0004360DarkRadiantGeneralpublic10.08.2017 18:34
Reportercoldtobi Assigned Togreebo  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Platformamd64OSLinuxOS VersionDebian sid
Fixed in Version2.2.0 
Summary0004360: crash in boost::phyton
DescriptionWhen packaging the new darkradiant version for Debian, I run appearantly into this issue: http://forums.thedarkmod.com/topic/17495-darkradiant-crashes-at-startup/

(The crash does also happen with the older version currently in Jessie, but I verified that the latest release also show this issue)

When disabling the python support, the crash goes away.
Steps To Reproduce(In e.g. a Debian chroot / vm, to compile the Debian package do:)

sudo apt-get build-dep darkradiant
sudo apt-get install build-essential git
git clone https://anonscm.debian.org/git/pkg-games/darkradiant.git
cd darkradiant
git checkout ce6f4d518c9492933fe2b24e6a1dc86091539cdb
dpkg-buildpackage -uc -b

(waiting until compilation complete)

./radiant/.libs/darkradiant
(...)
Segmentation fault
Additional Informationbacktrace (using gdb)
tobi@edoras:~/tmp/darkradiant/darkradiant$ gdb ./radiant/.libs/darkradiant
GNU gdb (Debian 7.11.1-2) 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 ./radiant/.libs/darkradiant...done.
(gdb) r
Starting program: /home/tobi/tmp/darkradiant/darkradiant/radiant/.libs/darkradiant
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
20:50:35: Warning: Mismatch between the program and library build versions detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1009,wx containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1010,wx containers,compatible with 2.8).


(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

(darkradiant:1984): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff74a71fd in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*) () from /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.61.0
(gdb) bt
#0 0x00007ffff74a71fd in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*) () from /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.61.0
0000001 0x00007fffdf69399d in Doom3FileSystem::initDirectory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/x86_64-linux-gnu/darkradiant/modules/vfspk3.so
0000002 0x00007fffdf695966 in Doom3FileSystem::initialise() ()
   from /usr/lib/x86_64-linux-gnu/darkradiant/modules/vfspk3.so
0000003 0x00007fffdf68e5ee in Doom3FileSystem::initialiseModule(ApplicationContext const&) ()
   from /usr/lib/x86_64-linux-gnu/darkradiant/modules/vfspk3.so
0000004 0x00000000006c9a17 in module::ModuleRegistry::initialiseModuleRecursive (
    this=this@entry=0xb13c60 <module::ModuleRegistry::Instance()::_registry>, name="VirtualFileSystem")
    at modulesystem/ModuleRegistry.cpp:136
0000005 0x00000000006c9365 in module::ModuleRegistry::initialiseModuleRecursive (
    this=this@entry=0xb13c60 <module::ModuleRegistry::Instance()::_registry>, name="MaterialManager")
    at modulesystem/ModuleRegistry.cpp:125
0000006 0x00000000006c9365 in module::ModuleRegistry::initialiseModuleRecursive (
    this=this@entry=0xb13c60 <module::ModuleRegistry::Instance()::_registry>, name="ShaderCache")
    at modulesystem/ModuleRegistry.cpp:125
0000007 0x00000000006c9365 in module::ModuleRegistry::initialiseModuleRecursive (
    this=this@entry=0xb13c60 <module::ModuleRegistry::Instance()::_registry>, name="OrthoviewManager")
    at modulesystem/ModuleRegistry.cpp:125
#8 0x00000000006c9365 in module::ModuleRegistry::initialiseModuleRecursive (
    this=this@entry=0xb13c60 <module::ModuleRegistry::Instance()::_registry>, name="MainFrame")
    at modulesystem/ModuleRegistry.cpp:125
0000009 0x00000000006c9365 in module::ModuleRegistry::initialiseModuleRecursive (
    this=this@entry=0xb13c60 <module::ModuleRegistry::Instance()::_registry>, name="Clipper")
    at modulesystem/ModuleRegistry.cpp:125
0000010 0x00000000006c9365 in module::ModuleRegistry::initialiseModuleRecursive (
    this=this@entry=0xb13c60 <module::ModuleRegistry::Instance()::_registry>, name="Radiant")
    at modulesystem/ModuleRegistry.cpp:125
0000011 0x00000000006c9365 in module::ModuleRegistry::initialiseModuleRecursive (
    this=this@entry=0xb13c60 <module::ModuleRegistry::Instance()::_registry>, name="MouseToolManager")
    at modulesystem/ModuleRegistry.cpp:125
0000012 0x00000000006c9365 in module::ModuleRegistry::initialiseModuleRecursive (
    this=this@entry=0xb13c60 <module::ModuleRegistry::Instance()::_registry>, name="Camera")
    at modulesystem/ModuleRegistry.cpp:125
0000013 0x00000000006ca590 in module::ModuleRegistry::initialiseModules (
    this=0xb13c60 <module::ModuleRegistry::Instance()::_registry>) at modulesystem/ModuleRegistry.cpp:155
0000014 0x0000000000466c14 in RadiantApp::onStartupEvent (this=<optimized out>, ev=...) at main.cpp:141
0000015 0x00007ffff573d59e in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000016 0x00007ffff58c3a87 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000017 0x00007ffff58c3e6e in wxEvtHandler::SearchDynamicEventTable(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000018 0x00007ffff58c3eff in wxEvtHandler::TryHereOnly(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000019 0x00007ffff58c3fb3 in wxEvtHandler::ProcessEventLocally(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000020 0x00007ffff58c4015 in wxEvtHandler::ProcessEvent(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000021 0x00007ffff58c4a9a in wxEvtHandler::ProcessPendingEvents() ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000022 0x00007ffff573f6b7 in wxAppConsoleBase::ProcessPendingEvents() ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
---Type <return> to continue, or q <return> to quit---
0000023 0x00007ffff5dcf5b2 in wxApp::DoIdle() () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
0000024 0x00007ffff5dcf6a3 in ?? () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
0000025 0x00007fffed1cc05a in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
0000026 0x00007fffed1cc400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
0000027 0x00007fffed1cc722 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
0000028 0x00007fffee429567 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
0000029 0x00007ffff5def9c5 in wxGUIEventLoop::DoRun() () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
0000030 0x00007ffff577f6f3 in wxEventLoopBase::Run() () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000031 0x00007ffff5744a06 in wxAppConsoleBase::MainLoop() () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000032 0x00007ffff57d1310 in wxEntry(int&, wchar_t**) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
0000033 0x00000000004401d8 in main (argc=<optimized out>, argv=<optimized out>) at main.cpp:148
(gdb)
TagsNo tags attached.

Activities

coldtobi

coldtobi

04.08.2016 18:58

reporter   ~0008248

added commit id -- as the Debian repository will move forward.
greebo

greebo

10.08.2016 17:13

administrator   ~0008254

The backtrace indicates that the crash is not happening in boost::python, but in the vfspk3 module instead.

It's possible that the folder the VFS module is trying to initialise doesn't exist. Can you check whether the paths you set DR's fs_game/fs_game_base/engine path to actually exist?
greebo

greebo

16.08.2016 17:30

administrator   ~0008267

Last edited: 16.08.2016 17:31

Ok, I get the crash now in a VM here too. It crashes when calling boost::python::exec_file() on *any* script file, even though I get a different backtrace as you do. The call goes into the Python 2.7 module and crashes with a file not found. I verified the script path and the file does indeed exist.

62 iofclose.c: No such file or directory.
-0 0x00007ffff3a3624c in _IO_new_fclose (fp=0x1f38090) at iofclose.c:62
-1 0x00007fffe47ad9ad in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
-2 0x00007fffe4c1a7e8 in boost::python::exec_file(boost::python::str, boost::python::api::object, boost::python::api::object) ()
   from /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0
-3 0x00007fffe53d8d33 in script::ScriptingSystem::executeScriptFile (this=0xe5b110, filename="init.py") at ScriptingSystem.cpp:100

I don't get what's wrong here, as the Python versions of libboost and the one in /usr/lib seem to match, and I don't know what else can go wrong. Even if the script file path was wrong (which it isn't) the Python library shouldn't just crash. It's happening in the main thread as well, so I don't think that it's a multithreading issue. Didn't the same setup (with scripts) work in earlier versions of those distros?

greebo

greebo

21.08.2016 14:13

administrator   ~0008279

I run into this crash when launching a very simple test program in Kubuntu 16.04, and it seems this might be an actual bug in the boost::python libraries (which is surprising given the amount of tests they usually run their code against).

#include <boost/python.hpp>
#include <iostream>

int main()
{
    Py_Initialize();
    
    std::cout << "Python initialised" << std::endl;
    
    boost::python::exec_file("/home/greebo/init.py");
}

The program executes, and the init.py file is executed as well ("Hello world" is printed), then the program crashes with

Python initialised
Hello world
*** Error in `./a.out': double free or corruption (!prev): 0x0000000001c21620 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x77725)[0x7f2f53ec8725]
/lib/x86_64-linux-gnu/libc.so.6(+0x7ff4a)[0x7f2f53ed0f4a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f2f53ed4abc]
/lib/x86_64-linux-gnu/libc.so.6(fclose+0x103)[0x7f2f53ebe313]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0x1579ad)[0x7f2f54b559ad]
/usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0(_ZN5boost6python9exec_fileENS0_3strENS0_3api6objectES3_+0xe8)[0x7f2f547e87e8]
./a.out[0x400da0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f2f53e71830]

I've found two references:

https://bugs.launchpad.net/ubuntu/+source/boost1.58/+bug/1600345
https://github.com/boostorg/python/commit/fe24ab9dd5440562e27422cd38f7de03356bfd16

Maybe this was really introduced (and even fixed) back in 2015, yet the 16.04 (K)ubuntu distro is still using the boost 1.58 package, which is also a bit disappointing. Let's hope they upgrade to a newer boost package soon.
coldtobi

coldtobi

21.08.2016 19:49

reporter   ~0008280

(Sorry for not answering earlier and only giving a short life sign now; I did not find time to evaluate your comments until yet; I'll investigage ASAP)
coldtobi

coldtobi

27.12.2016 06:47

reporter   ~0008640

Seems so that the boost version at that time was the culprit. The new upload fixed it and I reenabled python support for Debian.

So I guess this can be closed too.
greebo

greebo

27.12.2016 07:41

administrator   ~0008643

Just for my own understanding, which new upload are you referring to? Has the boost lib version been upgraded by the Ubuntu maintainers in the meantime?
coldtobi

coldtobi

27.12.2016 09:02

reporter   ~0008644

I was talking about the recent Debian upload [1]; not about Ubuntu :)
(But Ubuntu is following the Debian package [2] this should not make a difference)

[1] https://tracker.debian.org/pkg/darkradiant
[2] https://launchpad.net/ubuntu/+source/darkradiant

The "old" package was compiled against boost 1.61 [3] , the newer one build against 1.62. This is true for both distributions [4,5]. It seems that with 1.62 the crash is gone.

[3] https://buildd.debian.org/status/fetch.php?pkg=darkradiant&arch=amd64&ver=2.0.4-1&stamp=1472068600
[4] https://buildd.debian.org/status/fetch.php?pkg=darkradiant&arch=amd64&ver=2.1.0-1&stamp=1481461516
[5] https://launchpadlibrarian.net/297741594/buildlog_ubuntu-zesty-amd64.darkradiant_2.1.0-1_BUILDING.txt.gz

tobi (your Debian maintainer)
greebo

greebo

27.12.2016 16:19

administrator   ~0008647

Ah, well, then I guess some appreciation is in order. :) I somehow managed to be unaware of that fact that there's a darkradiant package in Debian, let alone somebody who is actively working on keeping it up to date. So, thanks!
greebo

greebo

29.12.2016 05:06

administrator   ~0008666

By the way, tobi, if there's anything I should change in the sources in order to make your life as packager easier, please let me know. I saw that you changed stuff in debian/copyright etc. - is that something I should be pushing to upstream?
coldtobi

coldtobi

29.12.2016 21:53

reporter   ~0008678

Thanks for asking!

Regarding the debian directory:
If you want, you can sync back the changes to the debian/ directory, but it won't make a difference for the packaging (@Debian we usually recommend that upstream do not ship a debian directories, but our packaging tool will ignore the directory e.g if I import a new version*). However, the debian directory in the github repository is a quite old packaging style, so it wouldn't hurt to update them; though you need to see if you want all the changes, e.g I did drop the i20n package.

Another wish:
I'm currently carrying a patch to make darkradiant builds reproducible, (http://reproducible.debian.net/). I did not yet bother to submit it to you, as it is qwritten uite Debian specific. Though, maybe you want to take a look and eliminate all __DATE__ and __TIME__s? https://anonscm.debian.org/git/pkg-games/darkradiant.git/tree/debian/patches/01-reproducible-build.patch.


* BTW, there is a wiki page for upstreams, which might be a interesting read:
https://wiki.debian.org/UpstreamGuide; But you're doing fine here, as far as I can see..

--
tobi
greebo

greebo

30.12.2016 07:23

administrator   ~0008680

Last edited: 30.12.2016 07:24

Ok, I just tried to merge changes from your repo (https://anonscm.debian.org/git/pkg-games/darkradiant.git) to mine, but it produced tons of conflicts. Is the repo at debian.org a clone or have the files been imported by copy?

What's the best approach to make the __DATE__ stuff compatible with the repro builds? I'd like to have some sort of timestamp in the app since that's the only thing I can get from some users in terms of info. I usually don't bump versions for pre-release binaries handed out for testers.

Is it possible to define a build timestamp for Linux builds at the time the ./configure script is run? Or is that even worse?

As far as the Debian folder goes - I'd be perfectly fine with giving you write access to the repo at github such that you can work in the upstream repo directly without applying the same things over and over again each time you look into packaging. Since you as a packager are doing work that would otherwise be left for me to do, I'm willing to make your life easier here.

coldtobi

coldtobi

30.12.2016 07:54

reporter   ~0008681

Should we move this discussion off the bug tracker? You can mail me at tobi __at__ debian.org or can register at the forum.. Let me know what you prefer :)
greebo

greebo

31.12.2016 07:31

administrator   ~0008683

Well, agreed. Probably best if you get yourself an account on the forums, then. There's the DarkRadiant forum here: http://forums.thedarkmod.com/forum/51-darkradiant-feedback-and-development/
coldtobi

coldtobi

02.01.2017 18:19

reporter   ~0008699

Done, see here: http://forums.thedarkmod.com/topic/18592-debian-packaging/

Issue History

Date Modified Username Field Change
04.08.2016 18:55 coldtobi New Issue
04.08.2016 18:58 coldtobi Note Added: 0008248
04.08.2016 18:58 coldtobi Description Updated
04.08.2016 18:58 coldtobi Steps to Reproduce Updated
10.08.2016 17:13 greebo Note Added: 0008254
10.08.2016 17:13 greebo Status new => feedback
16.08.2016 17:30 greebo Note Added: 0008267
16.08.2016 17:31 greebo Note Edited: 0008267
16.08.2016 17:31 greebo Note Edited: 0008267
21.08.2016 14:13 greebo Note Added: 0008279
21.08.2016 19:49 coldtobi Note Added: 0008280
21.08.2016 19:49 coldtobi Status feedback => new
27.12.2016 06:47 coldtobi Note Added: 0008640
27.12.2016 07:41 greebo Note Added: 0008643
27.12.2016 07:41 greebo Status new => feedback
27.12.2016 09:02 coldtobi Note Added: 0008644
27.12.2016 09:02 coldtobi Status feedback => new
27.12.2016 16:19 greebo Note Added: 0008647
27.12.2016 16:20 greebo Status new => resolved
27.12.2016 16:20 greebo Fixed in Version => 2.2.0
27.12.2016 16:20 greebo Resolution open => fixed
27.12.2016 16:20 greebo Assigned To => greebo
29.12.2016 05:06 greebo Note Added: 0008666
29.12.2016 21:53 coldtobi Note Added: 0008678
30.12.2016 07:23 greebo Note Added: 0008680
30.12.2016 07:24 greebo Note Edited: 0008680
30.12.2016 07:24 greebo Note Edited: 0008680
30.12.2016 07:54 coldtobi Note Added: 0008681
31.12.2016 07:31 greebo Note Added: 0008683
02.01.2017 18:19 coldtobi Note Added: 0008699
10.08.2017 18:34 greebo Status resolved => closed