www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7293] New: dmd segfault

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7293

           Summary: dmd segfault
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: jlquinn optonline.net



---
Ubuntu 11.10, x86_64, compiling the following crashes the compiler:

import std.regex;
class C {
  Regex!dchar re;
  auto m = match("", "");
}

jlquinn wyvern:~/src$ ~/dmd2/linux/bin64/dmd -c bug1.d 
Segmentation fault

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7293


Gary Slopsema <gslopsema+dbugzilla gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gslopsema+dbugzilla gmail.c
                   |                            |om



17:43:53 PST ---
Confirmed on Windows 7 x86.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 18 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7293


Stewart Gordon <smjg iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
                 CC|                            |smjg iname.com
           Platform|x86_64                      |All
            Summary|dmd 2.057 segfault          |dmd 2.057 segfault/crash -
                   |                            |std.regex.match(string,
                   |                            |string)
         OS/Version|Linux                       |All



Please remember to:
- assign keywords as appropriate
- make summary lines specific to the bug
- change platform/OS to "All" if you witness it on something different from
what the reporter reported it on.

Even smaller testcase:
-----
import std.regex;
auto m = match("", "");
-----

Crash report (DMD 2.057, Windows Vista 32-bit:
-----
  Problem Event Name:    APPCRASH
  Application Name:    dmd.exe
  Application Version:    0.0.0.0
  Application Timestamp:    00000000
  Fault Module Name:    dmd.exe
  Fault Module Version:    0.0.0.0
  Fault Module Timestamp:    00000000
  Exception Code:    c0000005
  Exception Offset:    0003c6b2
  OS Version:    6.0.6002.2.2.0.768.3
  Locale ID:    2057
  Additional Information 1:    482b
  Additional Information 2:    fe3cbbb77b564d5f0cb2cc6fc75b3c2f
  Additional Information 3:    73f1
  Additional Information 4:    1e2657c1444006182528bd2953dbb394

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7293


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies gmail.com



On win32 I get the following:

DMD v2.058 DEBUG
..\..\phobos\std\regex.d(6278): Error: malloc cannot be interpreted at compile
t
ime, because it has no available source code
..\..\phobos\std\regex.d(6278):        called from here:
enforce(malloc(size),de
legate pure nothrow  safe const(char)[]()
{
return null;
}
)
..\..\phobos\std\regex.d(6449):        called from here:
(RegexMatch!(string,Tho
mpsonMatcher) __ctmp919 =
_D3std5regex50__T10RegexMatchTAyaS273std5regex15Thomps
onMatcherZ10RegexMatch6__initZ;
 , __ctmp919).this(regex(re,""),input)
testx.d(4):        called from here: match("","")

So it might actually be ice_on_invalid code... and also a phobos bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7293


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |
                 CC|                            |bugzilla digitalmars.com
          Component|DMD                         |Phobos



23:26:36 PST ---
I get what yebblies is getting. No dmd seg fault. Changed to Phobos issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 28 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7293


kraybourne <stdin kraybourne.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stdin kraybourne.com



---
Confirm Segmentation fault on OSX 10.7.2 DMD 2.057

Faults
$  echo 'import std.regex; auto m = match("", "");' > bug.d
$  dmd -c -m32 bug.d
Segmentation fault: 11
$  dmd -c -m64 bug.d
Segmentation fault: 11
$  _


Works
$  echo 'import std.regex; void main(){ auto m = match("", ""); }' > bug.d
$  dmd -c -m32 bug.d
$  dmd -c -m64 bug.d
$  _

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7293


Stewart Gordon <smjg iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
          Component|Phobos                      |DMD




 I get what yebblies is getting.
On what DMD version? Note that yebblies is using a version that isn't even released yet.
 No dmd seg fault. Changed to Phobos issue.
So far, four of us have confirmed that the compiler IS segfaulting. This is definitely a bug in the compiler. It may have gone away by itself in 2.058, but this doesn't change the fact that the bug is there in 2.057. If the segfault has been fixed in 2.058, then mark it as such. If there is bad code in Phobos, this is a separate bug from the fact that the code crashes DMD. As such, it warrants a separate bug report. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 29 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7293


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



10:38:32 PST ---

 It may have gone away by itself in 2.058, but this doesn't change the fact that
 the bug is there in 2.057.  If the segfault has been fixed in 2.058, then mark
 it as such.
The usual practice is to mark things as fixed if they are fixed in the most recent github build, which naturally will be ahead of the latest release. I mark as "worksforme" things that were (apparently) recently fixed as part of another bug fix, and I don't have a specific commit to log what did the fix. In other words, this was an unrecognized duplicate of another bug. Which bug it was, I do not know, nor do I wish to spend a couple hours figuring out which one it was. Please reopen if a seg fault can be produced on this with the latest github version. I cannot reproduce a seg fault. I agree that if this is a phobos bug, it should go under a separate issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 29 2012