Bug 60864 - Compilation of System.Runtime.CompilerServices.Unsafe fails with an exception
Summary: Compilation of System.Runtime.CompilerServices.Unsafe fails with an exception
Status: RESOLVED INVALID
Alias: None
Product: Runtime
Classification: Mono
Component: Verifier ()
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Rodrigo Kumpera
URL:
Depends on:
Blocks:
 
Reported: 2017-11-27 10:16 UTC by Marek Safar
Modified: 2018-03-19 13:38 UTC (History)
5 users (show)

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


Attachments
diff (1.02 KB, patch)
2017-11-28 19:48 UTC, Ludovic Henry
Details


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 on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Marek Safar 2017-11-27 10:16:49 UTC
./mono-wrapper --compile-all --verify-all --security=verifiable

/mnt/jenkins/workspace/test-mono-pull-request-i386/mcs/class/lib/net_4_x/System.Runtime.CompilerServices.Unsafe.dll
Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlock (void*,void*,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlock (byte&,byte&,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlockUnaligned (void*,void*,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlockUnaligned (byte&,byte&,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:InitBlock (void*,byte,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:InitBlock (byte&,byte,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:InitBlockUnaligned (void*,byte,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:InitBlockUnaligned (byte&,byte,uint) failed with exception '(null)':
Comment 1 Ludovic Henry 2017-11-27 16:19:34 UTC
How do you reproduce? Which commit of Mono is it? What configuration is it?
Comment 2 Marek Safar 2017-11-28 09:33:46 UTC
With mono master

mono --compile-all --verify-all mcs/class/lib/net_4_x/System.Runtime.CompilerServices.Unsafe.dll

Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlock (void*,void*,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlock (byte&,byte&,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlockUnaligned (void*,void*,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlockUnaligned (byte&,byte&,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:InitBlock (void*,byte,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:InitBlock (byte&,byte,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:InitBlockUnaligned (void*,byte,uint) failed with exception '(null)':
Compilation of System.Runtime.CompilerServices.Unsafe:InitBlockUnaligned (byte&,byte,uint) failed with exception '(null)':
Comment 3 Ludovic Henry 2017-11-28 19:47:18 UTC
I can reproduce with Mono 5.9.0 (master/984f6484666).
Comment 4 Ludovic Henry 2017-11-28 19:48:09 UTC
Created attachment 25854 [details]
diff

With attached diff, I get the following output which gives more information on the cause of the error:

> Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlock (void*,void*,uint) failed with exception 'VerificationException(message: "Error verifying System.Runtime.CompilerServices.Unsafe:CopyBlock (void*,void*,uint): Unmanaged pointer is not a verifiable type at 0x0000 assembly:<unknown assembly> type:<unknown type> member:(null) signature:<none>")':
> Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlock (byte&,byte&,uint) failed with exception 'VerificationException(message: "Error verifying System.Runtime.CompilerServices.Unsafe:CopyBlock (byte&,byte&,uint): Instruction cpblk is not verifiable at 0x0003 assembly:<unknown assembly> type:<unknown type> member:(null) signature:<none>")':
> Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlockUnaligned (void*,void*,uint) failed with exception 'VerificationException(message: "Error verifying System.Runtime.CompilerServices.Unsafe:CopyBlockUnaligned (void*,void*,uint): Unmanaged pointer is not a verifiable type at 0x0000 assembly:<unknown assembly> type:<unknown type> member:(null) signature:<none>")':
> Compilation of System.Runtime.CompilerServices.Unsafe:CopyBlockUnaligned (byte&,byte&,uint) failed with exception 'VerificationException(message: "Error verifying System.Runtime.CompilerServices.Unsafe:CopyBlockUnaligned (byte&,byte&,uint): Instruction cpblk is not verifiable at 0x0006 assembly:<unknown assembly> type:<unknown type> member:(null) signature:<none>")':
> Compilation of System.Runtime.CompilerServices.Unsafe:InitBlock (void*,byte,uint) failed with exception 'VerificationException(message: "Error verifying System.Runtime.CompilerServices.Unsafe:InitBlock (void*,byte,uint): Unmanaged pointer is not a verifiable type at 0x0000 assembly:<unknown assembly> type:<unknown type> member:(null) signature:<none>")':
> Compilation of System.Runtime.CompilerServices.Unsafe:InitBlock (byte&,byte,uint) failed with exception 'VerificationException(message: "Error verifying System.Runtime.CompilerServices.Unsafe:InitBlock (byte&,byte,uint): Instruction initblk is not verifiable at 0x0003 assembly:<unknown assembly> type:<unknown type> member:(null) signature:<none>")':
> Compilation of System.Runtime.CompilerServices.Unsafe:InitBlockUnaligned (void*,byte,uint) failed with exception 'VerificationException(message: "Error verifying System.Runtime.CompilerServices.Unsafe:InitBlockUnaligned (void*,byte,uint): Unmanaged pointer is not a verifiable type at 0x0000 assembly:<unknown assembly> type:<unknown type> member:(null) signature:<none>")':
> Compilation of System.Runtime.CompilerServices.Unsafe:InitBlockUnaligned (byte&,byte,uint) failed with exception 'VerificationException(message: "Error verifying System.Runtime.CompilerServices.Unsafe:InitBlockUnaligned (byte&,byte,uint): Instruction initblk is not verifiable at 0x0006 assembly:<unknown assembly> type:<unknown type> member:(null) signature:<none>")':
Comment 5 Ludovic Henry 2018-01-05 14:23:47 UTC
I can reproduce with Mono 5.10.0.18 (2017-12/dcaf47f5187)
Comment 6 Bernhard Urban 2018-01-15 08:38:30 UTC
didn't look much into it unfortunately. Hint: It's useful to enable this while debugging: https://github.com/mono/mono/blob/001d4d5082197f57cd5b70e7d26fbc86b0212966/mono/metadata/verify.c#L68
Comment 7 Rodrigo Kumpera 2018-02-14 18:51:02 UTC
Working on it for bug week.
Comment 8 Rodrigo Kumpera 2018-02-14 19:29:49 UTC
There's nothing to fix in the verifier. Pointers are not verifiable.
What you want is to use --security=validil.

I'm fixing the erro message part in --compile-all thou.