I think thats a bug in ffi-coremidi, where it is not properly handling a NULL returned from CFStringGetCStringPtr() (see https://stackoverflow.com/a/9166500/186057).
e.g. It should have been doing:
name_ptr = FFI::MemoryPointer.new(:pointer)
Map::MIDIObjectGetStringProperty(@resource, prop, name_ptr)
name = name_ptr.read_pointer
len = Map::CF.CFStringGetMaximumSizeForEncoding(Map::CF.CFStringGetLength(name), :kCFStringEncodingUTF8)
bytes = FFI::MemoryPointer.new(len + 1)
raise RuntimeError.new("CFStringGetCString") unless Map::CF.CFStringGetCString(name, bytes, len, :kCFStringEncodingUTF8)
@name = bytes.read_string
If you want to apply the fix yourself, apply https://github.com/arirusso/ffi-coremidi/pull/2 and rebuild the ffi-coremidi gem.