[Issue 13417] segmentation fault when deduce template type

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 5 09:31:12 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13417

--- Comment #3 from hsteoh at quickfur.ath.cx ---
I managed to reduce the test case a little more:
------
struct Vector(string x, E) { }
void someFunc(E)(Vector!("", E)) { }
void main() {
        someFunc(Vector!("", float)());
}
------

Here's the compiler stacktrace under gdb:
------
Program received signal SIGSEGV, Segmentation fault.
0x000000000047670a in ctfeInterpret(Expression*) ()
(gdb) bt
#0  0x000000000047670a in ctfeInterpret(Expression*) ()
#1  0x000000000045793a in deduceType(RootObject*, Scope*, Type*,
Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned
long)::DeduceType::visit(TypeInstance*) ()
#2  0x0000000000456734 in deduceType(RootObject*, Scope*, Type*,
Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long)
()
#3  0x0000000000457307 in deduceType(RootObject*, Scope*, Type*,
Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned
long)::DeduceType::visit(TypeStruct*) ()
#4  0x000000000045a93d in deduceType(RootObject*, Scope*, Type*,
Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned
long)::DeduceType::visit(Expression*) ()
#5  0x0000000000456717 in deduceType(RootObject*, Scope*, Type*,
Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long)
()
#6  0x0000000000459238 in
TemplateDeclaration::deduceFunctionTemplateMatch(TemplateInstance*, Scope*,
FuncDeclaration*&, Type*, Array<Expression*>*) ()
#7  0x00000000004635ab in functionResolve(Match*, Dsymbol*, Loc, Scope*,
Array<RootObject*>*, Type*, Array<Expression*>*)::ParamDeduce::fp(void*,
Dsymbol*) ()
#8  0x00000000004f9d93 in overloadApply(Dsymbol*, void*, int (*)(void*,
Dsymbol*)) ()
#9  0x0000000000462ebf in functionResolve(Match*, Dsymbol*, Loc, Scope*,
Array<RootObject*>*, Type*, Array<Expression*>*) ()
#10 0x00000000004faabd in resolveFuncCall(Loc, Scope*, Dsymbol*,
Array<RootObject*>*, Type*, Array<Expression*>*, int) ()
#11 0x00000000004e1839 in CallExp::semantic(Scope*) [clone .part.122] ()
#12 0x0000000000441d0b in ExpStatement::semantic(Scope*) ()
#13 0x000000000044683f in CompoundStatement::semantic(Scope*) ()
#14 0x00000000004fc94a in FuncDeclaration::semantic3(Scope*) ()
#15 0x0000000000407d48 in Module::semantic3() ()
#16 0x0000000000405484 in tryMain(unsigned long, char const**) ()
#17 0x00007ffff70b5eed in __libc_start_main () from
/lib/x86_64-linux-gnu/libc.so.6
#18 0x0000000000402c75 in _start ()
------

--


More information about the Digitalmars-d-bugs mailing list