D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7031 - Stack overflow with immutable recursive struct
Summary: Stack overflow with immutable recursive struct
Status: RESOLVED DUPLICATE of issue 7127
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-29 13:02 UTC by Trass3r
Modified: 2015-06-09 05:11 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Trass3r 2011-11-29 13:02:03 UTC
immutable(ReflectionInfo)* reflection;

struct ReflectionInfo
{
	const(ReflectionInfo)[] objects;
}

$ gdb --args dmd -g test.d
Comment 1 Trass3r 2011-11-29 13:03:59 UTC
Another interesting testcase:

class ApiProvider
{
	void _getCsrfInfo() {} // comment this out and it suddenly works
	immutable(ReflectionInfo)* reflection;
}

struct ReflectionInfo
{
	const(ReflectionInfo)[] objects;
}
Comment 2 Trass3r 2011-11-29 13:06:43 UTC
Maybe related to http://d.puremagic.com/issues/show_bug.cgi?id=5533
Recursion is in dwarf_typidx:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000493788 in dwarf_typidx (t=Cannot access memory at address 0x7fffff7feed8
) at backend/dwarf.c:1465
1465	{   unsigned idx = 0;
(gdb) bt
#0  0x0000000000493788 in dwarf_typidx (t=Cannot access memory at address 0x7fffff7feed8
) at backend/dwarf.c:1465
#1  0x0000000000493817 in dwarf_typidx (t=0x8c4950) at backend/dwarf.c:1574
#2  0x0000000000493ae2 in dwarf_typidx (t=0x8c4978) at backend/dwarf.c:1628
#3  0x0000000000494950 in dwarf_typidx (t=0x91f2c8) at backend/dwarf.c:1944
#4  0x0000000000493817 in dwarf_typidx (t=0x8c4950) at backend/dwarf.c:1574
#5  0x0000000000493ae2 in dwarf_typidx (t=0x8c4978) at backend/dwarf.c:1628
#6  0x0000000000494950 in dwarf_typidx (t=0x91f2a0) at backend/dwarf.c:1944
#7  0x0000000000493817 in dwarf_typidx (t=0x8c4950) at backend/dwarf.c:1574
Comment 3 David Nadlinger 2011-12-19 10:08:35 UTC

*** This issue has been marked as a duplicate of issue 7127 ***