Bug 33488 - Assertion: should not be reached at loader.c:297
Summary: Assertion: should not be reached at loader.c:297
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: 4.2.0 (C6)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-08-29 13:02 UTC by grokys
Modified: 2015-09-01 18:21 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 33488 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description grokys 2015-08-29 13:02:54 UTC
I'm using mono 4.2 from the alpha channel.

I compile https://github.com/grokys/Perspex/ (commit 7b234aefb9a6bf3e734f0d7d37c0c4a53bb34e9e) in monodevelop, ignoring the projects that don't compile. Trying to run the TestApplication I get the following error:

steven@ubuntuvm:~/projects/Perspex/samples/TestApplication/bin/Debug$ mono TestApplication.exe
Can't find custom attr constructor image: /home/steven/projects/Perspex/samples/TestApplication/bin/Debug/ReactiveUI.dll mtoken: 0x0a000011
Unhandled loader error: 8, (null) PresentationFramework, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (null)
* Assertion: should not be reached at loader.c:297


  at <unknown> <0xffffffff>
  at TestApplication.Program.Main (string[]) <0x002a7>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	mono() [0x49cedc]
	/lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10) [0x7f135818bd10]
	/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f1357de6267]
	/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f1357de7eca]
	mono() [0x629ed9]
	mono() [0x62a0e7]
	mono() [0x62a236]
	mono() [0x53fec4]
	mono() [0x51af03]
	mono() [0x51adfd]
	mono() [0x51bd99]
	mono() [0x51bfcf]
	mono(mono_class_from_typeref_checked+0x160) [0x51c160]
	mono() [0x54299c]
	mono() [0x542f33]
	mono() [0x5431c2]
	mono(mono_get_method_full+0x23) [0x5432f3]
	mono() [0x45ac5a]
	mono() [0x4fdad2]
	mono() [0x4fedef]
	mono() [0x4238d4]
	mono() [0x423f4b]
	mono() [0x49f541]

Debug info from gdb:

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No threads.

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

Aborted (core dumped)
Comment 1 Zoltan Varga 2015-08-31 20:23:53 UTC
This usually means a mismatch between assembly versions, i.e. the ReactiveUI.dll used at runtime doesn't match the version used to compile the app.
Comment 2 grokys 2015-09-01 05:18:07 UTC
I don't think this is the case here - I'm not doing anything clever, the ReactiveUI.dll comes simply from a NuGet package.

I realise that ReactiveUI tries to reference PresentationFramework which doesn't exist on mono, and so wouldn't work anyway, but apart from this the fact that it's reporting "Assertion: should not be reached at loader.c:297" suggests to me that this is triggering a logic exception in mono.
Comment 3 Zoltan Varga 2015-09-01 18:21:04 UTC
This is a mono runtime bug caused by insufficient error handling.