← Back to index
|
Original Bugzilla link
Bug 5822 – Segfault when adding File to an Associative array
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-04-08T13:55:00Z
Last change time
2013-09-22T10:47:51Z
Assigned to
nobody
Creator
jsancio
Comments
Comment #0
by jsancio — 2011-04-08T13:55:15Z
The following calls segfault at the point when File is added to the associative array 'moreFiles'. import std.stdio; unittest { auto file = File("deleteme", "w"); File[] files = new File[0]; files ~= file; assert(files.length == 1); File[int] moreFiles; moreFiles[1] = File("deletemetoo", "w"); } void main() {} Stack trace: $ dmd file_bug.d -unittest && ./file_bug ./file_bug(_D4core7runtime18runModuleUnitTestsUZb19unittestSegvHandlerUiPS4core3sys5posix6signal9siginfo_tPvZv+0x2c)[0x809a68c] [0x4ba40c] ./file_bug(_D3std5stdio4File8opAssignMFS3std5stdio4FileZv+0x17)[0x8098077] ./file_bug(_D8file_bug11__unittest1FZv+0xca)[0x809441e] ./file_bug(_D8file_bug9__modtestFZv+0x8)[0x809444c] ./file_bug(_D4core7runtime18runModuleUnitTestsUZb16__foreachbody247MFKPS6object10ModuleInfoZi+0x24)[0x809a6ec] ./file_bug(_D6object10ModuleInfo7opApplyFMDFKPS6object10ModuleInfoZiZi+0x46)[0x8096522] ./file_bug(runModuleUnitTests+0x87)[0x809a607] ./file_bug(_D2rt6dmain24mainUiPPaZi6runAllMFZv+0x20)[0x8096f48] ./file_bug(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x20)[0x8096ea8] ./file_bug(main+0x94)[0x8096e54] /lib/libc.so.6(__libc_start_main+0xe7)[0xc3ace7] ./file_bug[0x80942a1] Segmentation fault
Comment #1
by k.hara.pg — 2013-09-22T10:47:51Z
*** This issue has been marked as a duplicate of issue 6178 ***