Bug 8514 – dmd generate bug that segfault in very weird situation.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2012-08-06T13:40:00Z
Last change time
2012-12-27T07:55:21Z
Assigned to
nobody
Creator
deadalnix
Comments
Comment #0 by deadalnix — 2012-08-06T13:40:13Z
A sample code :
module a.main;
class A {
A[] a;
}
class B {
A foo(A a) {
return a;
}
}
import std.algorithm;
import std.array;
auto bar(A a) {
auto b = new B;
a.a.map!(s => b.foo(s)).array;
}
void main() {
auto a1 = new A;
auto a2 = new A;
a1.a = [a2];
bar(a1);
}
module b.b;
import std.string;
Linking both is important, as well as importing std.string . The usage of map require the delegate to be templated one.
Comment #1 by maxim — 2012-10-26T11:45:18Z
*** Issue 8506 has been marked as a duplicate of this issue. ***
Comment #2 by maxim — 2012-10-26T11:46:52Z
Seems to be the same as 8854 and 8832.
Comment #3 by braddr — 2012-10-26T12:39:47Z
Would someone care to throw this at dustmite to reduce it? A smaller test case will be required for the test suite and would help make it easier to debug.
Comment #4 by maxim — 2012-10-26T13:46:25Z
(In reply to comment #3)
> Would someone care to throw this at dustmite to reduce it? A smaller test case
> will be required for the test suite and would help make it easier to debug.
Filed new 8899 because the topic is large and summarizes information from other issues. Hope it helps.
Comment #5 by deadalnix — 2012-10-27T15:55:29Z
(In reply to comment #3)
> Would someone care to throw this at dustmite to reduce it? A smaller test case
> will be required for the test suite and would help make it easier to debug.
It is dustmited already.