Bug 15138 – [REG2.068.2] ICE with basic use of stdx.data.json

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-02T15:07:00Z
Last change time
2015-10-07T02:56:33Z
Keywords
ice, pull
Assigned to
nobody
Creator
monkeyworks12

Comments

Comment #0 by monkeyworks12 — 2015-10-02T15:07:57Z
The following code: import stdx.data.json; void main() { string str = `{"a": true, "b": "test"}`; auto v = parseJSONValue(str); // The following line causes the problem in 2.068.2 auto obj = v.get!(JSONValue[string]); } Fails to compile with the following error: Assertion failure: 'minst->isRoot() || minst->rootImports()' on line 8013 in file 'template.c' stdx.data.json can be found here: https://github.com/s-ludwig/std_data_json
Comment #1 by monkeyworks12 — 2015-10-02T15:08:23Z
This is using DMD 2.068.2. The code reportedly works with 2.068.1.
Comment #2 by schuetzm — 2015-10-02T18:56:30Z
Which exact command line and directory layout are you using? I cannot reproduce this currently with any of 2.068.1, 2.068.2 or master.
Comment #3 by monkeyworks12 — 2015-10-02T19:55:10Z
Just basic Windows cmd.exe, using Dub to build the program. My directory layout is the standard Dub layout. A top-level project folder containing dub.json et al., as well as a `source` directory containing app.d with the offending code. Navigating to that folder and typing `dub` to run the build process is enough to produce the error.
Comment #4 by schuetzm — 2015-10-03T13:41:55Z
Thanks, I can reproduce it now. Works in 2.068.1, broken in 2.068.2 and master. dub.sdl: name "aaa" description "A minimal D application." copyright "Copyright © 2015, marc" authors "marc" dependency "std_data_json" version="~>0.17.0" source/app.d: import stdx.data.json; void main() { string str = `{"a": true, "b": "test"}`; auto v = parseJSONValue(str); // The following line causes the problem in 2.068.2 auto obj = v.get!(JSONValue[string]); } # dub test --force [email protected](6389): Assertion failure Digger points to this PR: https://github.com/D-Programming-Language/dmd/pull/5055
Comment #5 by code — 2015-10-03T15:59:13Z
Can anyone try to reduce this using dustmite?
Comment #6 by k.hara.pg — 2015-10-05T15:27:56Z
(In reply to Martin Nowak from comment #5) > Can anyone try to reduce this using dustmite? Reduced case: // app.d import json; void main() { JSONValue v; v.get!JSONValue; } // json.d alias AliasSeq(TL...) = TL; alias FieldNameTuple(T...) = AliasSeq!(); struct TaggedAlgebraic(U) { alias X = FieldNameTuple!(U.tupleof); } void get(T, U)(TaggedAlgebraic!U ta) {} union PayloadUnion { int dummy; } struct JSONValue { alias Payload = TaggedAlgebraic!PayloadUnion; void get(T)() { Payload payload; .get!T(payload); } } // command line: dmd -unittest app.d DMD v2.069 DEBUG [email protected](6385): Assertion failure ---------------- 0x0059CBC7 in _d_assert 0x0045BB98 in TemplateInstance at c:\d2home\dmd2\src\dmd\src\dtemplate.d(6386) 0x005127AD in ToObjFile at c:\d2home\dmd2\src\dmd\src\toobj.c(1138) 0x0045E1B9 in TemplateInstance at c:\d2home\dmd2\src\dmd\src\dtemplate.d(7597) 0x00510A10 in toObjFile at c:\d2home\dmd2\src\dmd\src\toobj.c(1204) 0x005075FB in genObjFile at c:\d2home\dmd2\src\dmd\src\glue.c(385) 0x004ADD86 in tryMain at c:\d2home\dmd2\src\dmd\src\mars.d(1621) 0x004AE1AB in _Dmain at c:\d2home\dmd2\src\dmd\src\mars.d(1695) 0x0059DDBA in D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv 0x0059DD8F in void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() 0x0059DCA7 in _d_run_main 0x004AE4F0 in main 0x005B21BD in mainCRTStartup 0x75A8336A in BaseThreadInitThunk 0x776B9882 in RtlInitializeExceptionChain 0x776B9855 in RtlInitializeExceptionChain
Comment #7 by k.hara.pg — 2015-10-05T16:36:17Z
Comment #8 by github-bugzilla — 2015-10-06T04:44:16Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f223530ec642a28f9152d10273837254e1ab6417 fix Issue 15138 - ICE with basic use of stdx.data.json https://github.com/D-Programming-Language/dmd/commit/e13c2bc2c47ab4e1b0531895fa3c222e7cd0c09c Merge pull request #5164 from 9rnsr/fix15138 [REG2.068.2] Issue 15138 - ICE with basic use of stdx.data.json
Comment #9 by github-bugzilla — 2015-10-07T02:56:33Z