Fix parse error in mprof-report image load event. (#43217)
authormonojenkins <jo.shields+jenkins@xamarin.com>
Tue, 13 Oct 2020 10:57:02 +0000 (06:57 -0400)
committerGitHub <noreply@github.com>
Tue, 13 Oct 2020 10:57:02 +0000 (12:57 +0200)
Version 16 of log profiler data format added mvid to image load event and mprof-report was never aligned to handle that since it assumed all events for TYPE_IMAGE included mvid.

Fix makes sure to correctly read pass mvid only for event actually including the field.

Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
src/mono/mono/profiler/mprof-report.c

index a02c708..ed027f5 100644 (file)
@@ -2430,7 +2430,7 @@ decode_buffer (ProfContext *ctx)
                                        add_image (ptr_base + ptrdiff, (char*)p);
                                while (*p) p++;
                                p++;
-                               if (ctx->data_version >= 16) {
+                               if (ctx->data_version >= 16 && subtype == TYPE_END_LOAD) {
                                        while (*p) p++; // mvid
                                        p++;
                                }