Okay, I decided to look for the crash error myself. I ran Slade 2.0 alpha in
valgrind (an excellent memory debugger for Linux) and discovered a few things. First, Slade is leaking lots of memory. Second, line 76 of src/archive.cpp should use delete[] instead of just delete.
Third, the crash occurs when gluBuild2DMipmaps is called. However, I didn't really figure out why this triggers a null pointer access. Here is the relevant section from what valgrind spits out about that error:
Code: Select all
==14928== Invalid read of size 1
==14928== at 0x496F781: ____strtod_l_internal (in /lib/tls/libc.so.6)
==14928== by 0x496CDFE: __strtod_internal (in /lib/tls/libc.so.6)
==14928== by 0x4AE7A7C: closestFit (in /usr/lib/libGLU.so.1.3)
==14928== by 0x4AEC1AD: gluBuild2DMipmaps (in /usr/lib/libGLU.so.1.3)
==14928== by 0x810EF3C: Texture::gen_from_data(int, int, unsigned char*, int, int, bool) (textures.cpp:1043)
==14928== by 0x811036A: FileTexture::gen_gl_tex() (textures.cpp:1353)
==14928== by 0x810AEB0: load_editor_texture(std::string, std::string, int, int, int) (textures.cpp:204)
==14928== by 0x810B989: init_textures() (textures.cpp:375)
==14928== by 0x80E2A1F: MapCanvas::MapCanvas(wxWindow*) (map_canvas.cpp:92)
==14928== by 0x8094C7C: EditorWindow::EditorWindow(wchar_t const*, int, int, int, int) (editor_window.cpp:69)
==14928== by 0x80E1EB8: MainApp::OnInit() (main.cpp:263)
==14928== by 0x80E2209: wxAppConsole::CallOnInit() (app.h:87)
==14928== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==14928==
==14928== Process terminating with default action of signal 11 (SIGSEGV)
==14928== Access not within mapped region at address 0x0
==14928== at 0x496F781: ____strtod_l_internal (in /lib/tls/libc.so.6)
==14928== by 0x496CDFE: __strtod_internal (in /lib/tls/libc.so.6)
==14928== by 0x4AE7A7C: closestFit (in /usr/lib/libGLU.so.1.3)
==14928== by 0x4AEC1AD: gluBuild2DMipmaps (in /usr/lib/libGLU.so.1.3)
==14928== by 0x810EF3C: Texture::gen_from_data(int, int, unsigned char*, int, int, bool) (textures.cpp:1043)
==14928== by 0x811036A: FileTexture::gen_gl_tex() (textures.cpp:1353)
==14928== by 0x810AEB0: load_editor_texture(std::string, std::string, int, int, int) (textures.cpp:204)
==14928== by 0x810B989: init_textures() (textures.cpp:375)
==14928== by 0x80E2A1F: MapCanvas::MapCanvas(wxWindow*) (map_canvas.cpp:92)
==14928== by 0x8094C7C: EditorWindow::EditorWindow(wchar_t const*, int, int, int, int) (editor_window.cpp:69)
==14928== by 0x80E1EB8: MainApp::OnInit() (main.cpp:263)
==14928== by 0x80E2209: wxAppConsole::CallOnInit() (app.h:87)
BTW, I merged the 4 if statements in this area into a switch statement because there is no reason to check all 4 conditions when only one of them could be true.
Those people who are simply looking to get past this error with the Slade 2.0 alpha can get past this error by commenting out both calls to gluBuild2DMipmaps in textures.cpp. This effectively disables mipmapping, which isn't really that big of a thing. However, it would be nice to figure out why it crashes and how to fix it.
Lastly, src/render.cpp is still screwed up and marked as a binary file in SVN. GCC cannot compile it because of this. Anyone who wants to build still needs to download render.cpp.gz from several messages back and overwrite it. The rest of the patch is attached.
Edit: Okay, I am almost certain that the crash occurs because you call gluBuild2DMipmaps() before you have a valid (GL) graphics context. Fix this and you will fix the crash.