www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14630] New: Std.algorithm splitter segfault on large file

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

          Issue ID: 14630
           Summary: Std.algorithm splitter segfault on large file with
                    mmfile, seems GC related.
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: sprw121 gmail.com

Created attachment 1524
  --> https://issues.dlang.org/attachment.cgi?id=1524&action=edit
Code to generate a large file that will segfault std.algorithm.splitter.

I discovered that std.algorithm's splitter function segfaults when called over
casted memory mapped filed.

Interestingly I found this when reenabling the GC on an application we've been
running for a long time with GC.disable(). The bug does not occur with
GC.disable, but with GC enabled it segfaults everytime.

Linked is a test program that segfaults when run in a Ubuntu 12.04 VM on a
mid-2014 MBR.

Seems transient when compiled with -g flag. Seems to only segfault on large
files.

http://dpaste.dzfl.pl/96e898051fb2

Backtrace from core dump:



std.algorithm.searching.__T4findVAyaa6_61203d3d2062TAyaTaZ.find() ()

std.algorithm.searching.__T4findVAyaa6_61203d3d2062TAyaTaZ.find() ()

std.algorithm.iteration.__T8splitterVAyaa6_61203d3d2062TAyaTaZ.splitter() ()









--
May 28 2015