[Issue 17102] New: std.write.file generates a segmentation fault when the file name is a string with a default value

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 16 19:07:57 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17102

          Issue ID: 17102
           Summary: std.write.file generates a segmentation fault when the
                    file name is a string with a default value
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: donte5379 at comcast.net

The following program generates a segmentation fault with rdmd or compiling
with dmd and running the resulting executable. The data is a valid string and
the file name is a string that is left at the default value.

#!/usr/local/bin/rdmd

import std.stdio;
import std.file;


void main (string[] args) {

  string the_text = "File with bad name";    // some data to write
  string file_name;                          // set to default string value
  std.file.write(file_name, the_text);

}

% dmd --version
DMD64 D Compiler v2.072.2
Copyright (c) 1999-2016 by Digital Mars written by Walter Bright
%

OSX 10.11.5 (15F34)

--


More information about the Digitalmars-d-bugs mailing list