open a range of files - segfault

John Colvin john.loughran.colvin at gmail.com
Wed May 22 04:08:42 PDT 2013


On Wednesday, 22 May 2013 at 08:38:14 UTC, Stephan Schiffels 
wrote:
> Hi,
>
> 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();
> }
>
> Thanks,
>
> Stephan

A quick gdb run shows that it's segfaulting at the exit of the 
program, when the GC runs its final full collection.


More information about the Digitalmars-d-learn mailing list