delete this dangerous in duchain? [was: Crash in duchaintest]

Andreas Pakulat apaku at gmx.de
Wed Feb 4 21:57:46 UTC 2009


On 04.02.09 13:58:17, Andreas Pakulat wrote:
> On 03.02.09 22:50:59, David nolden wrote:
> > Am Dienstag 03 Februar 2009 12:53:29 schrieb Andreas Pakulat:
> > > Interesting, any idea which of them could have an influence?
> > I only hit that problem once. After that I re-added the export-macro to 
> > templatedeclaration.h, and from then on I didn't hit the crash again.
> > 
> > Are you sure it's safe to remove that export-macro, even if the template-
> > declaration has virtual functions and such?
> 
> It doesn't change anything for me when I re-add the export macro, just as I
> guessed. I'll try to do some more debugging to find out which contexts are
> being lost and (hopefully) why tonight.

Unfortunately debugging and fixing this seems to be completely beyond me,
unless I invest hours of learning how duchain is supposed to behave.

The DumpChain class doesn't help because as soon as I try to dump a context
at a certain point (creating or deleting a context) I get new crashes from
the dumping.

Hence my last try is posting my debug output and the related diff here. I'm
still available to actually run the test and provide other debug
information, but I'm unable to find the reasons for this "dangling"
temporary context myself.

Andreas

-- 
Is this really happening?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debug_temp.diff
Type: text/x-diff
Size: 9056 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090204/7417d24d/attachment.bin>
-------------- next part --------------
QDEBUG : TestDUChain::testSpecializedTemplates() <unknown program name>(2844)/ class KDevelop::ReferencedTopDUContext __thiscall ContextBuilder::buildContexts(const class KSharedPtr<class Cpp::EnvironmentFile> &,struct AST *,class QList<struct LineContextPair> *,const class KDevelop::ReferencedTopDUContext &,bool): ContextBuilder::buildContexts: compiling
 allocating context index for: 0x569dd88, parent: 0x5695218
 allocating context index for: 0x56d4e78, parent: 0x5695218
 allocating context index for: 0x569e6f0, parent: 0x5695218
 allocating context index for: 0x56a0488, parent: 0x5695218
 allocating context index for: 0x56d5d40, parent: 0x5695218
 allocating context index for: 0x56d4388, parent: 0x5695218
adding temp context: 0x56d4388
deleting cpp ducontext: 0x56d4388
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56d4388, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56d4388
clearing context index: 0x56d4388
setting context for index: 0 to 0, 0x56d4388
is temp context?: 1
Done deleting context
 allocating context index for: 0x56d50b0, parent: 0x5695218
adding temp context: 0x56d50b0
 allocating context index for: 0x56dcc40, parent: 0x5695218
adding temp context: 0x56dcc40
 allocating context index for: 0x56ea368, parent: 0x5695218
 allocating context index for: 0x56dd028, parent: 0x5695218
 allocating context index for: 0x56a5a00, parent: 0x5695218
adding temp context: 0x56a5a00
deleting cpp ducontext: 0x56a5a00
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56a5a00, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56a5a00
clearing context index: 0x56a5a00
setting context for index: 3 to 0, 0x56a5a00
is temp context?: 1
Done deleting context
 allocating context index for: 0x56a3530, parent: 0x5695218
adding temp context: 0x56a3530
 allocating context index for: 0x56a1630, parent: 0x5695218
adding temp context: 0x56a1630
 allocating context index for: 0x56a15b8, parent: 0x5695218
 allocating context index for: 0x56a34c0, parent: 0x5695218
 allocating context index for: 0x569f7c0, parent: 0x5695218
adding temp context: 0x569f7c0
deleting cpp ducontext: 0x569f7c0
deleting instantiations
done deleting cppducontext part
Deleting context: 0x569f7c0, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x569f7c0
clearing context index: 0x569f7c0
setting context for index: 6 to 0, 0x569f7c0
is temp context?: 1
Done deleting context
 allocating context index for: 0x56a3fd0, parent: 0x5695218
adding temp context: 0x56a3fd0
 allocating context index for: 0x56a4288, parent: 0x5695218
adding temp context: 0x56a4288
QDEBUG : TestDUChain::testSpecializedTemplates() <unknown program name>(2844)/ class KDevelop::ReferencedTopDUContext __thiscall ContextBuilder::buildContexts(const class KSharedPtr<class Cpp::EnvironmentFile> &,struct AST *,class QList<struct LineContextPair> *,const class KDevelop::ReferencedTopDUContext &,bool): built top-level context with 5 declarations and 0 included files
QDEBUG : TestDUChain::testSpecializedTemplates() <unknown program name>(2844)/ void __thiscall TestDUChain::testSpecializedTemplates(void): specialized with "<delayed> const T*"
 allocating context index for: 0x56a0b28, parent: 0x5695218
adding temp context: 0x56a0b28
 allocating context index for: 0x56a4d10, parent: 0x5695218
adding temp context: 0x56a4d10
 allocating context index for: 0x56969d0, parent: 0x5695218
adding temp context: 0x56969d0
 allocating context index for: 0x5699c88, parent: 0x5695218
adding temp context: 0x5699c88
 allocating context index for: 0x5694e78, parent: 0x5695218
adding temp context: 0x5694e78
 allocating context index for: 0x569e240, parent: 0x5695218
adding temp context: 0x569e240
 allocating context index for: 0x5697d08, parent: 0x5695218
adding temp context: 0x5697d08
 allocating context index for: 0x56dd8d0, parent: 0x5695218
adding temp context: 0x56dd8d0
 allocating context index for: 0x5697988, parent: 0x5695218
adding temp context: 0x5697988
 allocating context index for: 0x5696f68, parent: 0x5695218
adding temp context: 0x5696f68
 allocating context index for: 0x5697458, parent: 0x5695218
adding temp context: 0x5697458
 allocating context index for: 0x5697618, parent: 0x5695218
adding temp context: 0x5697618
 allocating context index for: 0x56dae08, parent: 0x5695218
adding temp context: 0x56dae08
 allocating context index for: 0x56da3d8, parent: 0x5695218
adding temp context: 0x56da3d8
 allocating context index for: 0x56dbae8, parent: 0x5695218
adding temp context: 0x56dbae8
 allocating context index for: 0x56db800, parent: 0x5695218
adding temp context: 0x56db800
 allocating context index for: 0x56de388, parent: 0x5695218
adding temp context: 0x56de388
 allocating context index for: 0x56deac0, parent: 0x5695218
adding temp context: 0x56deac0
deleteSelf
Deleting this: 0x5695218
deleting cpp ducontext: 0x5695218
deleting instantiations
done deleting cppducontext part
Deleting context: 0x5695218, top: 0x5695218, parent: 0x0
clearing imported parent contexts
deleting all child contexts
deleting cpp ducontext: 0x569dd88
deleting instantiations
done deleting cppducontext part
Deleting context: 0x569dd88, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x569dd88
clearing context index: 0x569dd88
is temp context?: 0
Done deleting context
deleting cpp ducontext: 0x56d4e78
deleting instantiations
deleting cpp instantiation: 0x56a4288 - anon: 1
deleting cpp ducontext: 0x56a4288
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56a4288, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56a4288
clearing context index: 0x56a4288
setting context for index: 8 to 0, 0x56a4288
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x569e240 - anon: 1
deleting cpp ducontext: 0x569e240
deleting instantiations
done deleting cppducontext part
Deleting context: 0x569e240, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x569e240
clearing context index: 0x569e240
setting context for index: 14 to 0, 0x569e240
is temp context?: 1
Done deleting context
done deleting cppducontext part
Deleting context: 0x56d4e78, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56d4e78
clearing context index: 0x56d4e78
is temp context?: 0
Done deleting context
deleting cpp ducontext: 0x569e6f0
deleting instantiations
deleting cpp instantiation: 0x56a3fd0 - anon: 1
deleting cpp ducontext: 0x56a3fd0
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56a3fd0, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56a3fd0
clearing context index: 0x56a3fd0
setting context for index: 7 to 0, 0x56a3fd0
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x5694e78 - anon: 1
deleting cpp ducontext: 0x5694e78
deleting instantiations
done deleting cppducontext part
Deleting context: 0x5694e78, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x5694e78
clearing context index: 0x5694e78
setting context for index: 13 to 0, 0x5694e78
is temp context?: 1
Done deleting context
done deleting cppducontext part
Deleting context: 0x569e6f0, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x569e6f0
clearing context index: 0x569e6f0
is temp context?: 0
Done deleting context
deleting cpp ducontext: 0x56a0488
deleting instantiations
deleting cpp instantiation: 0x56dd8d0 - anon: 1
deleting cpp ducontext: 0x56dd8d0
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56dd8d0, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56dd8d0
clearing context index: 0x56dd8d0
setting context for index: 16 to 0, 0x56dd8d0
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x56da3d8 - anon: 1
deleting cpp ducontext: 0x56da3d8
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56da3d8, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56da3d8
clearing context index: 0x56da3d8
setting context for index: 22 to 0, 0x56da3d8
is temp context?: 1
Done deleting context
done deleting cppducontext part
Deleting context: 0x56a0488, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56a0488
clearing context index: 0x56a0488
is temp context?: 0
Done deleting context
deleting cpp ducontext: 0x56d5d40
deleting instantiations
deleting cpp instantiation: 0x5697d08 - anon: 1
deleting cpp ducontext: 0x5697d08
deleting instantiations
done deleting cppducontext part
Deleting context: 0x5697d08, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x5697d08
clearing context index: 0x5697d08
setting context for index: 15 to 0, 0x5697d08
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x56dae08 - anon: 1
deleting cpp ducontext: 0x56dae08
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56dae08, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56dae08
clearing context index: 0x56dae08
setting context for index: 21 to 0, 0x56dae08
is temp context?: 1
Done deleting context
done deleting cppducontext part
Deleting context: 0x56d5d40, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56d5d40
clearing context index: 0x56d5d40
is temp context?: 0
Done deleting context
deleting cpp ducontext: 0x56ea368
deleting instantiations
deleting cpp instantiation: 0x5696f68 - anon: 1
deleting cpp ducontext: 0x5696f68
deleting instantiations
done deleting cppducontext part
Deleting context: 0x5696f68, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x5696f68
clearing context index: 0x5696f68
setting context for index: 18 to 0, 0x5696f68
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x56db800 - anon: 1
deleting cpp ducontext: 0x56db800
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56db800, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56db800
clearing context index: 0x56db800
setting context for index: 24 to 0, 0x56db800
is temp context?: 1
Done deleting context
done deleting cppducontext part
Deleting context: 0x56ea368, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56ea368
clearing context index: 0x56ea368
is temp context?: 0
Done deleting context
deleting cpp ducontext: 0x56dd028
deleting instantiations
deleting cpp instantiation: 0x5697988 - anon: 1
deleting cpp ducontext: 0x5697988
deleting instantiations
done deleting cppducontext part
Deleting context: 0x5697988, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x5697988
clearing context index: 0x5697988
setting context for index: 17 to 0, 0x5697988
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x56dbae8 - anon: 1
deleting cpp ducontext: 0x56dbae8
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56dbae8, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56dbae8
clearing context index: 0x56dbae8
setting context for index: 23 to 0, 0x56dbae8
is temp context?: 1
Done deleting context
done deleting cppducontext part
Deleting context: 0x56dd028, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56dd028
clearing context index: 0x56dd028
is temp context?: 0
Done deleting context
deleting cpp ducontext: 0x56a15b8
deleting instantiations
deleting cpp instantiation: 0x5699c88 - anon: 1
deleting cpp ducontext: 0x5699c88
deleting instantiations
done deleting cppducontext part
Deleting context: 0x5699c88, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x5699c88
clearing context index: 0x5699c88
setting context for index: 12 to 0, 0x5699c88
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x56a4d10 - anon: 1
deleting cpp ducontext: 0x56a4d10
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56a4d10, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56a4d10
clearing context index: 0x56a4d10
setting context for index: 10 to 0, 0x56a4d10
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x5697618 - anon: 1
deleting cpp ducontext: 0x5697618
deleting instantiations
done deleting cppducontext part
Deleting context: 0x5697618, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x5697618
clearing context index: 0x5697618
setting context for index: 20 to 0, 0x5697618
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x56deac0 - anon: 1
deleting cpp ducontext: 0x56deac0
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56deac0, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56deac0
clearing context index: 0x56deac0
setting context for index: 26 to 0, 0x56deac0
is temp context?: 1
Done deleting context
done deleting cppducontext part
Deleting context: 0x56a15b8, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56a15b8
clearing context index: 0x56a15b8
is temp context?: 0
Done deleting context
deleting cpp ducontext: 0x56a34c0
deleting instantiations
deleting cpp instantiation: 0x56969d0 - anon: 1
deleting cpp ducontext: 0x56969d0
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56969d0, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56969d0
clearing context index: 0x56969d0
setting context for index: 11 to 0, 0x56969d0
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x56a0b28 - anon: 1
deleting cpp ducontext: 0x56a0b28
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56a0b28, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56a0b28
clearing context index: 0x56a0b28
setting context for index: 9 to 0, 0x56a0b28
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x5697458 - anon: 1
deleting cpp ducontext: 0x5697458
deleting instantiations
done deleting cppducontext part
Deleting context: 0x5697458, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x5697458
clearing context index: 0x5697458
setting context for index: 19 to 0, 0x5697458
is temp context?: 1
Done deleting context
deleting cpp instantiation: 0x56de388 - anon: 1
deleting cpp ducontext: 0x56de388
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56de388, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56de388
clearing context index: 0x56de388
setting context for index: 25 to 0, 0x56de388
is temp context?: 1
Done deleting context
done deleting cppducontext part
Deleting context: 0x56a34c0, top: 0x5695218, parent: 0x1
clearing imported parent contexts
deleting all child contexts
done
deleting local declarations
deleting child context from parent: 0x1 0x56a34c0
clearing context index: 0x56a34c0
is temp context?: 0
Done deleting context
done
deleting local declarations
clearing context index: 0x5695218
is temp context?: 0
Done deleting context
Deleting local: 0x569e480
Deleting dynamic data: 0x56a4968
deleting temp context: 0 0x0
deleting temp context: 1 0x56d50b0
deleting cpp ducontext: 0x56d50b0
deleting instantiations
done deleting cppducontext part
Deleting context: 0x56d50b0, top: 0x5695218, parent: 0x0
Eine Ausnahme (erste Chance) bei 0x0270a294 (kdevplatformlanguage.dll) in duchaintest.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0xfeeefeee.
Unbehandelte Ausnahme bei 0x0270a294 (kdevplatformlanguage.dll) in duchaintest.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0xfeeefeee.


More information about the KDevelop-devel mailing list