-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeInfo_Array incorrectly initialized #19653
Labels
Comments
apz28 commented on 2019-12-31T04:47:50ZTo make it compiles without issue -> Remove the "package.d" from compiling source
Since the modules have object defined such class "XmlAttribute(S = string) : XmlNode!S". The package.d is just an import of all modules with some alias as below. Still not able to dustmite the problem
public import pham.xml_exception;
public import pham.xml_util;
public import pham.xml_buffer;
public import pham.xml_string;
public import pham.xml_entity_table;
public import pham.xml_new;
public import pham.xml_parser;
public import pham.xml_reader;
public import pham.xml_writer;
public import pham.xml_xpath;
/** For utf8 encoded string
*/
alias XmlAttributeA = XmlAttribute!string;
alias XmlCDataA = XmlCData!string;
alias XmlCommentA = XmlComment!string;
...
/** For utf16 encoded string
*/
alias XmlAttributeW = XmlAttribute!wstring;
alias XmlCDataW = XmlCData!wstring;
alias XmlCommentW = XmlComment!wstring;
... |
simen.kjaras commented on 2020-06-23T13:13:52ZThe leaf node in the stack trace is object.TypeInfo_Array.toString(), and looking at that code (https://github.com/dlang/druntime/blob/2cc13ead1e7e535ef8ebd1f600d4ffb508a93f98/src/object.d#L532):
override string toString() const { return value.toString() ~ "[]"; }
This will fail if value is null. Is it null though?
unittest {
auto a = typeid("");
import std.stdio;
writeln(a.toString());
}
> immutable(char)[]
Doesn't look like it.
unittest {
auto a = typeid("");
assert(a.value !is null, "a.value is null!");
}
> [unittest] a.value is null!
Uhm...
It seems something is special cased when handling TypeInfo, so that the code in toString() doesn't run at that point. For whatever reason, this short-circuiting doesn't happen inside DMD, and so it crashes. |
kinke commented on 2020-06-23T17:17:59Z(In reply to Simen Kjaeraas from comment #2)
> The leaf node in the stack trace is object.TypeInfo_Array.toString()
I think that's a wrong lead due to a faulty stacktrace. The interesting bit is
> core.exception.RangeError@dmd\root\array.d(226): Range violation
That comes from an invalid index into a dmd.root.array.Array instance (https://github.com/dlang/dmd/blob/v2.090.0/src/dmd/root/array.d#L226).
The next frame in the stacktrace seems reasonable, pointing to https://github.com/dlang/dmd/blob/v2.090.0/src/dmd/dsymbolsem.d#L3655:
FuncDeclaration fdc = cd.vtbl[vi].isFuncDeclaration();
suggesting an invalid vi index. |
kinke commented on 2020-06-23T17:38:13ZBtw, this issue showing up like this is only possible because the DMD 2.090.0 Windows builds were debug builds, that's why we have enabled bounds checks, debuginfos and even line infos. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
apham reported this on 2019-12-30T15:33:31Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=20471
CC List
Description
The text was updated successfully, but these errors were encountered: