D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7323 - ICE(glue.c): with json.d
Summary: ICE(glue.c): with json.d
Status: RESOLVED DUPLICATE of issue 2962
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 critical
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2012-01-19 19:36 UTC by Andrej Mitrovic
Modified: 2012-02-03 02:25 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2012-01-19 19:36:52 UTC
Two files:

test.d:
import std.file;
import jsonx;

void main() {
    jsonDecode("bla");
}

jsonx.d:
import std.conv;
import std.variant;
T jsonDecode(T = Variant, R)(R input) {
    auto val = jsonDecode_impl!T(input);
    return val;
}

/* Decode anything -> Variant */
Variant jsonDecode_impl(T : Variant, R)(ref R input) {
    Variant v;

        v = jsonDecode_impl!real(input);
    return v;
}

/* Decode JSON number -> D number */
T jsonDecode_impl(T, R)(ref R input) {
    try        return parse!T(input);
catch(ConvException e)         throw new JsonException("ConvException: " ~ e.msg);
}

class JsonException : Exception {
    this(string s) {
        super(s);
    }
}

dmd test.d json.x:
D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2089): Error: function std.conv.parse!(real,string).parse compiler error, parameter 'p', bugzilla 2962?
Assertion failure: '0' on line 709 in file 'glue.c'

I get the same ICE and error using both d-json from http://github.com/gianm/d-json.git and Robert Jacques's new json library. Combine this with std.json's runtime access violations on seemingly correct code and I would almost label this as a blocker.
Comment 1 Andrej Mitrovic 2012-01-19 19:38:18 UTC
Edit: Sorry for the missing module declarations that were left out.
Comment 2 Andrej Mitrovic 2012-01-19 19:38:58 UTC
(In reply to comment #1)
> Edit: Sorry for the missing module declarations that were left out.

And `dmd test.d json.x` should be `dmd test.d json.d`
Comment 3 Andrej Mitrovic 2012-02-02 12:31:54 UTC
According to http://www.digitalmars.com/d/archives/digitalmars/D/learn/Any_working_JSON_library_for_D2_27727.html this is related or dup of Issue 2962.
Comment 4 Don 2012-02-03 02:25:32 UTC
Yes, most of the ICE(glue.c) bugs are duplicates of one another. AFAIK there are only 3 independent ones, and of those, one is a simple variation of the other.

*** This issue has been marked as a duplicate of issue 2962 ***