Swift 2.x - > String.fromCString

时间:2016-11-02 15:14:20

标签: swift string

我有以下Swift 2.x语法:

if let columnType = String.fromCString(sqlite3_column_decltype(pStmt, i))?.uppercased() {

我正在尝试将我的代码转换为swift 3.0。但是我不能让这个声明发挥作用。目前我有以下内容,但它给了我:“不能对'String'类型的非可选值使用可选链接”

if let columnType = String(cString: sqlite3_column_decltype(pStmt, i))?.uppercased() {

1 个答案:

答案 0 :(得分:2)

Swift 3中的

String(cString:)不返回可选:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007efbf0fb403d, pid=1623, tid=139620470982400
#
# JRE version: OpenJDK Runtime Environment (8.0_91-b14) (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
# Java VM: OpenJDK 64-Bit Server VM (25.91-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 2441 C2 org.java_websocket.drafts.Draft_10.translateSingleFrame(Ljava/nio/ByteBuffer;)Lorg/java_websocket/framing/Framedata; (563 bytes) @ 0x00007efbf0fb403d [0x00007efbf0fb3a00+0x63d]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x00007efc0024b800):  JavaThread "WebSocketWorker-12" [_thread_in_Java, id=1641, stack(0x00007efbec838000,0x00007efbec939000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000018

Registers:
RAX=0x0000000000000000, RBX=0x0000000000000005, RCX=0x0000000000000000, RDX=0x00000000838ad8a8
RSP=0x00007efbec937830, RBP=0x000000000000000c, RSI=0x0000000000000002, RDI=0x0000000000000001
R8 =0x0000000000000001, R9 =0x0000000000000008, R10=0x0000000000000003, R11=0x0000000000000003
R12=0x0000000000000000, R13=0x00000000838b7dd8, R14=0x0000000000000002, R15=0x00007efc0024b800
RIP=0x00007efbf0fb403d, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000006
  TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007efbec937830)
0x00007efbec937830:   0000000000000006 0000000000000006
0x00007efbec937840:   00000001000283b8 00000000e6881d60
0x00007efbec937850:   00000000838ad8a8 00000000836593c8
0x00007efbec937860:   00007efb00000001 00000000e6881d30
0x00007efbec937870:   00000000e6881d78 0000000000000000
0x00007efbec937880:   00007efbec9378a0 00007efc05c3a031
0x00007efbec937890:   0000000083d50c50 0000000000000005
0x00007efbec9378a0:   0000000083d50c00 0000000000000000
0x00007efbec9378b0:   000000008594d5c0 00007efbf09ea510
0x00007efbec9378c0:   00000000838ad8a8 00000000e6881d10
0x00007efbec9378d0:   000000008594d5c0 9a6d270eac77d800
0x00007efbec9378e0:   00007efbec937920 000000010007a468
0x00007efbec9378f0:   0000000000000000 0000000083655f58
0x00007efbec937900:   0000000083655f98 00007efc0024b800
0x00007efbec937910:   000000008594d5c0 00007efbf0fbc018
0x00007efbec937920:   0000000083655f48 000000008594d188
0x00007efbec937930:   00007efbefbff000 e6881c7800000001
0x00007efbec937940:   0000000000000001 00000000e6881be0
0x00007efbec937950:   00007efbec9379a0 00007efbf0b2adbc
0x00007efbec937960:   0000000083655e20 00007efbf09e3428
0x00007efbec937970:   0000000083655dc8 0000000083655f58
0x00007efbec937980:   83655f9883655f88 0000000000000000
0x00007efbec937990:   0000000083655f98 0000000083655f88
0x00007efbec9379a0:   000000010004c660 00000000e6881cf0
0x00007efbec9379b0:   0000000083655fa8 00000001e6881cf0
0x00007efbec9379c0:   0000000083785df8 00000000dbb2cdb0
0x00007efbec9379d0:   0000006f83785df8 0000000000000003
0x00007efbec9379e0:   00000000836922a0 00007efbf082c11b
0x00007efbec9379f0:   00000000838ad8d8 00007efbf09298f8
0x00007efbec937a00:   0000000083a3cdf0 0000000083655dc8
0x00007efbec937a10:   00000000838ad8a8 000000008594d188
0x00007efbec937a20:   00000001838ad8a8 00007efb00000002 

Instructions: (pc=0x00007efbf0fb403d)
0x00007efbf0fb401d:   4c 89 5c 24 18 89 0c 24 44 8b df 44 03 de 44 8b
0x00007efbf0fb402d:   d7 45 03 d6 45 8b cb 41 83 c1 05 c4 e1 f9 7e c1
0x00007efbf0fb403d:   44 89 49 18 4d 63 d2 47 0f be 54 15 14 41 83 f8
0x00007efbf0fb404d:   04 0f 83 a8 15 00 00 4c 8b 4c 24 38 41 8b 49 18 

Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x0000000000000005 is an unknown value
RCX=0x0000000000000000 is an unknown value
RDX=0x00000000838ad8a8 is an oop
java.nio.HeapByteBuffer 
 - klass: 'java/nio/HeapByteBuffer'
RSP=0x00007efbec937830 is pointing into the stack for thread: 0x00007efc0024b800
RBP=0x000000000000000c is an unknown value
RSI=0x0000000000000002 is an unknown value
RDI=0x0000000000000001 is an unknown value
R8 =0x0000000000000001 is an unknown value
R9 =0x0000000000000008 is an unknown value
R10=0x0000000000000003 is an unknown value
R11=0x0000000000000003 is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x00000000838b7dd8 is an oop
[B 
 - klass: {type array byte}
 - length: 16384
R14=0x0000000000000002 is an unknown value
R15=0x00007efc0024b800 is a thread


Stack: [0x00007efbec838000,0x00007efbec939000],  sp=0x00007efbec937830,  free space=1022k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
J 2441 C2 org.java_websocket.drafts.Draft_10.translateSingleFrame(Ljava/nio/ByteBuffer;)Lorg/java_websocket/framing/Framedata; (563 bytes) @ 0x00007efbf0fb403d [0x00007efbf0fb3a00+0x63d]
J 1881 C2 org.java_websocket.drafts.Draft_10.translateFrame(Ljava/nio/ByteBuffer;)Ljava/util/List; (295 bytes) @ 0x00007efbf09ea510 [0x00007efbf09ea420+0xf0]
J 2428 C2 org.java_websocket.WebSocketImpl.decodeFrames(Ljava/nio/ByteBuffer;)V (527 bytes) @ 0x00007efbf0fbc018 [0x00007efbf0fbbfc0+0x58]
J 2176% C2 org.java_websocket.server.WebSocketServer$WebSocketWorker.run()V (132 bytes) @ 0x00007efbf09298f8 [0x00007efbf09297a0+0x158]
v  ~StubRoutines::call_stub
V  [libjvm.so+0x65effb]
V  [libjvm.so+0x65c5e4]
V  [libjvm.so+0x65cbc7]
V  [libjvm.so+0x69fed4]
V  [libjvm.so+0xa02f03]
V  [libjvm.so+0xa033e4]
V  [libjvm.so+0x8abeb2]
C  [libpthread.so.0+0x76fa]  start_thread+0xca


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x00007efc0025f800 JavaThread "WebsocketSelector13" [_thread_blocked, id=1642, stack(0x00007efbec737000,0x00007efbec838000)]
=>0x00007efc0024b800 JavaThread "WebSocketWorker-12" [_thread_in_Java, id=1641, stack(0x00007efbec838000,0x00007efbec939000)]
  0x00007efc0024a000 JavaThread "WebSocketWorker-11" [_thread_blocked, id=1640, stack(0x00007efbec939000,0x00007efbeca3a000)]
  0x00007efc0026c800 JavaThread "WebSocketWorker-10" [_thread_blocked, id=1639, stack(0x00007efbeca3a000,0x00007efbecb3b000)]
  0x00007efc0026b800 JavaThread "WebSocketWorker-9" [_thread_blocked, id=1638, stack(0x00007efbed0d7000,0x00007efbed1d8000)]
  0x00007efc00188000 JavaThread "Service Thread" daemon [_thread_blocked, id=1636, stack(0x00007efbed2d9000,0x00007efbed3da000)]
  0x00007efc00178800 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=1635, stack(0x00007efbed3da000,0x00007efbed4db000)]
  0x00007efc00176800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=1634, stack(0x00007efbed4db000,0x00007efbed5dc000)]
  0x00007efc00173800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=1633, stack(0x00007efbed5dc000,0x00007efbed6dd000)]
  0x00007efc00171800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1632, stack(0x00007efbed6dd000,0x00007efbed7de000)]
  0x00007efc0014a800 JavaThread "Finalizer" daemon [_thread_blocked, id=1631, stack(0x00007efbedab6000,0x00007efbedbb7000)]
  0x00007efc00146000 JavaThread "Reference Handler" daemon [_thread_blocked, id=1630, stack(0x00007efbedbb7000,0x00007efbedcb8000)]
  0x00007efc00009800 JavaThread "main" [_thread_in_Java, id=1624, stack(0x00007efc06f48000,0x00007efc07049000)]

Other Threads:
  0x00007efc0013e000 VMThread [stack: 0x00007efbedcb8000,0x00007efbeddb9000] [id=1629]
  0x00007efc0018a800 WatcherThread [stack: 0x00007efbed1d8000,0x00007efbed2d9000] [id=1637]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 PSYoungGen      total 279040K, used 270133K [0x00000000d6700000, 0x00000000edb00000, 0x0000000100000000)
  eden space 277504K, 96% used [0x00000000d6700000,0x00000000e6db54f0,0x00000000e7600000)
  from space 1536K, 72% used [0x00000000ed980000,0x00000000eda98000,0x00000000edb00000)
  to   space 2048K, 0% used [0x00000000ed700000,0x00000000ed700000,0x00000000ed900000)
 ParOldGen       total 59904K, used 49900K [0x0000000083400000, 0x0000000086e80000, 0x00000000d6700000)
  object space 59904K, 83% used [0x0000000083400000,0x00000000864bb2a8,0x0000000086e80000)
 Metaspace       used 6269K, capacity 6364K, committed 6528K, reserved 1056768K
  class space    used 586K, capacity 626K, committed 640K, reserved 1048576K

Card table byte_map: [0x00007efbf0019000,0x00007efbf0400000] byte_map_base: 0x00007efbefbff000

Marking Bits: (ParMarkBitMap*) 0x00007efc06202fc0
 Begin Bits: [0x00007efbe41a0000, 0x00007efbe60d0000)
 End Bits:   [0x00007efbe60d0000, 0x00007efbe8000000)

Polling page: 0x00007efc07054000

CodeCache: size=245760Kb used=6661Kb max_used=11404Kb free=239098Kb
 bounds [0x00007efbf07c0000, 0x00007efbf1430000, 0x00007efbff7c0000]
 total_blobs=1683 nmethods=1375 adapters=223
 compilation: enabled

Compilation events (10 events):
Event: 17401.865 Thread 0x00007efc00178800 2438       3       sun.util.calendar.BaseCalendar$Date::setCache (20 bytes)
Event: 17401.865 Thread 0x00007efc00178800 nmethod 2438 0x00007efbf0986cd0 code [0x00007efbf0986e20, 0x00007efbf0986f90]
Event: 17601.644 Thread 0x00007efc00178800 2439 %     3       org.java_websocket.drafts.Draft_10::translateSingleFrame @ 429 (563 bytes)
Event: 17601.648 Thread 0x00007efc00178800 nmethod 2439% 0x00007efbf0b4c3d0 code [0x00007efbf0b4c920, 0x00007efbf0b501b8]
Event: 17601.648 Thread 0x00007efc00178800 2440       3       org.java_websocket.drafts.Draft_10::translateSingleFrame (563 bytes)
Event: 17601.652 Thread 0x00007efc00178800 nmethod 2440 0x00007efbf08f7d10 code [0x00007efbf08f8280, 0x00007efbf08fbb58]
Event: 17601.932 Thread 0x00007efc00176800 2441       4       org.java_websocket.drafts.Draft_10::translateSingleFrame (563 bytes)
Event: 17602.094 Thread 0x00007efc00176800 nmethod 2441 0x00007efbf0fb3450 code [0x00007efbf0fb3a00, 0x00007efbf0fb7178]
Event: 17895.447 Thread 0x00007efc00173800 2442       4       java.nio.channels.CancelledKeyException::<init> (5 bytes)
Event: 17895.449 Thread 0x00007efc00173800 nmethod 2442 0x00007efbf0aca790 code [0x00007efbf0aca900, 0x00007efbf0acac28]



Deoptimization events (10 events):
Event: 10716.181 Thread 0x00007efc0026b800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007efbf1162d5c method=java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer; @ 18
Event: 12016.876 Thread 0x00007efc0024b800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007efbf097016c method=java.nio.charset.CharsetDecoder.decode(Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer; @ 18
Event: 13035.470 Thread 0x00007efc0024b800 Uncommon trap: reason=speculate_class_check action=maybe_recompile pc=0x00007efbf0dee37c method=java.lang.String.valueOf(Ljava/lang/Object;)Ljava/lang/String; @ 10
Event: 13339.500 Thread 0x00007efc0024a000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007efbf09c8e8c method=java.lang.ref.SoftReference.get()Ljava/lang/Object; @ 6
Event: 13969.056 Thread 0x00007efc0026b800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007efbf0eb4d1c method=java.lang.String$CaseInsensitiveComparator.compare(Ljava/lang/String;Ljava/lang/String;)I @ 70
Event: 16392.867 Thread 0x00007efc0026b800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007efbf0c3e6a0 method=org.java_websocket.WebSocketImpl.decodeFrames(Ljava/nio/ByteBuffer;)V @ 200
Event: 16392.868 Thread 0x00007efc0026b800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007efbf097e090 method=org.java_websocket.drafts.Draft_10.fromOpcode(Lorg/java_websocket/framing/Framedata$Opcode;)B @ 31
Event: 16781.678 Thread 0x00007efc0024b800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007efbf09d7300 method=java.lang.ref.SoftReference.get()Ljava/lang/Object; @ 6
Event: 17069.184 Thread 0x00007efc0024b800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007efbf0b1a4fc method=sun.nio.ch.SocketChannelImpl.isConnected()Z @ 12
Event: 17601.643 Thread 0x00007efc0024a000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007efbf0f9a378 method=org.java_websocket.drafts.Draft_10.translateSingleFrame(Ljava/nio/ByteBuffer;)Lorg/java_websocket/framing/Framedata; @ 175

Internal exceptions (10 events):
Event: 17977.744 Thread 0x00007efc0025f800 Exception <a 'java/io/IOException'> (0x00000000d7e1cc80) thrown at [/build/openjdk-8-W1Ghxo/openjdk-8-8u91-b14/src/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 17991.612 Thread 0x00007efc0025f800 Exception <a 'java/io/IOException'> (0x00000000d971d570) thrown at [/build/openjdk-8-W1Ghxo/openjdk-8-8u91-b14/src/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 17995.224 Thread 0x00007efc0025f800 Exception <a 'java/io/IOException'> (0x00000000dc6b2498) thrown at [/build/openjdk-8-W1Ghxo/openjdk-8-8u91-b14/src/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 18019.283 Thread 0x00007efc0025f800 Exception <a 'java/io/IOException'> (0x00000000e4ae4dc8) thrown at [/build/openjdk-8-W1Ghxo/openjdk-8-8u91-b14/src/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 18032.936 Thread 0x00007efc0025f800 Exception <a 'java/io/IOException'> (0x00000000d8cb1ba8) thrown at [/build/openjdk-8-W1Ghxo/openjdk-8-8u91-b14/src/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 18042.020 Thread 0x00007efc0025f800 Exception <a 'java/io/IOException'> (0x00000000d9a26db8) thrown at [/build/openjdk-8-W1Ghxo/openjdk-8-8u91-b14/src/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 18070.523 Thread 0x00007efc0025f800 Exception <a 'java/io/IOException'> (0x00000000e0323e10) thrown at [/build/openjdk-8-W1Ghxo/openjdk-8-8u91-b14/src/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 18073.908 Thread 0x00007efc0025f800 Exception <a 'java/io/IOException'> (0x00000000e353f2f8) thrown at [/build/openjdk-8-W1Ghxo/openjdk-8-8u91-b14/src/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 18101.575 Thread 0x00007efc0025f800 Exception <a 'java/io/IOException'> (0x00000000e4746408) thrown at [/build/openjdk-8-W1Ghxo/openjdk-8-8u91-b14/src/hotspot/src/share/vm/prims/jni.cpp, line 709]
Event: 18104.877 Thread 0x00007efc0024b800 Implicit null exception at 0x00007efbf0fb403d to 0x0000000000000000

Events (10 events):
Event: 18091.999 Executing VM operation: ParallelGCFailedAllocation
Event: 18092.041 Executing VM operation: ParallelGCFailedAllocation done
Event: 18095.329 Executing VM operation: BulkRevokeBias
Event: 18095.330 Executing VM operation: BulkRevokeBias done
Event: 18095.699 Executing VM operation: ParallelGCFailedAllocation
Event: 18095.719 Executing VM operation: ParallelGCFailedAllocation done
Event: 18099.237 Executing VM operation: ParallelGCFailedAllocation
Event: 18099.256 Executing VM operation: ParallelGCFailedAllocation done
Event: 18102.131 Executing VM operation: ParallelGCFailedAllocation
Event: 18102.149 Executing VM operation: ParallelGCFailedAllocation done


            [vsyscall]

VM Arguments:
java_command: Game/GameServer.jar
java_class_path (initial): Game/GameServer.jar
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
SHELL=/bin/bash

Signal Handlers:
SIGSEGV: [libjvm.so+0xa5e970], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.so+0xa5e970], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.so+0x8a9ff0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.so+0x8a9ff0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.so+0x8a9ff0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.so+0x8a9ff0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR2: [libjvm.so+0x8a9ea0], sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: [libjvm.so+0x8aa370], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGQUIT: [libjvm.so+0x8aa370], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO


---------------  S Y S T E M  ---------------

OS:DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"

uname:Linux 4.8.1-x86_64-linode75 #1 SMP Fri Oct 7 14:21:48 EDT 2016 x86_64
libc:glibc 2.23 NPTL 2.23 
rlimit: STACK 8192k, CORE 0k, NPROC 31914, NOFILE 65536, AS infinity
load average:1.88 1.69 1.66

/proc/meminfo:
MemTotal:        8171772 kB
MemFree:         7258696 kB
MemAvailable:    7347160 kB
Buffers:           26224 kB
Cached:           168436 kB
SwapCached:            0 kB
Active:           709720 kB
Inactive:          64916 kB
Active(anon):     581380 kB
Inactive(anon):    32884 kB
Active(file):     128340 kB
Inactive(file):    32032 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:        262140 kB
SwapFree:         262140 kB
Dirty:                80 kB
Writeback:             0 kB
AnonPages:        580024 kB
Mapped:            56876 kB
Shmem:             34260 kB
Slab:              65912 kB
SReclaimable:      22484 kB
SUnreclaim:        43428 kB
KernelStack:        2832 kB
PageTables:         3640 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     4348024 kB
Committed_AS:     729096 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
DirectMap4k:       14200 kB
DirectMap2M:     2082816 kB
DirectMap1G:     8388608 kB


CPU:total 4 (1 cores per cpu, 1 threads per core) family 6 model 63 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, lzcnt, tsc, bmi1, bmi2

/proc/cpuinfo:
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 63
model name  : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
stepping    : 2
microcode   : 0x1
cpu MHz     : 2499.982
cache size  : 4096 KB
physical id : 0
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat
bugs        :
bogomips    : 5001.29
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 63
model name  : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
stepping    : 2
microcode   : 0x1
cpu MHz     : 2499.982
cache size  : 4096 KB
physical id : 1
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat
bugs        :
bogomips    : 5001.29
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 63
model name  : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
stepping    : 2
microcode   : 0x1
cpu MHz     : 2499.982
cache size  : 4096 KB
physical id : 2
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 2
initial apicid  : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat
bugs        :
bogomips    : 5001.29
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 63
model name  : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
stepping    : 2
microcode   : 0x1
cpu MHz     : 2499.982
cache size  : 4096 KB
physical id : 3
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 3
initial apicid  : 3
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat
bugs        :
bogomips    : 5001.29
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:



Memory: 4k page, physical 8171772k(7258696k free), swap 262140k(262140k free)

vm_info: OpenJDK 64-Bit Server VM (25.91-b14) for linux-amd64 JRE (1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14), built on Jul 21 2016 04:13:34 by "buildd" with gcc 5.3.1 20160413

time: Wed Nov  2 14:00:45 2016
elapsed time: 18104 seconds (0d 5h 1m 44s)

无效的UTF-8字节被Unicode替换字符替换 U + FFFD。

或使用String(validatingUTF8:)返回可选项let columnType = String(cString: sqlite3_column_decltype(pStmt, i)).uppercased() 如果输入不是有效的UTF-8序列):

nil