digitalmars.D.learn - problem while updating to 2.052
- =?ISO-8859-1?Q?Christian_K=F6stlin?= (24/24) Feb 19 2011 hi .. i have a small library for combinatorial parsing.
- bearophile (4/7) Feb 19 2011 It may be a bug. Are you able to create a minimal test program that late...
- =?ISO-8859-1?Q?Christian_K=F6stlin?= (71/78) Feb 19 2011 Hi,
- novice2 (3/4) Feb 20 2011 i am sorry for offtopic, but
- Jonathan M Davis (13/18) Feb 20 2011 1. It doesn't work on Windows yet, I don't believe. So, for now, you're ...
- novice2 (2/2) Feb 20 2011 Jonathan M Davis, thank you for explanation,
hi .. i have a small library for combinatorial parsing. when i updated to version 2.052 of dmd (tested on os x) i got an exception from variant.d:279 (target must be non-null). i fixed the problem with the following diff: ParseResult!(T) parse(T[] s) { - auto results = appender!(Variant[])(); + Variant[] results; auto rest = s; while (true) { auto res = fToRepeat.parse(rest); if (res.success) { rest = res.rest; - results.put(res.results); + results = results ~ res.results; } else { break; } } - return transform(ParseResult!(T).ok(rest, results.data)); + return transform(ParseResult!(T).ok(rest, results)); } what did i do wrong and why could it work with an older version of dmd2? thanks in advance christian koestlin
Feb 19 2011
Christian K.:hi .. i have a small library for combinatorial parsing. when i updated to version 2.052 of dmd (tested on os x) i got an exception from variant.d:279 (target must be non-null).It may be a bug. Are you able to create a minimal test program that later will be fit for bugzilla? Bye, bearophile
Feb 19 2011
On 2/19/11 22:06 , bearophile wrote:Christian K.:Hi, unfortunately not ... I looked several minutes at the stacktrace (would it help if I send you the whole project), and could not figure out what the problem was. then I tried to change the program (see the diff) and it worked. this is the stacktrace of the exception if it helps: core.exception.AssertError /Users/gizmo/.homebrew/Cellar/dmdtwo/2.052/src/phobos std/variant.d(279): target must be non-null ---------------- 5 compiler 0x000340b5 onAssertErrorMsg + 73 6 compiler 0x0003dfb2 _d_assert_msg + 26 7 compiler 0x0000ea76 int std.variant.VariantN!(32).VariantN.handler!(astelements.MessageInfo).handler(std.variant.VariantN (32).VariantN.OpID, ubyte[32]*, void*).bool tryPutting(astelements.MessageInfo*, TypeInfo, void*) + 130 8 compiler 0x0000e75c int std.variant.VariantN!(32).VariantN.handler!(astelements.MessageInfo).handler(std.variant.VariantN (32).VariantN.OpID, ubyte[32]*, void*) + 200 9 compiler 0x000152a2 std.variant.VariantN!(32).VariantN std.variant.VariantN!(32).VariantN.opAssign!(std.variant.VariantN!(32).VariantN).opAssign(std.variant.Var antN!(32).VariantN) + 78 10 compiler 0x0001613a void std.array.Appender!(std.variant.VariantN!(32).VariantN[]).Appender.put!(std.variant.VariantN!(32).VariantN).put(std.variant.Var antN!(32).VariantN) + 134 11 compiler 0x000161cb void std.array.Appender!(std.variant.VariantN!(32).VariantN[]).Appender.put!(std.variant.VariantN!(32).VariantN[]).put(std.variant.Varia tN!(32).VariantN[]) + 115 12 compiler 0x0000aa8a pc.parser.ParseResult!(immutable(char)).ParseResult pc.parser.Parser!(immutable(char)).Parser.Repetition.parse(immutable(char)[]) + 422 13 compiler 0x0000a369 pc.parser.ParseResult!(immutable(char)).ParseResult pc.parser.Parser!(immutable(char)).Parser.parseAll(immutable(char)[]) + 41 14 compiler 0x000026b6 _Dmain + 446 15 compiler 0x0003e343 extern (C) int rt.dmain2.main(int, char**).void runMain() + 23 16 compiler 0x0003e2ca extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate()) + 38 17 compiler 0x0003e38b extern (C) int rt.dmain2.main(int, char**).void runAll() + 59 18 compiler 0x0003e2ca extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate()) + 38 19 compiler 0x0003e25b main + 179 20 compiler 0x000024ed start + 53 21 ??? 0x00000003 0x0 + 3 regarding types: my debugoutput at the exception showed me, that the appender already has one element of type astelements.PackageInfo and now an array with one element of type astelements.MessageInfo is to be put into the appender. perhaps this can lead to a problem? messageinfo is a struct declared like: struct MessageInfo { string name; FieldInfo[] fieldInfos; EnumDefinition[] enums; MessageInfo[] messages; string thePackage = ""; ... } , packageinfo is even simpler: class PackageInfo { string fName; this(string name) { fName = name; } } thanks in advance christianhi .. i have a small library for combinatorial parsing. when i updated to version 2.052 of dmd (tested on os x) i got an exception from variant.d:279 (target must be non-null).It may be a bug. Are you able to create a minimal test program that later will be fit for bugzilla? Bye, bearophile
Feb 19 2011
Christian Köstlin Wrote:unfortunately not ... I looked several minutes at the stacktrace (wouldi am sorry for offtopic, but how you produce stacktrace? sometime i very want to see it...
Feb 20 2011
On Sunday 20 February 2011 22:11:13 novice2 wrote:Christian K=F6stlin Wrote:1. It doesn't work on Windows yet, I don't believe. So, for now, you're out= of=20 luck. I don't know about Mac OS X. 2. On Linux, any Throwable (be it an Exception or an Error) which escapes m= ain=20 will print a stack trace. IIRC, you also get a stack trace when you conver= t an=20 Exception to a string. Regardless, you need to have linked with -L--export- dynamic to get the function names to work, but that's in the dmd.conf, so y= ou=20 should always be building with it. =2D Jonathan M Davisunfortunately not ... I looked several minutes at the stacktrace (would=20 i am sorry for offtopic, but how you produce stacktrace? sometime i very want to see it...
Feb 20 2011
Jonathan M Davis, thank you for explanation, but i am on windows :(
Feb 20 2011