[Issue 16612] New: Bug in std.regex? in dmd? Segmentation fault

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Oct 13 22:37:34 PDT 2016


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

          Issue ID: 16612
           Summary: Bug in std.regex? in dmd? Segmentation fault
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dpyurchenko at admomsk.ru

# cat issue.d
import std.regex;
import std.stdio;

void main()
{
    auto r = regex(r"[0-9]");
    foreach(line; stdin.byLine)
    {
        try
        {
            auto m = matchAll(line, r);
        }
        catch(Exception e)
            continue;
    }
}

# dmd --version
DMD64 D Compiler v2.071.2
Copyright (c) 1999-2015 by Digital Mars written by Walter Bright

# dmd issue.d
# file issue
issue: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked,
interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32,
BuildID[sha1]=aca6ea48b10e8b41a49510e3a2348811347f7246, not stripped
# ldd issue
        linux-vdso.so.1 (0x00007ffe8e9e5000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f1f02b89000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1f02888000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f1f02680000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1f0247c000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f1f02266000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1f01ebb000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1f02da6000)
# time ./issue < /dev/urandom
Segmentation fault

real    0m4.389s
user    0m1.716s
sys     0m2.664s

# ldc2 --version
LDC - the LLVM D compiler (1.1.0-beta3):
  based on DMD v2.071.2 and LLVM 3.9.0
  built with LDC - the LLVM D compiler (1.1.0-beta3)
  Default target: x86_64-unknown-linux-gnu
  Host CPU: penryn
  http://dlang.org - http://wiki.dlang.org/LDC

  Registered Targets:
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64
# ldc2 issue.d
# file issue
issue: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked,
interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32,
BuildID[sha1]=f7bba9ffa9fe9ed20514248f9b86bbb3b46115f4, not stripped
# ldd issue
        linux-vdso.so.1 (0x00007ffd867e6000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f798f2c6000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f798f0c2000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f798eea5000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f798eba4000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f798e98e000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f798e5e3000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f798f4ce000)
# time ./issue < /dev/urandom
^C

real    6m28.451s
user    2m3.708s
sys     4m24.472s
# uname -a
Linux host 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64
GNU/Linux

--


More information about the Digitalmars-d-bugs mailing list