Skip to content

dstep segfaults: Unhandled type kind cast(CXTypeKind)119 #98

@ff2000

Description

@ff2000

I want to create D-bindings for https://launchpad.net/libtickit. Unfortunately it segfaults:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000000005a11c8 in dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.c.Index.CXTypeKind, bool) ()
[Current thread is 1 (Thread 0x7f05a5744700 (LWP 31788))]
(gdb) bt
#0  0x00000000005a11c8 in dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.c.Index.CXTypeKind, bool) ()
#1  0x000000000059eab5 in dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.Cursor.Cursor, clang.Type.Type, bool, bool) ()
#2  0x00000000005a0502 in dstep.translator.Type.translatePointer(dstep.translator.Context.Context, clang.Cursor.Cursor, clang.Type.Type, bool, bool) ()
#3  0x000000000059e06b in dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.Cursor.Cursor, clang.Type.Type, bool, bool) ()
#4  0x000000000059d4e9 in dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.Cursor.Cursor, bool, bool) ()
#5  0x000000000059c0fc in dstep.translator.Translator.translateFunction(dstep.translator.Output.Output, dstep.translator.Context.Context, clang.Cursor.FunctionCursor, immutable(char)[], bool).__fo
reachbody7(ref clang.Cursor.ParamCursor) ()
#6  0x000000000055cd71 in clang.Visitor.ParamVisitor.opApply(int(ref clang.Cursor.ParamCursor) delegate).__foreachbody2(ref clang.Cursor.Cursor, ref clang.Cursor.Cursor) ()
#7  0x000000000055c41c in clang.Visitor.Visitor.visitorFunction(clang.c.Index.CXCursor, clang.c.Index.CXCursor, void*) ()
#8  0x00007f05b40fe210 in clang::cxcursor::CursorVisitor::Visit(CXCursor, bool) () from /usr/lib64/libclang.so.39
#9  0x00007f05b410174f in clang::cxcursor::CursorVisitor::VisitFunctionDecl(clang::FunctionDecl*) () from /usr/lib64/libclang.so.39
#10 0x00007f05b40ffb76 in clang::declvisitor::Base<clang::declvisitor::make_ptr, clang::cxcursor::CursorVisitor, bool>::Visit(clang::Decl*) () from /usr/lib64/libclang.so.39
#11 0x00007f05b40fe9a0 in clang::cxcursor::CursorVisitor::VisitChildren(CXCursor) () from /usr/lib64/libclang.so.39
#12 0x00007f05b4109e41 in clang_visitChildren () from /usr/lib64/libclang.so.39
#13 0x000000000055cceb in clang.Visitor.ParamVisitor.opApply(int(ref clang.Cursor.ParamCursor) delegate) ()
#14 0x000000000059b921 in dstep.translator.Translator.translateFunction(dstep.translator.Output.Output, dstep.translator.Context.Context, clang.Cursor.FunctionCursor, immutable(char)[], bool) ()
#15 0x0000000000599962 in dstep.translator.Translator.Translator.translateFunctionDecl(dstep.translator.Output.Output, clang.Cursor.Cursor, clang.Cursor.Cursor) ()
#16 0x0000000000598bbd in dstep.translator.Translator.Translator.translate(dstep.translator.Output.Output, clang.Cursor.Cursor, clang.Cursor.Cursor) ()
#17 0x00000000005986aa in dstep.translator.Translator.Translator.translateInGlobalScope(dstep.translator.Output.Output, clang.Cursor.Cursor, clang.Cursor.Cursor) ()
#18 0x0000000000598578 in dstep.translator.Translator.Translator.translateCursors().__foreachbody1(ref clang.Cursor.Cursor, ref clang.Cursor.Cursor) ()
#19 0x000000000055c9d8 in clang.Visitor.InOrderVisitor.opApply(int(ref clang.Cursor.Cursor, ref clang.Cursor.Cursor) delegate).__foreachbody3(ref clang.Cursor.Cursor, ref clang.Cursor.Cursor) ()
#20 0x000000000055c41c in clang.Visitor.Visitor.visitorFunction(clang.c.Index.CXCursor, clang.c.Index.CXCursor, void*) ()
#21 0x00007f05b40fe210 in clang::cxcursor::CursorVisitor::Visit(CXCursor, bool) () from /usr/lib64/libclang.so.39
#22 0x00007f05b4100460 in clang::cxcursor::CursorVisitor::handleDeclForVisitation(clang::Decl const*) () from /usr/lib64/libclang.so.39
#23 0x00007f05b4100514 in clang::cxcursor::CursorVisitor::VisitDeclContext(clang::DeclContext*) () from /usr/lib64/libclang.so.39
#24 0x00007f05b40fed92 in clang::cxcursor::CursorVisitor::VisitChildren(CXCursor) () from /usr/lib64/libclang.so.39
#25 0x00007f05b4109e41 in clang_visitChildren () from /usr/lib64/libclang.so.39
#26 0x000000000055c6d9 in clang.Visitor.InOrderVisitor.opApply(int(ref clang.Cursor.Cursor, ref clang.Cursor.Cursor) delegate) ()
#27 0x000000000059808e in dstep.translator.Translator.Translator.translateCursors() ()
#28 0x00000000005985a3 in dstep.translator.Translator.Translator.translateToString() ()
#29 0x0000000000597f02 in dstep.translator.Translator.Translator.translate() ()
#30 0x000000000055f0fe in dstep.driver.Application.ParseFile.startConversion() ()
#31 0x000000000055ebac in dstep.driver.Application.Application.startParsingFile(const(dstep.Configuration.Configuration), immutable(char)[], immutable(char)[]) ()
#32 0x000000000055f688 in std.parallelism.Task!(dstep.driver.Application.Application.startParsingFile(const(dstep.Configuration.Configuration), immutable(char)[], immutable(char)[]), dstep.Configu
ration.Configuration, immutable(char)[], immutable(char)[]).Task.impl(void*) ()
#33 0x00007f05b3c25dbb in std.parallelism.AbstractTask.job() () from /usr/lib64/libphobos2.so.0.71
#34 0x00007f05b3c25f78 in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) () from /usr/lib64/libphobos2.so.0.71
#35 0x00007f05b3c2602f in std.parallelism.TaskPool.doSingleTask() () from /usr/lib64/libphobos2.so.0.71
#36 0x00007f05b3d018f4 in core.thread.Thread.run() () from /usr/lib64/libphobos2.so.0.71
#37 0x00007f05b3d00aaf in thread_entryPoint () from /usr/lib64/libphobos2.so.0.71
#38 0x00007f05b36b4444 in start_thread (arg=0x7f05a5744700) at pthread_create.c:333
#39 0x00007f05b2cf192d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Using a debug-build I get the following assertion:

dstep: an unknown error occurred: core.exception.AssertError@/home/franz/src/dstep/dstep/translator/Type.d(501): Unhandled type kind cast(CXTypeKind)119
----------------
??:? _d_assert_msg [0x7c59e0b6]
/home/franz/src/dstep/dstep/translator/Type.d:501 immutable(char)[] dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.c.Index.CXTypeKind, bool) [0x5a657c]
/home/franz/src/dstep/dstep/translator/Type.d:94 immutable(char)[] dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.Cursor.Cursor, clang.Type.Type, bool, bool) [0x5a51de
]
/home/franz/src/dstep/dstep/translator/Type.d:363 immutable(char)[] dstep.translator.Type.translatePointer(dstep.translator.Context.Context, clang.Cursor.Cursor, clang.Type.Type, bool, bool) [0x5a
5dd9]
/home/franz/src/dstep/dstep/translator/Type.d:57 immutable(char)[] dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.Cursor.Cursor, clang.Type.Type, bool, bool) [0x5a4fff
]
/home/franz/src/dstep/dstep/translator/Type.d:24 immutable(char)[] dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.Cursor.Cursor, bool, bool) [0x5a4d63]
/home/franz/src/dstep/dstep/translator/Translator.d:348 int dstep.translator.Translator.translateFunction(dstep.translator.Output.Output, dstep.translator.Context.Context, clang.Cursor.FunctionCur
sor, immutable(char)[], bool).__foreachbody7(ref clang.Cursor.ParamCursor) [0x5a4308]
/home/franz/src/dstep/clang/Visitor.d:255 _D5clang7Visitor12ParamVisitor7opApplyMFDFKS5clang6Cursor11ParamCursorZiZ14__foreachbody2MFKS5clang6Cursor6CursorKS5clang6Cursor6CursorZi [0x572e54]
/home/franz/src/dstep/clang/Visitor.d:66 extern (C) clang.c.Index.CXChildVisitResult clang.Visitor.Visitor.visitorFunction(clang.c.Index.CXCursor, clang.c.Index.CXCursor, void*) [0x572450]
??:? [0x7c99d20f]
core.exception.AssertError@/home/franz/src/dstep/dstep/translator/Type.d(501): Unhandled type kind cast(CXTypeKind)119
----------------
??:? _d_assert_msg [0x7c59e0b6]
/home/franz/src/dstep/dstep/translator/Type.d:501 immutable(char)[] dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.c.Index.CXTypeKind, bool) [0x5a657c]
/home/franz/src/dstep/dstep/translator/Type.d:94 immutable(char)[] dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.Cursor.Cursor, clang.Type.Type, bool, bool) [0x5a51de
]
/home/franz/src/dstep/dstep/translator/Type.d:363 immutable(char)[] dstep.translator.Type.translatePointer(dstep.translator.Context.Context, clang.Cursor.Cursor, clang.Type.Type, bool, bool) [0x5a
5dd9]
/home/franz/src/dstep/dstep/translator/Type.d:57 immutable(char)[] dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.Cursor.Cursor, clang.Type.Type, bool, bool) [0x5a4fff
]
/home/franz/src/dstep/dstep/translator/Type.d:24 immutable(char)[] dstep.translator.Type.translateType(dstep.translator.Context.Context, clang.Cursor.Cursor, bool, bool) [0x5a4d63]
/home/franz/src/dstep/dstep/translator/Translator.d:348 int dstep.translator.Translator.translateFunction(dstep.translator.Output.Output, dstep.translator.Context.Context, clang.Cursor.FunctionCur
sor, immutable(char)[], bool).__foreachbody7(ref clang.Cursor.ParamCursor) [0x5a4308]
/home/franz/src/dstep/clang/Visitor.d:255 _D5clang7Visitor12ParamVisitor7opApplyMFDFKS5clang6Cursor11ParamCursorZiZ14__foreachbody2MFKS5clang6Cursor6CursorKS5clang6Cursor6CursorZi [0x572e54]
/home/franz/src/dstep/clang/Visitor.d:66 extern (C) clang.c.Index.CXChildVisitResult clang.Visitor.Visitor.visitorFunction(clang.c.Index.CXCursor, clang.c.Index.CXCursor, void*) [0x572450]
??:? [0x7c99d20f]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions