dhewm / dhewm3

dhewm 3 main repository
https://dhewm3.org/
GNU General Public License v3.0
1.81k stars 351 forks source link

SIGSEGV when certain files are missing #28

Closed Urfoex closed 9 years ago

Urfoex commented 12 years ago

Having a default.cfg and a materails/default.mtr when those two files: → script/doom_main.script → script/doom_defs.script

are missing dhewm3 will crash with:

Program received signal SIGSEGV, Segmentation fault. 0x00007fffe3102221 in Remove (node=0x3ccd820, this=0x7fffe37801f0) at /home/kakarott/projects/iodoom3/dhewm3/neo/idlib/containers/BTree.h:231 231 if ( parent->key > parent->lastChild->key ) {

(gdb) print parent->lastChild $3 = (idBTreeNode<idDynamicBlock, int> *) 0x0

andre-d commented 12 years ago

Got a backtrace?

dhewg commented 12 years ago

Yeah, some asset files are required, no way around that atm. Are you by chance working on free and minimal assets to get the engine up?

Urfoex commented 12 years ago

@andre-d Here are the backtraces:

This one is coming when no script is there:

0 idDynamicBlockAlloc<char, 262144, 128>::Free() at dhewm3/neo/idlib/Heap.h:644

1 idStr::FreeData() at dhewm3/neo/idlib/Str.cpp:129

2 ~idStr() at dhewm3/neo/idlib/Str.h:486

3 idDEntry::~idDEntry() at dhewm3/neo/framework/FileSystem.cpp:320

4 idFileSystemLocal::~idFileSystemLocal() at dhewm3/neo/framework/FileSystem.cpp:331

5 __run_exit_handlers() at exit.c:77

6 *__GI_exit() at exit.c:99

7 Posix_Exit() at dhewm3/neo/sys/posix/posix_main.cpp:99

8 Sys_Error() at dhewm3/neo/sys/posix/posix_main.cpp:813

9 idCommonLocal::Init() at dhewm3/neo/framework/Common.cpp:2837

10 main() at dhewm3/neo/sys/linux/main.cpp:282

And this one is when doom_main.script is available:

0 Remove() at dhewm3/neo/idlib/containers/BTree.h:230

1 UnlinkFreeInternal() at dhewm3/neo/idlib/Heap.h:865

2 idDynamicBlockAlloc<char, 262144, 128>::FreeInternal() at dhewm3/neo/idlib/Heap.h:842

3 idDynamicBlockAlloc<char, 262144, 128>::Free() at dhewm3/neo/idlib/Heap.h:646

4 idStr::FreeData() at dhewm3/neo/idlib/Str.cpp:129

5 ~idStr() at dhewm3/neo/idlib/Str.h:486

6 Clear() at dhewm3/neo/idlib/containers/List.h:185

7 idProgram::FreeData() at dhewm3/neo/game/script/Script_Program.cpp:1943

8 idProgram::~idProgram() at dhewm3/neo/game/script/Script_Program.cpp:2185

9 idGameLocal::~idGameLocal() at dhewm3/neo/game/Game_local.h:222

10 __run_exit_handlers() at exit.c:77

11 *__GI_exit() at exit.c:99

12 Posix_Exit() at dhewm3/neo/sys/posix/posix_main.cpp:99

13 Sys_Error() at dhewm3/neo/sys/posix/posix_main.cpp:813

14 idCommonLocal::Init() at dhewm3/neo/framework/Common.cpp:2837

15 main() at dhewm3/neo/sys/linux/main.cpp:282

@dhewg Required is OK as long as if they are missing the executable doesn't crash. But it crashes so it's not OK (I guess). Something seems to go wrong inside the idStr class. The data member isn't set right.

Also a bit strange is that the files doesn't contain anything. Empty files shouldn't be required. (At least it could be created if not found.)

What do you mean by "get[ting] the engine up"? Those are the minimal files I needed to get the window open: https://docs.google.com/open?id=0B-DgjzoFZxxwcDM2dUZ1ajBjbHM

From there you can open the console and do stuff. But as the console font is missing you would need to start from e.g. a terminal so that output is printed there. If you place the right textures/bigchars.tga you would also see chars inside. There is also a more complex minimal assets file: http://wiki.iodoom3.org/Minimum_Assets

But yeah. I'm kind of working on a (asset) starter kit. It's for a course at university. The first part is analysing the engine and tools and getting a simple starter kit going.

andre-d commented 12 years ago

Yeah, I will work out a way to handle that and just quit with an error. Likely Monday.

edit: WAIT! Those are empty files? I will be sure to fix this then.

motorsep commented 12 years ago

Yeah, that's something everyone really needs - no crash on missing assets.

DanielGibson commented 9 years ago

with https://github.com/DanielGibson/d3-base-assets (and the included patch) things shouldn't crash, so use that.. or maybe https://github.com/OpenTechEngine/OpenTechBFG if you wanna use the superior doom3 bfg engine.