open a range of files - segfault

Stephan Schiffels stephan_schiffels at mac.com
Wed May 22 14:26:02 PDT 2013


On Wednesday, 22 May 2013 at 11:09:49 UTC, John Colvin wrote:
> On Wednesday, 22 May 2013 at 11:07:39 UTC, bearophile wrote:
>> Stephan Schiffels:
>>
>>> this code crashes with a segfault. I need help to understand 
>>> what might be wrong with it.
>>>
>>> import std.array;
>>> import std.algorithm;
>>>
>>> void main() {
>>> auto names = ["file1.txt", "file2.txt", "file3.txt"];  // let 
>>> these files exist
>>> auto files = names.map!(f => File(f, "r"))().array();
>>> }
>>
>> If I use the latest 2.063beta5 compiler, and I also import 
>> std.stdio, then I see no crash on Windows32.
>>
>> Bye,
>> bearophile
>
> With git master on linux x64 I get a segfault, see my other
> comment.

OK, thanks for confirming. I updated to the latest git master and 
still get a segfault. I'll file a bug report.

Stephan



More information about the Digitalmars-d-learn mailing list