Skip to content

Crash while receiving response #562

Closed
@ghost

Description

AsyncHTTPClient crashes (unwrapping nil value) while receiving an HTTP response :

Received signal 4. Backtrace:
0x55b95e5da9c2, Backtrace.(printBacktrace in _B82A8C0ED7C904841114FDF244F9E58E)(signal: Swift.Int32) -> () at /build/.build/checkouts/swift-backtrace/Sources/Backtrace/Backtrace.swift:66
0x7fc3469ec3bf
0x55b95e4b802a, Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value at /build/.build/checkouts/async-http-client/Sources/AsyncHTTPClient/RequestBag+StateMachine.swift:0
0x55b95e4b802a, generic specialization <NIOCore.ByteBuffer> of NIOCore.CircularBuffer.removeFirst() -> A at /build/<compiler-generated>:0
0x55b95e4b802a, AsyncHTTPClient.RequestBag.StateMachine.receiveResponseBodyParts(NIOCore.CircularBuffer<NIOCore.ByteBuffer>) -> Swift.Optional<NIOCore.ByteBuffer> at /build/.build/checkouts/async-http-client/Sources/AsyncHTTPClient/RequestBag+StateMachine.swift:314
0x55b95e4bf004, AsyncHTTPClient.RequestBag.(receiveResponseBodyParts0 in _828EC98A744D86D088B343098CA6B2A6)(NIOCore.CircularBuffer<NIOCore.ByteBuffer>) -> () at /build/.build/checkouts/async-http-client/Sources/AsyncHTTPClient/RequestBag.swift:214
0x55b95e4c22b9, closure #1 () -> () in AsyncHTTPClient.RequestBag.receiveResponseBodyParts(NIOCore.CircularBuffer<NIOCore.ByteBuffer>) -> () at /build/.build/checkouts/async-http-client/Sources/AsyncHTTPClient/RequestBag.swift:422
0x55b95e4c22b9, partial apply forwarder for closure #1 () -> () in AsyncHTTPClient.RequestBag.receiveResponseBodyParts(NIOCore.CircularBuffer<NIOCore.ByteBuffer>) -> () at /build/<compiler-generated>:0
0x55b95ec75f9b, reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_guaranteed () -> (@out ()) at /build/<compiler-generated>:0
0x55b95ec75f9b, partial apply forwarder for reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_guaranteed () -> (@out ()) at /build/<compiler-generated>:0
0x55b95ec6f7f0, reabstraction thunk helper from @escaping @callee_guaranteed () -> (@out ()) to @escaping @callee_guaranteed () -> () at /build/<compiler-generated>:0
0x55b95ec6f7f0, closure #4 () -> () in NIOPosix.SelectableEventLoop.run() throws -> () at /build/.build/checkouts/swift-nio/Sources/NIOPosix/SelectableEventLoop.swift:520
0x55b95ec6f7f0, reabstraction thunk helper from @callee_guaranteed () -> (@error @owned Swift.Error) to @escaping @callee_guaranteed () -> (@out (), @error @owned Swift.Error) at /build/<compiler-generated>:0
0x55b95ec6f7f0, generic specialization <()> of NIOPosix.withAutoReleasePool<A>(() throws -> A) throws -> A at /build/.build/checkouts/swift-nio/Sources/NIOPosix/SelectableEventLoop.swift:28
0x55b95ec6f7f0, NIOPosix.SelectableEventLoop.run() throws -> () at /build/.build/checkouts/swift-nio/Sources/NIOPosix/SelectableEventLoop.swift:519
0x55b95ec5ada4, static NIOPosix.MultiThreadedEventLoopGroup.(runTheLoop in _C2B1528F4FBA68A3DBFA89DBAEBE9D4D)(thread: NIOPosix.NIOThread, parentGroup: Swift.Optional<NIOPosix.MultiThreadedEventLoopGroup>, canEventLoopBeShutdownIndividually: Swift.Bool, selectorFactory: () throws -> NIOPosix.Selector<NIOPosix.NIORegistration>, initializer: (NIOPosix.NIOThread) -> (), _: (NIOPosix.SelectableEventLoop) -> ()) -> () at /build/.build/checkouts/swift-nio/Sources/NIOPosix/MultiThreadedEventLoopGroup.swift:89
0x55b95ec5ada4, closure #1 (NIOPosix.NIOThread) -> () in static NIOPosix.MultiThreadedEventLoopGroup.(setupThreadAndEventLoop in _C2B1528F4FBA68A3DBFA89DBAEBE9D4D)(name: Swift.String, parentGroup: NIOPosix.MultiThreadedEventLoopGroup, selectorFactory: () throws -> NIOPosix.Selector<NIOPosix.NIORegistration>, initializer: (NIOPosix.NIOThread) -> ()) -> NIOPosix.SelectableEventLoop at /build/.build/checkouts/swift-nio/Sources/NIOPosix/MultiThreadedEventLoopGroup.swift:110
0x55b95ec5d8ee, partial apply forwarder for closure #1 (NIOPosix.NIOThread) -> () in static NIOPosix.MultiThreadedEventLoopGroup.(setupThreadAndEventLoop in _C2B1528F4FBA68A3DBFA89DBAEBE9D4D)(name: Swift.String, parentGroup: NIOPosix.MultiThreadedEventLoopGroup, selectorFactory: () throws -> NIOPosix.Selector<NIOPosix.NIORegistration>, initializer: (NIOPosix.NIOThread) -> ()) -> NIOPosix.SelectableEventLoop at /build/<compiler-generated>:0
0x55b95ec5dbe9, reabstraction thunk helper from @escaping @callee_guaranteed (@guaranteed NIOPosix.NIOThread) -> () to @escaping @callee_guaranteed (@in_guaranteed NIOPosix.NIOThread) -> (@out ()) at /build/<compiler-generated>:0
0x55b95ec5d90d, partial apply forwarder for reabstraction thunk helper from @escaping @callee_guaranteed (@guaranteed NIOPosix.NIOThread) -> () to @escaping @callee_guaranteed (@in_guaranteed NIOPosix.NIOThread) -> (@out ()) at /build/<compiler-generated>:0
0x55b95ec8a295, closure #1 (Swift.Optional<Swift.UnsafeMutableRawPointer>) -> Swift.Optional<Swift.UnsafeMutableRawPointer> in static NIOPosix.ThreadOpsPosix.run(handle: inout Swift.Optional<Swift.UInt>, args: NIOPosix.Box<(body: (NIOPosix.NIOThread) -> (), name: Swift.Optional<Swift.String>)>, detachThread: Swift.Bool) -> () at /build/.build/checkouts/swift-nio/Sources/NIOPosix/ThreadPosix.swift:105
0x7fc3469e0608
0x7fc345e53292
0xffffffffffffffff

I'm using version 1.9.0 (7a4dfe026f6ee0f8ad741b58df74c60af296365d).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions