PerfectlySoft / Perfect-MySQL

A stand-alone Swift wrapper around the MySQL client library, enabling access to MySQL servers.
https://www.perfect.org
Apache License 2.0
128 stars 61 forks source link

Infinite loop when calling connect() #1

Closed mgreiner closed 8 years ago

mgreiner commented 8 years ago

When using the MySQL connector, PerfectServer goes into an infinite loop when attempting to call the connect() method.

Back trace:

    etc…

    frame #261617: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261618: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261619: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261620: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261621: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261622: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261623: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261624: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261625: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261626: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261627: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261628: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261629: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261630: 0x0000000104801555 MySQL`static UnsafeMutablePointer.alloc(num=10) -> UnsafeMutablePointer<A> + 21 at MySQL.swift:30
    frame #261631: 0x00000001048036b1 MySQL`static MySQL.(p=0x0000000101407840, ret=0x00007fff5fbfc338) -> (UnsafeMutablePointer<Int8>, Int)).(closure #1) + 145 at MySQL.swift:243
    frame #261632: 0x00000001048038c3 MySQL`thunk + 35 at MySQL.swift:0
    frame #261633: 0x00000001048039a9 MySQL`partial apply for thunk + 89 at MySQL.swift:0
    frame #261634: 0x0000000100b14a23 libswiftCore.dylib`partial apply forwarder for Swift.String.(withCString <A> ((Swift.UnsafePointer<Swift.Int8>) throws -> A) throws -> A).(closure #1) + 67
    frame #261635: 0x00000001009f28b1 libswiftCore.dylib`Swift.ContiguousArray.withUnsafeBufferPointer <A> ((Swift.UnsafeBufferPointer<A>) throws -> A1) throws -> A1 + 145
    frame #261636: 0x0000000100a462ae libswiftCore.dylib`Swift.String.withCString <A> ((Swift.UnsafePointer<Swift.Int8>) throws -> A) throws -> A + 142
    frame #261637: 0x0000000104803558 MySQL`static MySQL.convertString(s="127.0.0.1", self=0x0000000104abd240) -> (UnsafeMutablePointer<Int8>, Int) + 456 at MySQL.swift:250
    frame #261638: 0x0000000104803e39 MySQL`MySQL.connect(host="127.0.0.1", user="root", password="4EYmZL9rcXzE2j9J", db=nil, port=0, socket=nil, flag=0, self=(ptr = 0x0000000104002a00)) -> Bool + 617 at MySQL.swift:267
    frame #261639: 0x0000000100f9be05 HelloPerfectServer`PerfectServerModuleInit() -> () + 1141 at PerfectHandlers.swift:35
    frame #261640: 0x000000010059bd22 PerfectLib`DynamicLoader.(realPath="./PerfectLibraries/HelloPerfectServer.framework/Versions/Current/HelloPerfectServer", moduleName="HelloPerfectServer", self=(initFuncName = "PerfectServerModuleInit"))(String, moduleName : String) -> Bool + 5730 at DynamicLoader.swift:72
    frame #261641: 0x000000010059a629 PerfectLib`DynamicLoader.loadFramework(atPath="./PerfectLibraries//HelloPerfectServer.framework/", self=(initFuncName = "PerfectServerModuleInit")) -> Bool + 633 at DynamicLoader.swift:45
    frame #261642: 0x000000010059482c PerfectLib`specialized PerfectServer.(name="HelloPerfectServer.framework/", baseDir=(internalPath = "./PerfectLibraries/"), dl=(initFuncName = "PerfectServerModuleInit")) -> ()).(closure #1) + 716 at PerfectServer.swift:52
    frame #261643: 0x0000000100594fec PerfectLib`_TPA__TTSf2n_i_n___TFFV10PerfectLib13PerfectServer18initializeServicesFT_T_U_FSST_ + 156 at PerfectServer.swift:0
    frame #261644: 0x00000001005ff2a4 PerfectLib`Dir.forEachEntry(closure=0x0000000100594f50 PerfectLib`_TPA__TTSf2n_i_n___TFFV10PerfectLib13PerfectServer18initializeServicesFT_T_U_FSST_ at PerfectServer.swift, self=(internalPath = "./PerfectLibraries/"), $error=ErrorProtocol @ 0x00007fff5fbfec90) -> ()) throws -> () + 48132 at Dir.swift:144
    frame #261645: 0x00000001005944d2 PerfectLib`PerfectServer.initializeServices() -> () + 1298 at PerfectServer.swift:65
    frame #261646: 0x000000010021089f perfectserverhttp`startServer($error=ErrorProtocol @ 0x00007fff5fbff608) throws -> () + 3951 at main_http.swift:86
    frame #261647: 0x0000000100213e87 perfectserverhttp`main + 87 at main.swift:21
    frame #261648: 0x00007fff817f65ad libdyld.dylib`start + 1
    frame #261649: 0x00007fff817f65ad libdyld.dylib`start + 1
mgreiner commented 8 years ago

Fixed by cfa625ae20dda3b4cb5c138fe62d86e00c4a84b6