MDLMaterial(name:scatteringFunction) crashes playground on OS X

Originator:iosdeveloperzone
Number:rdar://26190262 Date Originated:10-May-2016 12:01 AM
Status:Open Resolved:
Product:OS X SDK Product Version:Xcode 7.3 (7D175)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
It appears to be impossible to create an MDLMaterial object in an OS X playground. 
It crashes the playground.

Steps to Reproduce:
1) Create OS X Playground
2) Paste in following code:

	import Cocoa
	import ModelIO
	let scatteringFunction = MDLScatteringFunction()
	let material = MDLMaterial(name:"BasicMaterial", scatteringFunction:scatteringFunction)

Expected Results:
A ModelIO material should be created

Actual Results:
Playground crashes with following stack trace:
2016-05-09 23:55:17.760 com.apple.dt.Xcode.PlaygroundStub-macosx[13138:1235656] An uncaught exception was raised
2016-05-09 23:55:17.761 com.apple.dt.Xcode.PlaygroundStub-macosx[13138:1235656] [<MDLScatteringFunction 0x7ff4b3c51160> valueForUndefinedKey:]: this class is not key value coding-compliant for the key sdefSupport_name.
2016-05-09 23:55:17.761 com.apple.dt.Xcode.PlaygroundStub-macosx[13138:1235656] (
	0   CoreFoundation                      0x00007fff9b19a4f2 __exceptionPreprocess + 178
	1   libobjc.A.dylib                     0x00007fff89919f7e objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff9b19a439 -[NSException raise] + 9
	3   Foundation                          0x00007fff8933c5e3 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 226
	4   Foundation                          0x00007fff89216307 -[NSObject(NSKeyValueCoding) valueForKey:] + 414
	5   Foundation                          0x00007fff8935dbcb -[NSObject(NSScripting) scriptingProperties] + 355
	6   Foundation                          0x00007fff89216307 -[NSObject(NSKeyValueCoding) valueForKey:] + 414
	7   ModelIO                             0x00007fff8865d58b _ZN7ModelIO18trianglesInSubmeshEP7MDLMeshP10MDLSubmesh + 27884
	8   ModelIO                             0x00007fff8865d868 _ZN7ModelIO18trianglesInSubmeshEP7MDLMeshP10MDLSubmesh + 28617
	9   ???                                 0x000000011108d1ea 0x0 + 4580757994
	10  ???                                 0x000000011108d125 0x0 + 4580757797
	11  ???                                 0x000000010cffd90e 0x0 + 4513061134
	12  com.apple.dt.Xcode.PlaygroundStub-macosx 0x000000010c62cb30 main + 0
	13  com.apple.dt.Xcode.PlaygroundStub-macosx 0x000000010c62cc59 _TToZFC25PlaygroundStub_macosx_XPC14PlaygroundStub7executefT_T_ + 25
	14  CoreFoundation                      0x00007fff9b10ba6c __invoking___ + 140
	15  CoreFoundation                      0x00007fff9b10b8fe -[NSInvocation invoke] + 286
	16  CoreFoundation                      0x00007fff9b126d56 -[NSInvocation invokeWithTarget:] + 54
	17  ViewBridge                          0x00007fff8a557e33 -[NSVB_ViewServiceImplicitAnimationDecodingProxy forwardInvocation:] + 264
	18  CoreFoundation                      0x00007fff9b10a382 ___forwarding___ + 514
	19  CoreFoundation                      0x00007fff9b10a0f8 _CF_forwarding_prep_0 + 120
	20  CoreFoundation                      0x00007fff9b10ba6c __invoking___ + 140
	21  CoreFoundation                      0x00007fff9b10b8fe -[NSInvocation invoke] + 286
	22  CoreFoundation                      0x00007fff9b126d56 -[NSInvocation invokeWithTarget:] + 54
	23  ViewBridge                          0x00007fff8a5288c6 -[NSVB_QueueingProxy forwardInvocation:] + 323
	24  CoreFoundation                      0x00007fff9b10a382 ___forwarding___ + 514
	25  CoreFoundation                      0x00007fff9b10a0f8 _CF_forwarding_prep_0 + 120
	26  CoreFoundation                      0x00007fff9b10ba6c __invoking___ + 140
	27  CoreFoundation                      0x00007fff9b10b8fe -[NSInvocation invoke] + 286
	28  CoreFoundation                      0x00007fff9b126d56 -[NSInvocation invokeWithTarget:] + 54
	29  CoreFoundation                      0x00007fff9b10a382 ___forwarding___ + 514
	30  CoreFoundation                      0x00007fff9b10a0f8 _CF_forwarding_prep_0 + 120
	31  CoreFoundation                      0x00007fff9b10ba6c __invoking___ + 140
	32  CoreFoundation                      0x00007fff9b10b8fe -[NSInvocation invoke] + 286
	33  CoreFoundation                      0x00007fff9b126d56 -[NSInvocation invokeWithTarget:] + 54
	34  CoreFoundation                      0x00007fff9b10a382 ___forwarding___ + 514
	35  CoreFoundation                      0x00007fff9b10a0f8 _CF_forwarding_prep_0 + 120
	36  CoreFoundation                      0x00007fff9b10ba6c __invoking___ + 140
	37  CoreFoundation                      0x00007fff9b10b8fe -[NSInvocation invoke] + 286
	38  ViewBridge                          0x00007fff8a56730b withHintInProgress + 501
	39  ViewBridge                          0x00007fff8a567091 __deferNSXPCInvocationOntoMainThread_block_invoke_2 + 220
	40  ViewBridge                          0x00007fff8a505b4f +[NSViewServiceApplication withHostPID:invoke:] + 46
	41  ViewBridge                          0x00007fff8a566f5f __deferNSXPCInvocationOntoMainThread_block_invoke + 129
	42  ViewBridge                          0x00007fff8a566b6a __deferBlockOntoMainThread_block_invoke_2 + 448
	43  CoreFoundation                      0x00007fff9b12f4ac __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
	44  CoreFoundation                      0x00007fff9b10ed05 __CFRunLoopDoBlocks + 341
	45  CoreFoundation                      0x00007fff9b10ea6b __CFRunLoopRun + 2347
	46  CoreFoundation                      0x00007fff9b10ded8 CFRunLoopRunSpecific + 296
	47  HIToolbox                           0x00007fff9cb8d935 RunCurrentEventLoopInMode + 235
	48  HIToolbox                           0x00007fff9cb8d76f ReceiveNextEventCommon + 432
	49  HIToolbox                           0x00007fff9cb8d5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
	50  AppKit                              0x00007fff95c56efa _DPSNextEvent + 1067
	51  AppKit                              0x00007fff95c5632a -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
	52  ViewBridge                          0x00007fff8a506b21 -[NSViewServiceApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 73
	53  AppKit                              0x00007fff95c4ae84 -[NSApplication run] + 682
	54  AppKit                              0x00007fff95c1446c NSApplicationMain + 1176
	55  libxpc.dylib                        0x00007fff9d2b545e _xpc_objc_main + 793
	56  libxpc.dylib                        0x00007fff9d2b3e8a xpc_main + 494
	57  ViewBridge                          0x00007fff8a52c683 xpc_connection_handler + 0
	58  ViewBridge                          0x00007fff8a50a9d9 NSViewServiceApplicationMain + 2818
	59  com.apple.dt.Xcode.PlaygroundStub-macosx 0x000000010c62cb8e main + 94
	60  libdyld.dylib                       0x00007fff99a765ad start + 1
)


Regression:
Unknown

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!