Bug 7293 – dmd 2.057 segfault/crash - std.regex.match(string, string)

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-14T19:43:00Z
Last change time
2012-01-29T10:38:32Z
Keywords
ice-on-invalid-code
Assigned to
nobody
Creator
jlquinn

Comments

Comment #0 by jlquinn — 2012-01-14T19:43:34Z
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
Comment #1 by gslopsema+dbugzilla — 2012-01-18T17:43:53Z
Confirmed on Windows 7 x86.
Comment #2 by smjg — 2012-01-27T05:26:43Z
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
Comment #3 by yebblies — 2012-01-27T08:44:29Z
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.
Comment #4 by bugzilla — 2012-01-28T23:26:36Z
I get what yebblies is getting. No dmd seg fault. Changed to Phobos issue.
Comment #5 by stdin — 2012-01-29T02:43:43Z
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 $ _
Comment #6 by smjg — 2012-01-29T07:24:35Z
(In reply to comment #4) > 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.
Comment #7 by bugzilla — 2012-01-29T10:38:32Z
(In reply to comment #6) > 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.