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

[Hot Reload] metadata.c:1326, condition `GINT_TO_UINT32(idx) < table_info_get_rows (t)' not met #19277

Closed
jeromelaban opened this issue Oct 20, 2023 · 5 comments
Labels
need-attention An issue requires our attention/response
Milestone

Comments

@jeromelaban
Copy link
Contributor

jeromelaban commented Oct 20, 2023

Steps to Reproduce

  1. Create a maui app (net8 rc2)
  2. Add a [CreateNewOnMetadataUpdate] attribute on MainPage
  3. Build the app
  4. Run the app
  5. Add a ToString(); call in the ctor, or any other MainPage modification
  6. Perform a C# hot reload

Expected Behavior

The code is updated without crashing.

Actual Behavior

Sometimes:

error: * Assertion at /Users/runner/work/1/s/src/mono/mono/metadata/metadata.c:1326, condition `GINT_TO_UINT32(idx) < table_info_get_rows (t)' not met

Sometimes:

=================================================================
	Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
	Native stacktrace:
=================================================================
	0x104aba1d5 - /Users/jay2/Library/Developer/CoreSimulator/Devices/F4A03A05-42EF-47DF-8C0B-0DB5B0E49D76/data/Containers/Bundle/Application/FD06AA1D-DB01-4BC1-B692-B59CC36FB231/MauiApp3.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info
	0x104a58b6e - /Users/jay2/Library/Developer/CoreSimulator/Devices/F4A03A05-42EF-47DF-8C0B-0DB5B0E49D76/data/Containers/Bundle/Application/FD06AA1D-DB01-4BC1-B692-B59CC36FB231/MauiApp3.app/libmonosgen-2.0.dylib : mono_handle_native_crash
	0x1049abaff - /Users/jay2/Library/Developer/CoreSimulator/Devices/F4A03A05-42EF-47DF-8C0B-0DB5B0E49D76/data/Containers/Bundle/Application/FD06AA1D-DB01-4BC1-B692-B59CC36FB231/MauiApp3.app/libmonosgen-2.0.dylib : mono_sigsegv_signal_handler_debug
	0x7ff8377405ed - /usr/lib/system/libsystem_platform.dylib : _sigtramp
	0x0 - Unknown
	0x103b33fd6 - /Users/jay2/Library/Developer/CoreSimulator/Devices/F4A03A05-42EF-47DF-8C0B-0DB5B0E49D76/data/Containers/Bundle/Application/FD06AA1D-DB01-4BC1-B692-B59CC36FB231/MauiApp3.app/libmono-component-debugger.dylib : get_types_for_source_file
	0x103b3ce1d - /Users/jay2/Library/Developer/CoreSimulator/Devices/F4A03A05-42EF-47DF-8C0B-0DB5B0E49D76/data/Containers/Bundle/Application/FD06AA1D-DB01-4BC1-B692-B59CC36FB231/MauiApp3.app/libmono-component-debugger.dylib : monoeg_g_hash_table_foreach
	0x103b25917 - /Users/jay2/Library/Developer/CoreSimulator/Devices/F4A03A05-42EF-47DF-8C0B-0DB5B0E49D76/data/Containers/Bundle/Application/FD06AA1D-DB01-4BC1-B692-B59CC36FB231/MauiApp3.app/libmono-component-debugger.dylib : mono_process_dbg_packet
	0x103b2d3ff - /Users/jay2/Library/Developer/CoreSimulator/Devices/F4A03A05-42EF-47DF-8C0B-0DB5B0E49D76/data/Containers/Bundle/Application/FD06AA1D-DB01-4BC1-B692-B59CC36FB231/MauiApp3.app/libmono-component-debugger.dylib : mono_debugger_agent_receive_and_process_command
	0x103b300f0 - /Users/jay2/Library/Developer/CoreSimulator/Devices/F4A03A05-42EF-47DF-8C0B-0DB5B0E49D76/data/Containers/Bundle/Application/FD06AA1D-DB01-4BC1-B692-B59CC36FB231/MauiApp3.app/libmono-component-debugger.dylib : debugger_thread
	0x104bbb4fe - /Users/jay2/Library/Developer/CoreSimulator/Devices/F4A03A05-42EF-47DF-8C0B-0DB5B0E49D76/data/Containers/Bundle/Application/FD06AA1D-DB01-4BC1-B692-B59CC36FB231/MauiApp3.app/libmonosgen-2.0.dylib : start_wrapper
	0x7ff83774d1d3 - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
	0x7ff837748bd3 - /usr/lib/system/libsystem_pthread.dylib : thread_start

Environment

  • VS 2022 17.8 Preview 4
  • .NET 8.0.100-rc.2.23502.2
Installed Workload Id      Manifest Version                     Installation Source
----------------------------------------------------------------------------------------------------------------------
maui-ios                   8.0.0-rc.2.9373/8.0.100-rc.2         VS 17.7.34009.444
ios                        16.4.8968-net8-rc2/8.0.100-rc.2      VS 17.7.34009.444, VS 17.8.34212.112, VS 17.8.34112.27
maccatalyst                16.4.8968-net8-rc2/8.0.100-rc.2      VS 17.7.34009.444, VS 17.8.34212.112, VS 17.8.34112.27
maui-android               8.0.0-rc.2.9373/8.0.100-rc.2         VS 17.7.34009.444
android                    34.0.0-rc.2.468/8.0.100-rc.2         VS 17.7.34009.444, VS 17.8.34212.112, VS 17.8.34112.27
maui-windows               8.0.0-rc.2.9373/8.0.100-rc.2         VS 17.7.34009.444, VS 17.8.34212.112, VS 17.8.34112.27
maui-maccatalyst           8.0.0-rc.2.9373/8.0.100-rc.2         VS 17.7.34009.444

Build Logs

Available on demand.

@rolfbjarne
Copy link
Member

@jeromelaban this looks like a crash in the debugger; does the app run if you don't attach a debugger (just tap on it)?

@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label Oct 20, 2023
@rolfbjarne rolfbjarne added this to the Future milestone Oct 20, 2023
@jeromelaban
Copy link
Contributor Author

@rolfbjarne thanks for looking into it! No, the app does not crash, but there's no hot reload that can happen either. The issue only happens when explicitly triggering a hot reload (which happens through the debugger in this case).

It may be a runtime issue, though, since it fails in a very similar way under Android.

I can open a runtime issue if you think it's more appropriate.

@microsoft-github-policy-service microsoft-github-policy-service bot added need-attention An issue requires our attention/response and removed need-info Waiting for more information before the bug can be investigated labels Oct 20, 2023
@jeromelaban
Copy link
Contributor Author

@rolfbjarne I just discovered that I missed some steps in the original description, my apologies. Hot reloading is required for this to fail.

@rolfbjarne
Copy link
Member

I can open a runtime issue if you think it's more appropriate.

Yes, this looks like a runtime issue, so the dotnet/runtime repository would be a better place for it.

I'll move it there.

@rolfbjarne
Copy link
Member

This issue was moved to dotnet/runtime#93860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-attention An issue requires our attention/response
Projects
None yet
Development

No branches or pull requests

2 participants