Skip to content
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

[Wasm][AOT] -O=gsharedvt code fails in JitHelpers #51113

Closed
jeromelaban opened this issue Apr 12, 2021 · 1 comment · Fixed by #51180
Closed

[Wasm][AOT] -O=gsharedvt code fails in JitHelpers #51113

jeromelaban opened this issue Apr 12, 2021 · 1 comment · Fixed by #51180
Assignees
Labels
arch-wasm WebAssembly architecture area-Codegen-AOT-mono
Milestone

Comments

@jeromelaban
Copy link
Contributor

Description

Intrinsics in this JitHelpers are failing when building with -g=gsharedvt:

internal static class JitHelpers
{
[Intrinsic]
public static bool EnumEquals<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException();
[Intrinsic]
public static int EnumCompareTo<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException();
}

with the following stack:

mono_llvm_cpp_throw_exception | @ | 131b8bb6:0x17e55f
-- | -- | --
  | throw_exception | @ | 131b8bb6:0x16a178
  | mono_llvm_throw_exception | @ | 131b8bb6:0x167191
  | corlib_System_Runtime_CompilerServices_JitHelpers_EnumCompareTo_T_GSHAREDVT_T_GSHAREDVT_T_GSHAREDVT | @ | 131b8bb6:0xa0b5fe
  | corlib_System_Collections_Generic_EnumComparer_1_T_GSHAREDVT_Compare_T_GSHAREDVT_T_GSHAREDVT | @ | 131b8bb6:0xa2e48e
  | System_Linq_System_Linq_EnumerableSorter_2_TElement_GSHAREDVT_TKey_GSHAREDVT_CompareAnyKeys_int_int | @ | 131b8bb6:0xb18f54
  | aot_instances_aot_wrapper_gsharedvt_out_sig_pinvoke_i4_this_i4i4 | @ | 131b8bb6:0x327c8ef
  | corlib_wrapper_delegate_invoke_System_Comparison_1_T_GSHAREDVT_invoke_int_T_T_T_GSHAREDVT_T_GSHAREDVT | @ | 131b8bb6:0xa73e6d
  | aot_instances_aot_wrapper_gsharedvt_in_sig_i4_this_i4i4 | @ | 131b8bb6:0x32c6244
  | aot_instances_System_Collections_Generic_ArraySortHelper_1_T_INT_InsertionSort_System_Span_1_T_INT_System_Comparison_1_T_INT | @ | 131b8bb6:0x35e85ad
  | aot_instances_System_Collections_Generic_ArraySortHelper_1_T_INT_IntroSort_System_Span_1_T_INT_int_System_Comparison_1_T_INT | @ | 131b8bb6:0x35ca92e
  | aot_instances_System_Collections_Generic_ArraySortHelper_1_T_INT_IntrospectiveSort_System_Span_1_T_INT_System_Comparison_1_T_INT | @ | 131b8bb6:0x3535490
  | invoke_viii | @ | dotnet.js:12110
  | aot_instances_System_Collections_Generic_ArraySortHelper_1_T_INT_Sort_System_Span_1_T_INT_System_Comparison_1_T_INT | @ | 131b8bb6:0x346d259
  | aot_instances_System_MemoryExtensions_Sort_T_INT_System_Span_1_T_INT_System_Comparison_1_T_INT | @ | 131b8bb6:0x3268e49
  | System_Linq_System_Linq_EnumerableSorter_2_TElement_GSHAREDVT_TKey_GSHAREDVT_QuickSort_int___int_int | @ | 131b8bb6:0xb19220
  | System_Linq_System_Linq_EnumerableSorter_1_TElement_REF_Sort_TElement_REF___int | @ | 131b8bb6:0xae227b
  | System_Linq_System_Linq_OrderedEnumerable_1_TElement_REF_SortedMap_System_Linq_Buffer_1_TElement_REF | @ | 131b8bb6:0xae15c5
  | System_Linq_System_Linq_OrderedEnumerable_1__GetEnumeratord__4_TElement_REF_MoveNext | @ | 131b8bb6:0xae19f4

Configuration

5b683e2

Regression?

No

Other information

@ghost
Copy link

ghost commented Apr 12, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Intrinsics in this JitHelpers are failing when building with -g=gsharedvt:

internal static class JitHelpers
{
[Intrinsic]
public static bool EnumEquals<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException();
[Intrinsic]
public static int EnumCompareTo<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException();
}

with the following stack:

mono_llvm_cpp_throw_exception | @ | 131b8bb6:0x17e55f
-- | -- | --
  | throw_exception | @ | 131b8bb6:0x16a178
  | mono_llvm_throw_exception | @ | 131b8bb6:0x167191
  | corlib_System_Runtime_CompilerServices_JitHelpers_EnumCompareTo_T_GSHAREDVT_T_GSHAREDVT_T_GSHAREDVT | @ | 131b8bb6:0xa0b5fe
  | corlib_System_Collections_Generic_EnumComparer_1_T_GSHAREDVT_Compare_T_GSHAREDVT_T_GSHAREDVT | @ | 131b8bb6:0xa2e48e
  | System_Linq_System_Linq_EnumerableSorter_2_TElement_GSHAREDVT_TKey_GSHAREDVT_CompareAnyKeys_int_int | @ | 131b8bb6:0xb18f54
  | aot_instances_aot_wrapper_gsharedvt_out_sig_pinvoke_i4_this_i4i4 | @ | 131b8bb6:0x327c8ef
  | corlib_wrapper_delegate_invoke_System_Comparison_1_T_GSHAREDVT_invoke_int_T_T_T_GSHAREDVT_T_GSHAREDVT | @ | 131b8bb6:0xa73e6d
  | aot_instances_aot_wrapper_gsharedvt_in_sig_i4_this_i4i4 | @ | 131b8bb6:0x32c6244
  | aot_instances_System_Collections_Generic_ArraySortHelper_1_T_INT_InsertionSort_System_Span_1_T_INT_System_Comparison_1_T_INT | @ | 131b8bb6:0x35e85ad
  | aot_instances_System_Collections_Generic_ArraySortHelper_1_T_INT_IntroSort_System_Span_1_T_INT_int_System_Comparison_1_T_INT | @ | 131b8bb6:0x35ca92e
  | aot_instances_System_Collections_Generic_ArraySortHelper_1_T_INT_IntrospectiveSort_System_Span_1_T_INT_System_Comparison_1_T_INT | @ | 131b8bb6:0x3535490
  | invoke_viii | @ | dotnet.js:12110
  | aot_instances_System_Collections_Generic_ArraySortHelper_1_T_INT_Sort_System_Span_1_T_INT_System_Comparison_1_T_INT | @ | 131b8bb6:0x346d259
  | aot_instances_System_MemoryExtensions_Sort_T_INT_System_Span_1_T_INT_System_Comparison_1_T_INT | @ | 131b8bb6:0x3268e49
  | System_Linq_System_Linq_EnumerableSorter_2_TElement_GSHAREDVT_TKey_GSHAREDVT_QuickSort_int___int_int | @ | 131b8bb6:0xb19220
  | System_Linq_System_Linq_EnumerableSorter_1_TElement_REF_Sort_TElement_REF___int | @ | 131b8bb6:0xae227b
  | System_Linq_System_Linq_OrderedEnumerable_1_TElement_REF_SortedMap_System_Linq_Buffer_1_TElement_REF | @ | 131b8bb6:0xae15c5
  | System_Linq_System_Linq_OrderedEnumerable_1__GetEnumeratord__4_TElement_REF_MoveNext | @ | 131b8bb6:0xae19f4

Configuration

5b683e2

Regression?

No

Other information

Author: jeromelaban
Assignees: -
Labels:

arch-wasm, area-Codegen-AOT-mono, untriaged

Milestone: -

@lewing lewing added this to the 6.0.0 milestone Apr 12, 2021
@lewing lewing removed the untriaged New issue has not been triaged by the area owner label Apr 12, 2021
@vargaz vargaz self-assigned this Apr 13, 2021
vargaz added a commit to vargaz/runtime that referenced this issue Apr 13, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Apr 13, 2021
vargaz added a commit that referenced this issue Apr 13, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 13, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Codegen-AOT-mono
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants