[Issue 14630] New: Std.algorithm splitter segfault on large file with mmfile, seems GC related.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu May 28 23:30:46 PDT 2015


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 at puremagic.com
          Reporter: sprw121 at 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:

#0  memchr () at ../sysdeps/x86_64/memchr.S:59
#1  0x000000000045dc0f in
std.algorithm.searching.__T4findVAyaa6_61203d3d2062TAyaTaZ.find() ()
#2  0x000000000045db86 in
std.algorithm.searching.__T4findVAyaa6_61203d3d2062TAyaTaZ.find() ()
#3  0x000000000045d051 in
std.algorithm.iteration.__T8splitterVAyaa6_61203d3d2062TAyaTaZ.splitter() ()
#4  0x000000000045a622 in gen_map.file_to_map() ()
#5  0x000000000045a7b3 in D main ()
#6  0x0000000000463abb in rt.dmain2._d_run_main() ()
#7  0x0000000000463a0e in rt.dmain2._d_run_main() ()
#8  0x0000000000463a74 in rt.dmain2._d_run_main() ()
#9  0x0000000000463a0e in rt.dmain2._d_run_main() ()
#10 0x0000000000463988 in _d_run_main ()
#11 0x000000000045f38f in main ()

--


More information about the Digitalmars-d-bugs mailing list