View Issue Details

IDProjectCategoryView StatusLast Update
0000306DarkRadiantSelection Systempublic11.04.2008 21:02
ReporterFidcal Assigned Toorbweaver  
Status closedResolutionfixed 
Product Version0.9.0 
Fixed in Version0.9.2 
Summary0000306: Model selector crashes after viewing 570+
DescriptionAfter about 585 clicks or key selections (maybe 570 actual selections) the model selector crashes DR

Additional InformationThis DM forum thread relates...
TagsNo tags attached.




05.06.2007 16:06

administrator   ~0000673

Last edited: 05.06.2007 16:07

This is the backtrace after half a million model views in Linux:

0 0x00002adaa3cc8d51 in fseek () from /lib/
1 0x00000000006ab1f4 in FileInputStream::seek (this=0x24f6f790,
    position=163096763) at libs/stream/filestream.h:77
2 0x00002adaa70f486d in SubFileInputStream (this=0x24f6f7a8,
    istream=@0x24f6f790, offset=163096763, size=124187)
    at libs/stream/filestream.h:108
3 0x00002adaa70f8e95 in DeflatedArchiveFile (this=0x24f6f780,
    name=0x25410d48 "textures/hell/treeroots.tga",
    archiveName=0xedefb8 "/usr/local/games/doom3/base/pak004.pk4",
    position=163096763, stream_size=124187, file_size=196652)
    at plugins/archivezip/archive.cpp:47
4 0x00002adaa70f9172 in ZipArchive::openFile (this=0xedef40,
    name=0x25410d48 "textures/hell/treeroots.tga")
    at plugins/archivezip/archive.cpp:264
5 0x00002adaa8f49113 in OpenFile (
    filename=0x25410d48 "textures/hell/treeroots.tga")
    at plugins/vfspk3/vfs.cpp:429
6 0x00002adaa8f4d173 in Quake3FileSystem::openFile (this=0x2adaa915f7b0,
    filename=0x25410d48 "textures/hell/treeroots.tga")
    at plugins/vfspk3/vfs.cpp:555
7 0x00002adaa75e152f in shaders::DefaultConstructor::construct (
    this=0x254119b0) at plugins/shaders/textures/DefaultConstructor.cpp:32
8 0x00002adaa75db9a1 in shaders::GLTextureManager::getBinding (
    this=0x139c4e0, textureKey=@0x25411040, constructor=@0x7fff0b2bf2a0)
    at plugins/shaders/textures/GLTextureManager.cpp:46
9 0x00002adaa75c33b0 in shaders::CShader::getTexture (this=0x25411020)
    at plugins/shaders/CShader.cpp:102
10 0x0000000000726c2a in ui::TextureBrowser::evaluateHeight (this=0xb76e80)
    at radiant/ui/texturebrowser/TextureBrowser.cpp:235
11 0x0000000000726d91 in ui::TextureBrowser::getTotalHeight (this=0xb76e80)
    at radiant/ui/texturebrowser/TextureBrowser.cpp:242
12 0x0000000000726e70 in ui::TextureBrowser::updateScroll (this=0xb76e80)
    at radiant/ui/texturebrowser/TextureBrowser.cpp:611
13 0x000000000072901b in ui::TextureBrowser::heightChanged (this=0xb76e80)
    at radiant/ui/texturebrowser/TextureBrowser.cpp:215
14 0x00000000007290d1 in ui::TextureBrowser::activeShadersChanged (
    this=0xb76e80) at radiant/ui/texturebrowser/TextureBrowser.cpp:275
15 0x000000000072a290 in Member<ui::TextureBrowser, void, &(ui::TextureBrowser::activeShadersChanged())>::call (object=@0xb76e80)

Not very helpful, I'm afraid...



16.06.2007 08:12

developer   ~0000691

How was this backtrace produced? Is there an easy way to replicate this issue on Linux?


16.06.2007 11:24

administrator   ~0000693

Last edited: 16.06.2007 11:24

I basically just started DarkRadiant in gdb and walked down the ModelPreview tree (after I had expanded all the folders) until it crashed. It takes some time, but eventually it bails out.

I only dumped this one backtrace, I haven't tried it again, since it takes so long to produce it.



16.06.2007 20:31

developer   ~0000694

Confirmed on Linux. By using Shift-RightArrow on the darkmod/ toplevel model folder to recursively open the entire tree, then holding down the down/uparrow keys to traverse the models, a Segfault can be generated.

For reference, enabling core dumps with "ulimit -c <max_size>" may be useful since this allows the segfault to be examined in GDB at a later stage.


16.06.2007 20:38

developer   ~0000695

Last edited: 16.06.2007 20:39

Another backtrace:

0 0x082e0653 in ui::ModelPreview::setModel (this=0x9dc6bc4,
    model=@0xbfbbcfcc) at radiant/ui/common/ModelPreview.cpp:140
1 0x082ce601 in ui::ModelSelector::updateSelected (this=0x9dc6bc0)
    at radiant/ui/modelselector/ModelSelector.cpp:281
2 0x082ceb5f in ui::ModelSelector::callbackSelChanged (widget=0x9ae3040,
    self=0x9dc6bc0) at radiant/ui/modelselector/ModelSelector.cpp:355
3 0xb7853423 in g_cclosure_marshal_VOID__VOID ()
   from /usr/lib/
4 0xb784779f in g_closure_invoke () from /usr/lib/
5 0xb78562ea in g_signal_stop_emission () from /usr/lib/
6 0xb7857b19 in g_signal_emit_valist () from /usr/lib/
7 0xb7857e89 in g_signal_emit () from /usr/lib/
8 0xb7ce6da7 in _gtk_tree_selection_internal_select_node ()
   from /usr/lib/
9 0xb7cf9219 in gtk_tree_view_scroll_to_cell ()
   from /usr/lib/
10 0xb7d00ca0 in gtk_tree_view_set_model () from /usr/lib/
11 0xb7c30bd6 in _gtk_marshal_BOOLEAN__ENUM_INT ()
   from /usr/lib/
12 0xb784716f in g_cclosure_new_swap () from /usr/lib/
13 0xb784779f in g_closure_invoke () from /usr/lib/
14 0xb78569ce in g_signal_stop_emission () from /usr/lib/
15 0xb7857268 in g_signal_emitv () from /usr/lib/



16.06.2007 21:22

administrator   ~0000696

Last edited: 16.06.2007 21:23

This looks a bit random to me. What kind of corruption is this?

Could this be some GTK callback not returning the correct value (FALSE/TRUE) or taking the wrong arguments?



17.06.2007 07:05

developer   ~0000697

Another backtrace:

#0 0x00000000 in ?? ()
0000001 0x0820fa60 in boost::detail::sp_counted_base::release (this=0x9b03c80) at sp_counted_base_gcc_x86.hpp:145
0000002 0x0820faa8 in ~shared_count (this=0xbfba7c60) at shared_count.hpp:159
0000003 0x082ba960 in ~shared_ptr (this=0xbfba7c5c) at shared_ptr.hpp:106
0000004 0x082e0570 in ui::ModelPreview::setModel (this=0x9ad7704, model=@0xbfba7ccc) at radiant/ui/common/ModelPreview.cpp:127
0000005 0x082ce601 in ui::ModelSelector::updateSelected (this=0x9ad7700) at radiant/ui/modelselector/ModelSelector.cpp:281
0000006 0x082ceb5f in ui::ModelSelector::callbackSelChanged (widget=0x9ae3040, self=0x9ad7700) at radiant/ui/modelselector/ModelSelector.cpp:355
0000007 0xb7840423 in g_cclosure_marshal_VOID__VOID () from /usr/lib/
#8 0xb783479f in g_closure_invoke () from /usr/lib/
0000009 0xb78432ea in g_signal_stop_emission () from /usr/lib/


17.06.2007 07:38

developer   ~0000698

The crash is fixed, but the root cause still outstanding. The PicoModeLoader::loadModelFromPath() function in the model plugin was not returning any value if the ArchiveFile could not be opened, when in fact an NULL shared_ptr should have been returned. Combined with an appropriate check in ModelPreview, this stops the segfault but instead prints out a message to console when a model cannot be opened.

The underlying problem seems to be that after a certain time, all of the ArchiveFiles fail to open, even for models which loaded OK in the past.


17.06.2007 07:50

developer   ~0000699

Fixed in SVN. The ArchiveFile was not release()'d after loading the model data from it.


17.06.2007 09:04

administrator   ~0000700

Wow, good work! Glad this is resolved, it was sure annoying during the texture/model reorg.

Issue History

Date Modified Username Field Change
30.05.2007 19:24 Fidcal New Issue
30.05.2007 21:01 greebo Status new => acknowledged
05.06.2007 15:37 greebo Status acknowledged => confirmed
05.06.2007 16:06 greebo Note Added: 0000673
05.06.2007 16:07 greebo Note Edited: 0000673
16.06.2007 08:12 orbweaver Note Added: 0000691
16.06.2007 11:24 greebo Note Added: 0000693
16.06.2007 11:24 greebo Note Edited: 0000693
16.06.2007 20:31 orbweaver Note Added: 0000694
16.06.2007 20:38 orbweaver Note Added: 0000695
16.06.2007 20:39 orbweaver Note Edited: 0000695
16.06.2007 21:22 greebo Note Added: 0000696
16.06.2007 21:23 greebo Note Edited: 0000696
17.06.2007 07:05 orbweaver Note Added: 0000697
17.06.2007 07:38 orbweaver Note Added: 0000698
17.06.2007 07:50 orbweaver Status confirmed => assigned
17.06.2007 07:50 orbweaver Assigned To => orbweaver
17.06.2007 07:50 orbweaver Status assigned => resolved
17.06.2007 07:50 orbweaver Fixed in Version => latest SVN
17.06.2007 07:50 orbweaver Resolution open => fixed
17.06.2007 07:50 orbweaver Note Added: 0000699
17.06.2007 09:04 greebo Note Added: 0000700
11.04.2008 21:02 greebo Status resolved => closed