Bug 28377 - System.Guid.NewGuid fails on OS X 10.6
Summary: System.Guid.NewGuid fails on OS X 10.6
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Other ()
Version: Master
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 1.12.0
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2015-03-24 14:12 UTC by Frank A. Krueger
Modified: 2015-03-24 16:30 UTC (History)
3 users (show)

Tags:
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 on Developer Community or GitHub 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 FIXED

Description Frank A. Krueger 2015-03-24 14:12:32 UTC
Using a Unified build.

ERROR: INIT4 System.EntryPointNotFoundException: SecRandomCopyBytes
  at (wrapper managed-to-native) Crimson.CommonCrypto.Cryptor:SecRandomCopyBytes (intptr,intptr,byte[])
  at Crimson.CommonCrypto.Cryptor.GetRandom (System.Byte[] buffer) [0x00000] in <filename unknown>:0 
  at System.Security.Cryptography.RNGCryptoServiceProvider.GetBytes (System.Byte[] data) [0x00000] in <filename unknown>:0 
  at System.Guid.NewGuid () [0x00000] in <filename unknown>:0 
  at Circuit.Mac.CircuitDocument+Repo..ctor (Circuit.Mac.CircuitDocument doc) [0x00000] in <filename unknown>:0 
  at Circuit.Mac.CircuitDocument.Initialize () [0x00000] in <filename unknown>:0 


=== Xamarin Studio ===

Version 5.8.2 (build 5)
Installation UUID: e51e2705-c52a-4ae8-aa07-c481d6ab8a7a
Runtime:
	Mono 3.12.1 ((detached/b63df7d)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010002

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.2.2 (Enterprise Edition)
Hash: f5d0c5e
Branch: 
Build date: 2015-03-20 06:51:49-0400

=== Xamarin.Android ===

Version: 4.20.1.0 (Enterprise Edition)
Android SDK: /Users/fak/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 1.12.0.14 (Enterprise Edition)

=== Build Information ===

Release ID: 508020005
Git revision: 541c06a4f6c95383333375d56fd6c23ce48cb916
Build date: 2015-03-20 09:23:08-04
Xamarin addins: 02510c4990dee3475c282b3182d588975a63ff07

=== Operating System ===

Mac OS X 10.10.2
Darwin lepton.local 14.1.0 Darwin Kernel Version 14.1.0
    Thu Feb 26 19:26:47 PST 2015
    root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64
Comment 1 Chris Hamons 2015-03-24 14:30:18 UTC
From SecRandom.h

int SecRandomCopyBytes(SecRandomRef rnd, size_t count, uint8_t *bytes)
    __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_2_0);

Now, in theory mono shouldn't be using an 10.7 API if we're supporting 10.6. 

This is a mono issue (System.* isn't XM).
Comment 2 Chris Hamons 2015-03-24 14:38:28 UTC
I was mistaken. This actually is in XM, with a few levels of indirection.

We'll have to look for a replacement for that API on 10.6
Comment 3 Chris Hamons 2015-03-24 14:38:37 UTC
I was mistaken. This actually is in XM, with a few levels of indirection.

We'll have to look for a replacement for that API on 10.6
Comment 4 Sebastien Pouliot 2015-03-24 15:35:38 UTC
Fixed in mono-extensions/master 1aa80828bdfa8c074069609e7fd588cf30b3fe84
and mono-4.0.0-branch 4123057d899c463df2bffeb58ccd1acad112b241

@Chris I'll bump master and macios-cycle5 but I'm not sure which branch XM 1.12 was tracking, but the fix should be easy to backport
Comment 5 Chris Hamons 2015-03-24 15:37:55 UTC
@Sebastien - I'll get a build going. Thanks!