http://d.puremagic.com/issues/show_bug.cgi?id=5822

           Summary: Segfault when adding File to an Associative array
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: jsan...@gmail.com


--- Comment #0 from Jose Garcia <jsan...@gmail.com> 2011-04-08 13:55:15 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to