From: Riku P. <ri...@pa...> - 2012-02-21 19:59:07
|
Hi, On Tue, 2012-02-21 at 19:45 +0000, Mark Page wrote: > > Hi, > > I do agree with Alex. The VTable will change th memory layout itself > > and IMHO this is the reason why the undefined behavious will not occur > > in that case. It will occur somewhere else, if this is a bug in our > > code. > > > > Maybe this is just a compiler bug or we have a overwrite somewhere > > else. Special the change in the memory layout and the vanished crash > > can be a sign for that. Which data has changed between the both > > revisions? > > > > Kimmi > > I am in the process of finding the exact cause of the problem, by stripping code out of assimp until I can replicate the exact crash with minimal code. > > So far I have managed to strip out 90% of assimp code, and still can replicate the crash. > > Hopefully, I will finish this tomorrow. > > If it is a compiler problem, I can post the test case to the GCC developers Basically this is the simplest way to reproduce the original problem: http://ideone.com/y2UxD - Now it crashes / triggers the valgrind error with gcc 4.4 and 4.6. With clang it works just fine. And it also works fine if you remove "const" on line 15 (or remove the const in the original assimp code). I have no idea if is it UB to delete a->b if b deletes a. Expressions should be evaluated only once, but for some reason this line: delete a->b; is basically acting as if was written like: a->b->~B(); operator delete(a->b); // a is already deleted -- Riku |