Thread overview
[Issue 15138] [REG2.068.2] ICE with basic use of stdx.data.json
[Issue 15138] ICE with basic use of stdx.data.json
Oct 02, 2015
Marc Schütz
Oct 03, 2015
Marc Schütz
Oct 03, 2015
Martin Nowak
Oct 05, 2015
Kenji Hara
Oct 05, 2015
Kenji Hara
October 02, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

--- Comment #1 from monkeyworks12@hotmail.com ---
This is using DMD 2.068.2. The code reportedly works with 2.068.1.

--
October 02, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

Marc Schütz <schuetzm@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schuetzm@gmx.net

--- Comment #2 from Marc Schütz <schuetzm@gmx.net> ---
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.

--
October 02, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

--- Comment #3 from monkeyworks12@hotmail.com ---
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.

--
October 03, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

Marc Schütz <schuetzm@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|Windows                     |All

--- Comment #4 from Marc Schütz <schuetzm@gmx.net> ---
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
core.exception.AssertError@dtemplate.d(6389): Assertion failure

Digger points to this PR: https://github.com/D-Programming-Language/dmd/pull/5055

--
October 03, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@dawg.eu

--- Comment #5 from Martin Nowak <code@dawg.eu> ---
Can anyone try to reduce this using dustmite?

--
October 05, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All

--- Comment #6 from Kenji Hara <k.hara.pg@gmail.com> ---
(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
core.exception.AssertError@dtemplate.d(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

--
October 05, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, pull
            Summary|ICE with basic use of       |[REG2.068.2] ICE with basic
                   |stdx.data.json              |use of stdx.data.json

--- Comment #7 from Kenji Hara <k.hara.pg@gmail.com> ---
https://github.com/D-Programming-Language/dmd/pull/5164

--
October 06, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

github-bugzilla@puremagic.com changed:

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

--
October 06, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

--- Comment #8 from github-bugzilla@puremagic.com ---
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

--
October 07, 2015
https://issues.dlang.org/show_bug.cgi?id=15138

--- Comment #9 from github-bugzilla@puremagic.com ---
Commits pushed to master 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

--