[Gtkradiant] aabb.h model.h and OSX

Forest `LordHavoc` Hale lordhavoc at ghdigital.com
Tue May 8 16:26:04 CDT 2007

Sadly I don't understand the template known as iterator in C++, so I really can't say what is happening in this code.

That said, it would seem the ++i is iterating incorrectly and picking some other address rather than the next surface - because if it was working correctly I'm sure it would end fail the i != 
m_surfaces.end() before it ever got to any invalid addresses like NULL.

So perhaps the iterator is configured wrongly in some way when it is created, or when surfaces are added to it.

Vincent Morénas wrote:
> Hi everyone,
> I am trying to make GtkRadiant1.5 (latest svn) succeeds in loading  
> md3 models without crashing at runtime and here is the situation I  
> found (the crash happens on both architectures ppc and intel).
> I am using the Quake3 "museum.map" file to trigger the crash.
> Using gdb/ddd, I noticed this : when Gtkradiant loads femhead.md3  
> (the first model used by the map), there is a call to   
> model.updateAABB() in md3.cpp.
> In the updateAABB() procedure of the Model class in model.h, there is  
> a loop and the problem comes from that loop.
> At the beginnig, the loop variable i is correctly defined and the  
> first iteration runs ok. But things change for the second : here are  
> typical values I got :
> 	first iteration :    	i:  _M_current = 0x73da700	*i:   (Surface *&)  
> @0x73da700: 0x357b
> 	second iteration: 	i:  _M_current = 0x73da704	*i:   (Surface *&)  
> @0x73da704: 0x0  <--------  NULL pointer !!!
> and the program crashes at the call (*i)->localAABB()
> I also noticed something which looks  wrong  to me, related to the  
> m_surfaces variables at this same point ;  here are some of the  
> values I got from gdb :
> this->m_surfaces :	_M_start		0x73da700
> 					_M_finish	0x73da718
> 					_M_end_of_storage		0x0    <-----  NULL again !!
> Any ideas or suggestions ?
> Thanks.
> V.
> _______________________________________________
> Gtkradiant mailing list
> Gtkradiant at zerowing.idsoftware.com
> http://zerowing.idsoftware.com/cgi-bin/mailman/listinfo/gtkradiant

Author of DarkPlaces Quake1 engine and mod
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass

More information about the Gtkradiant mailing list