Thread overview
[Issue 13417] segmentation fault when deduce template type
[Issue 13417] [REG2.066] segmentation fault when deduce template type
Sep 06, 2014
Kenji Hara
September 05, 2014
https://issues.dlang.org/show_bug.cgi?id=13417

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx

--- Comment #1 from hsteoh@quickfur.ath.cx ---
Hmm. What's an "alias string" supposed to do? I've never seen that before. Usually for passing compile-time strings, we just write "string". What did you wish to accomplish with "alias string"?

--
September 05, 2014
https://issues.dlang.org/show_bug.cgi?id=13417

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice

--
September 05, 2014
https://issues.dlang.org/show_bug.cgi?id=13417

--- Comment #2 from hsteoh@quickfur.ath.cx ---
Actually, that doesn't appear to be related to the problem. Removing "alias" still causes the compiler to crash...

--
September 05, 2014
https://issues.dlang.org/show_bug.cgi?id=13417

--- Comment #3 from hsteoh@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 ()
------

--
September 05, 2014
https://issues.dlang.org/show_bug.cgi?id=13417

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |regression

--- Comment #4 from hsteoh@quickfur.ath.cx ---
This is a regression caused by dmd commit b16f80834e4f9fa9bd62320f132f77fb22fc65b6 (https://github.com/D-Programming-Language/dmd/pull/3824).

--
September 06, 2014
https://issues.dlang.org/show_bug.cgi?id=13417

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
           Hardware|x86_64                      |All
            Summary|segmentation fault when     |[REG2.066] segmentation
                   |deduce template type        |fault when deduce template
                   |                            |type
                 OS|Linux                       |All

--- Comment #5 from Kenji Hara <k.hara.pg@gmail.com> ---
https://github.com/D-Programming-Language/dmd/pull/3950

--
September 07, 2014
https://issues.dlang.org/show_bug.cgi?id=13417

--- Comment #6 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d99288c36f96c5f837ccc73e7c73ad7087d5b4b2 fix Issue 13417 - segmentation fault when deduce template type

https://github.com/D-Programming-Language/dmd/commit/859b7dd5c282175b10b566ad16e6a08c354a4fd8 Merge pull request #3950 from 9rnsr/fix13417

[REG2.066] Issue 13417 - segmentation fault when deduce template type

--
September 07, 2014
https://issues.dlang.org/show_bug.cgi?id=13417

--- Comment #7 from github-bugzilla@puremagic.com ---
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/37b15528013b3ed80a6a7cee880a8469ab95315f Merge pull request #3950 from 9rnsr/fix13417

[REG2.066] Issue 13417 - segmentation fault when deduce template type

--