Assertion at class-accessors.c:31, condition `mono_class_is_ginst (klass)' not met #7095
Comments
Similarly, the following code causes the same assertion failure import clr
import System
help(System.Array[int]) |
@lambdageek does it look familiar? |
Standalone repro - calling using System;
using System.Reflection;
using System.Collections.Generic;
public class Repro {
public static void Main () {
var t = typeof (IEnumerable<>);
var a = new int[] {1, 2, 3};
Console.WriteLine (t.IsAssignableFrom (a.GetType ()));
}
} Actual result:
Expected result (according to .NET Framework):
The non-"array special" codepath in |
Regression test for mono#7095
Don't assert when comparing if an "array special interface" is assignable from an array. The code assumed that the special interface is some sort of generic instance like ``IList`1<string>``, but it could be a generic type definition ``IList`1``. There is a case where we would be obligated to return TRUE: If someone used reflection to get the generic param of ``IList`1`` and then made an array: ``` var i = typeof (IList<>); var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T var a = iparam.MakeArrayType (); // T[] Console.WriteLine (i.IsAssignableFrom (a)); ``` But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check, earlier in mono_class_is_assignable_from. So we can return FALSE here. Fixes mono#7095
Regression test for mono#7095
Don't assert when comparing if an "array special interface" is assignable from an array. The code assumed that the special interface is some sort of generic instance like ``IList`1<string>``, but it could be a generic type definition ``IList`1``. There is a case where we would be obligated to return TRUE: If someone used reflection to get the generic param of ``IList`1`` and then made an array: ``` var i = typeof (IList<>); var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T var a = iparam.MakeArrayType (); // T[] Console.WriteLine (i.IsAssignableFrom (a)); ``` But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check, earlier in mono_class_is_assignable_from. So we can return FALSE here. Fixes mono#7095
Regression test for mono#7095
Don't assert when comparing if an "array special interface" is assignable from an array. The code assumed that the special interface is some sort of generic instance like ``IList`1<string>``, but it could be a generic type definition ``IList`1``. There is a case where we would be obligated to return TRUE: If someone used reflection to get the generic param of ``IList`1`` and then made an array: ``` var i = typeof (IList<>); var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T var a = iparam.MakeArrayType (); // T[] Console.WriteLine (i.IsAssignableFrom (a)); ``` But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check, earlier in mono_class_is_assignable_from. So we can return FALSE here. Fixes mono#7095
[runtime] Don't assert in mono_class_is_assignable_from on iface gtd
Don't assert when comparing if an "array special interface" is assignable from an array. The code assumed that the special interface is some sort of generic instance like ``IList`1<string>``, but it could be a generic type definition ``IList`1``. There is a case where we would be obligated to return TRUE: If someone used reflection to get the generic param of ``IList`1`` and then made an array: ``` var i = typeof (IList<>); var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T var a = iparam.MakeArrayType (); // T[] Console.WriteLine (i.IsAssignableFrom (a)); ``` But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check, earlier in mono_class_is_assignable_from. So we can return FALSE here. Fixes #7095
…face gtd (#7290) * [test] System.Type.IsAssignableFrom of gtd array special interfaces. Regression test for #7095 * [runtime] Don't assert in mono_class_is_assignable_from on iface gtd Don't assert when comparing if an "array special interface" is assignable from an array. The code assumed that the special interface is some sort of generic instance like ``IList`1<string>``, but it could be a generic type definition ``IList`1``. There is a case where we would be obligated to return TRUE: If someone used reflection to get the generic param of ``IList`1`` and then made an array: ``` var i = typeof (IList<>); var iparam = i.GetTypeInfo().GenericTypeParameters [0]; // returns gparam T var a = iparam.MakeArrayType (); // T[] Console.WriteLine (i.IsAssignableFrom (a)); ``` But that case is handled by the `MONO_CLASS_IMPLEMENTED_INTERFACE` check, earlier in mono_class_is_assignable_from. So we can return FALSE here. Fixes #7095
Context: mono/mono#7095 Context: mono/mono#7262
Context: mono/mono#7085 Context: mono/mono#7086 Context: mono/mono#7095 Context: mono/mono#7262 Various SDKs fixes.
Context: mono/mono#7085 Context: mono/mono#7086 Context: mono/mono#7095 Context: mono/mono#7262 Various SDKs fixes.
Bumps to Java.Interop/master/0afb2b0f Bumps to llvm/master/a9cfb50e. Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=11771 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=15051 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=19436 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=45901 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=56071 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58413 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58413 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58413 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59184 fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60065 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60225 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60298 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60359 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60568 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60756 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60848 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60862 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60900 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60904 Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60986 Fixes: https://github.com/mono/mono/issues/59400 Fixes: mono/mono#6169 Fixes: mono/mono#6187 Fixes: mono/mono#6192 Fixes: mono/mono#6255 Fixes: mono/mono#6264 Fixes: mono/mono#6266 Fixes: mono/mono#6281 Fixes: mono/mono#6283 Fixes: mono/mono#6320 Fixes: mono/mono#6339 Fixes: mono/mono#6343 Fixes: mono/mono#6349 Fixes: mono/mono#6379 Fixes: mono/mono#6383 Fixes: mono/mono#6401. Fixes: mono/mono#6411 Fixes: mono/mono#6414 Fixes: mono/mono#6490 Fixes: mono/mono#6721 Fixes: mono/mono#6767 Fixes: mono/mono#6777 Fixes: mono/mono#6848 Fixes: mono/mono#6940 Fixes: mono/mono#6948 Fixes: mono/mono#6998 Fixes: mono/mono#7016 Fixes: mono/mono#7085 Fixes: mono/mono#7086 Fixes: mono/mono#7095 Fixes: mono/mono#7137 Fixes: mono/mono#7184 Fixes: mono/mono#7240 Fixes: mono/mono#7262 Fixes: mono/mono#7289 Fixes: mono/mono#7338 Fixes: mono/mono#7356 Fixes: mono/mono#7364 Fixes: mono/mono#7378 Fixes: mono/mono#7389 Fixes: mono/mono#7460 Fixes: mono/mono#7535 Fixes: mono/mono#7536 Fixes: mono/mono#7610 Fixes: mono/mono#7624 Fixes: mono/mono#7637 Fixes: mono/mono#7655 Fixes: mono/mono#7657 Fixes: mono/mono#7685 Fixes: mono/mono#7786 Fixes: mono/mono#7792 Fixes: mono/mono#7822 Fixes: mono/mono#7860 Fixes: mono/mono#8089 Fixes: mono/mono#8267 Fixes: mono/mono#8409 Fixes: xamarin/maccore#628 Fixes: xamarin/maccore#629 Fixes: xamarin/maccore#673 Fixes: xamarin/maccore#673 Fixes: #1561
Fixes: #1130 Fixes: #1561 (comment) Fixes: #1845 Fixes: #1951 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=10087 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=11771 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=12850 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=18941 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=19436 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=25444 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=33208 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=58413 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59184 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59400 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59779 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60065 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60843 Context: mono/mono#6174 Context: mono/mono#6178 Context: mono/mono#6180 Context: mono/mono#6181 Context: mono/mono#6186 Context: mono/mono#6187 Context: mono/mono#6211 Context: mono/mono#6266 Context: mono/mono#6579 Context: mono/mono#6666 Context: mono/mono#6752 Context: mono/mono#6801 Context: mono/mono#6812 Context: mono/mono#6848 Context: mono/mono#6940 Context: mono/mono#6948 Context: mono/mono#6998 Context: mono/mono#6999 Context: mono/mono#7016 Context: mono/mono#7085 Context: mono/mono#7086 Context: mono/mono#7095 Context: mono/mono#7134 Context: mono/mono#7137 Context: mono/mono#7145 Context: mono/mono#7184 Context: mono/mono#7240 Context: mono/mono#7262 Context: mono/mono#7289 Context: mono/mono#7338 Context: mono/mono#7356 Context: mono/mono#7364 Context: mono/mono#7378 Context: mono/mono#7389 Context: mono/mono#7449 Context: mono/mono#7460 Context: mono/mono#7535 Context: mono/mono#7536 Context: mono/mono#7537 Context: mono/mono#7565 Context: mono/mono#7588 Context: mono/mono#7596 Context: mono/mono#7610 Context: mono/mono#7613 Context: mono/mono#7620 Context: mono/mono#7624 Context: mono/mono#7637 Context: mono/mono#7655 Context: mono/mono#7657 Context: mono/mono#7661 Context: mono/mono#7685 Context: mono/mono#7696 Context: mono/mono#7729 Context: mono/mono#7786 Context: mono/mono#7792 Context: mono/mono#7805 Context: mono/mono#7822 Context: mono/mono#7828 Context: mono/mono#7860 Context: mono/mono#7864 Context: mono/mono#7903 Context: mono/mono#7920 Context: mono/mono#8089 Context: mono/mono#8143 Context: mono/mono#8267 Context: mono/mono#8311 Context: mono/mono#8340 Context: mono/mono#8409 Context: mono/mono#8417 Context: mono/mono#8430 Context: mono/mono#8698 Context: mono/mono#8701 Context: mono/mono#8712 Context: mono/mono#8721 Context: mono/mono#8726 Context: mono/mono#8866 Context: mono/mono#9023 Context: mono/mono#9031 Context: mono/mono#9033 Context: mono/mono#9044 Context: mono/mono#9179 Context: mono/mono#9318 Context: mono/mono#9318 Context: xamarin/maccore#628 Context: xamarin/maccore#629 Context: xamarin/maccore#673
Fixes: #1130 Fixes: #1561 (comment) Fixes: #1845 Fixes: #1951 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=10087 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=11771 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=12850 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=18941 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=19436 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=25444 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=33208 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=58413 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59184 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59400 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59779 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60065 Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60843 Context: mono/mono#6174 Context: mono/mono#6178 Context: mono/mono#6180 Context: mono/mono#6181 Context: mono/mono#6186 Context: mono/mono#6187 Context: mono/mono#6211 Context: mono/mono#6266 Context: mono/mono#6579 Context: mono/mono#6666 Context: mono/mono#6752 Context: mono/mono#6801 Context: mono/mono#6812 Context: mono/mono#6848 Context: mono/mono#6940 Context: mono/mono#6948 Context: mono/mono#6998 Context: mono/mono#6999 Context: mono/mono#7016 Context: mono/mono#7085 Context: mono/mono#7086 Context: mono/mono#7095 Context: mono/mono#7134 Context: mono/mono#7137 Context: mono/mono#7145 Context: mono/mono#7184 Context: mono/mono#7240 Context: mono/mono#7262 Context: mono/mono#7289 Context: mono/mono#7338 Context: mono/mono#7356 Context: mono/mono#7364 Context: mono/mono#7378 Context: mono/mono#7389 Context: mono/mono#7449 Context: mono/mono#7460 Context: mono/mono#7535 Context: mono/mono#7536 Context: mono/mono#7537 Context: mono/mono#7565 Context: mono/mono#7588 Context: mono/mono#7596 Context: mono/mono#7610 Context: mono/mono#7613 Context: mono/mono#7620 Context: mono/mono#7624 Context: mono/mono#7637 Context: mono/mono#7655 Context: mono/mono#7657 Context: mono/mono#7661 Context: mono/mono#7685 Context: mono/mono#7696 Context: mono/mono#7729 Context: mono/mono#7786 Context: mono/mono#7792 Context: mono/mono#7805 Context: mono/mono#7822 Context: mono/mono#7828 Context: mono/mono#7860 Context: mono/mono#7864 Context: mono/mono#7903 Context: mono/mono#7920 Context: mono/mono#8089 Context: mono/mono#8143 Context: mono/mono#8267 Context: mono/mono#8311 Context: mono/mono#8340 Context: mono/mono#8409 Context: mono/mono#8417 Context: mono/mono#8430 Context: mono/mono#8698 Context: mono/mono#8701 Context: mono/mono#8712 Context: mono/mono#8721 Context: mono/mono#8726 Context: mono/mono#8866 Context: mono/mono#9023 Context: mono/mono#9031 Context: mono/mono#9033 Context: mono/mono#9044 Context: mono/mono#9179 Context: mono/mono#9318 Context: mono/mono#9318 Context: xamarin/maccore#628 Context: xamarin/maccore#629 Context: xamarin/maccore#673
I have found it's STILL be reproducable with some other apps, even on Mono Preview 5.20: |
This STILL crash on 5.18 and even on 5.20! Run: mono pabcnetc.exe lab1-02_draw.pas And result:
|
Getting somewhere debugging the pascal compiler on mono
It's working with a Should have a reduced testcase soon... |
I see another issue has marked as fixed:
Which still crash with the same crap... |
This still is crashy...
pascalabcnet.zip (this project: https://github.com/pascalabcnet/pascalabcnet)
Looks like I should wait for tomorrow and pull the update and re-test... |
Seems this can be reproduced with even the most minimal of pascal files:
|
Some notes: The crash is occurring because in
|
@Wohlstand do you work on this pascal compiler? Is there any chance of getting a standalone repro? I'm finding it really difficult to navigate the codebase, and I don't want to push a fix until I'm sure I understand the issue and have a test case I can create. |
Also, do you know if this used to work in an older version of Mono, or have any idea how long it's been broken for? |
Not mine, I have tried to compile it and try it out, however, it crashing on a compiling and why I reporting. Repo is here already, lemme give you a link to it... |
The repo of the Pascal compiler I tried to build and it became crashy: https://github.com/pascalabcnet/pascalabcnet |
Minimal repro:
This will currently crash on the first statement in Mono, but I've added the second bit because it appears we have another bug with not sorting the methods? I need to verify if so and then fix that separately. |
Gonna to try this fix out when I get home... |
I still have the same problem with pascalabcnet cloned from github master using |
Works fine with |
Steps to Reproduce
mono ipy.exe doit.py
mono_assertion.zip
Current Behavior
The code is a reproduction of a test case in IronPython. When the
iter
method is called with a System.Array[int], an assertion is not met.Expected Behavior
On MS.NET and previous versions of Mono, this behavior was not seen. The assertion did not occur and the code functioned as expected.
On which platforms did you notice this
[ ] macOS
[x] Linux
[ ] Windows
Version Used:
Mono JIT compiler version 5.8.0.108 (tarball Fri Jan 19 18:15:21 UTC 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
Stacktrace
The text was updated successfully, but these errors were encountered: