Bug 14710 – VC-built DMD crashes on templated variadic function IFTI

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-06-18T11:57:00Z
Last change time
2017-07-22T12:35:32Z
Keywords
pull
Assigned to
nobody
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2015-06-18T11:57:24Z
////////// test.d ////////// void a(T)(T val, T[] arr...) { } void b() { a("", ""); } //////////////////////////// When DMD is built with dmd_msc.vcxproj (in the Release/x64 configuration), it causes an access violation. This appears to be a regression, introduced in https://github.com/D-Programming-Language/dmd/pull/4535
Comment #1 by dlang-bugzilla — 2015-06-18T11:59:23Z
When built in the Debug/x64 configuration, the compiler produces the following error: test.d(7,3): Error: template test.a cannot deduce function from argument types !()(string, string), candidates are: test.d(1,6): test.a(T)(T val, T[] arr...) However, this error does not occur when DMD is built by DMC, and the code compiles correctly.
Comment #2 by dlang-bugzilla — 2015-06-18T12:09:47Z
Debug/x64 also started failing after dmd PR#4535.
Comment #3 by dlang-bugzilla — 2015-06-18T12:28:44Z
Same with Release/Win32 and Debug/Win32 as with /x64.
Comment #4 by dlang-bugzilla — 2015-06-18T12:42:16Z
The PR in question moved the "new" operator overload to its own .c file, which was added to the makefiles but not the Visual Studio project files. As a result, Visual Studio builds have been using the normal C++ "new" and "delete" operators. Adding newdelete.c to the VC project files caused the bug to disappear. It is thus very likely that there exists a use-after-free bug in DMD, but it does not manifest with the "bump-the-pointer" allocator.
Comment #5 by dlang-bugzilla — 2015-06-18T15:05:55Z
Pull request to make the VS build use the bump-the-pointer allocator: https://github.com/D-Programming-Language/dmd/pull/4535 The use-after-free bug remains, though.
Comment #6 by dlang-bugzilla — 2015-06-18T15:06:32Z
(In reply to Vladimir Panteleev from comment #5) > https://github.com/D-Programming-Language/dmd/pull/4535 Sorry, correct link is: https://github.com/D-Programming-Language/dmd/pull/4751
Comment #7 by github-bugzilla — 2015-06-19T06:36:15Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/7bf83a6ce5d1a83f52ce40b174c8ccfdcd6948a8 fix Issue 14710 - VC-built DMD crashes on templated variadic function IFTI Add newdelete.c to Visual Studio project files https://github.com/D-Programming-Language/dmd/commit/260495940349194b072c5786759ce07c1ee3972c Merge pull request #4751 from CyberShadow/pull-20150618-124347 fix Issue 14710 - VC-built DMD crashes on templated variadic function IFTI
Comment #8 by github-bugzilla — 2015-10-04T18:18:33Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/7bf83a6ce5d1a83f52ce40b174c8ccfdcd6948a8 fix Issue 14710 - VC-built DMD crashes on templated variadic function IFTI https://github.com/D-Programming-Language/dmd/commit/260495940349194b072c5786759ce07c1ee3972c Merge pull request #4751 from CyberShadow/pull-20150618-124347
Comment #9 by github-bugzilla — 2017-07-22T12:35:32Z
Commits pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/7bf83a6ce5d1a83f52ce40b174c8ccfdcd6948a8 fix Issue 14710 - VC-built DMD crashes on templated variadic function IFTI https://github.com/dlang/dmd/commit/260495940349194b072c5786759ce07c1ee3972c Merge pull request #4751 from CyberShadow/pull-20150618-124347