robbiehanson / CocoaHTTPServer

A small, lightweight, embeddable HTTP server for Mac OS X or iOS applications
Other
5.59k stars 1.31k forks source link

HTTPServer stop crash #198

Open xiangqinfm opened 5 years ago

xiangqinfm commented 5 years ago

it same like crash with deallock,anyone has the same crash?

Operating system: iOS 12.0.1 16A404 CPU: arm64 2 CPUs

Crash reason: EXC_BREAKPOINT / EXC_ARM_BREAKPOINT Crash address: 0x1bdae5930 Process uptime: 4802 seconds

Thread 35 (crashed) 0 libdispatch.dylib!__DISPATCH_WAIT_FOR_QUEUE + 0x1bc 1 libdispatch.dylib!_dispatch_sync_f_slow + 0x8c fp = 0x000000017071a860 lr = 0x00000001bdae54cc sp = 0x000000017071a7d0 pc = 0x00000001bdae54cc Found by: previous frame's frame pointer 2 libdispatch.dylib!_dispatch_sync_f_slow + 0x8c fp = 0x000000017071a8a0 lr = 0x00000001006d29e8 sp = 0x000000017071a870 pc = 0x00000001bdae54cc Found by: previous frame's frame pointer 3 XXX!-[HTTPServer stop:] [HTTPServer.m : 442 + 0x8] fp = 0x000000017071a8d0 lr = 0x00000001006d0ec0 sp = 0x000000017071a8b0 pc = 0x00000001006d29e8 Found by: previous frame's frame pointer 4 XXX!-[HTTPServer dealloc] [HTTPServer.m : 113 + 0xc] fp = 0x000000017071a8f0 lr = 0x00000001007dbaa0 sp = 0x000000017071a8e0 pc = 0x00000001006d0ec0 Found by: previous frame's frame pointer 5 XXX!destroy_helperblock [GCDAsyncSocket.m : 2035 + 0x4]

nicolasiJasica commented 5 years ago

me too !how can I fix it?

bdkjones commented 5 years ago

I'm getting the same crash. This started recently and I cannot reproduce it on my Mac:

Crashed Thread: 5 Dispatch queue: HTTPServer

Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Illegal instruction: 4 Termination Reason: Namespace SIGNAL, Code 0x4 Terminating Process: exc handler [291]

Application Specific Information: BUG IN CLIENT OF LIBDISPATCH: dispatch_sync called on queue already owned by current thread

[...]

Thread 5 Crashed:: Dispatch queue: HTTPServer 0 libdispatch.dylib 0x00007fff5d8f9cec __DISPATCH_WAIT_FOR_QUEUE + 392 1 libdispatch.dylib 0x00007fff5d8f98cf _dispatch_sync_f_slow + 171 2 com.incident57.CodeKit3 0x0000000101720a37 -[HTTPServer stop:] + 79 3 com.incident57.CodeKit3 0x000000010171eef0 -[HTTPServer dealloc] + 89 4 com.incident57.CodeKit3 0x0000000101736d75 -[LPHTTPServer dealloc] + 177 5 com.incident57.CodeKit3 0x000000010168e7f0 destroy_helperblock.253 + 24 6 libsystem_blocks.dylib 0x00007fff5d987bfe _Block_release + 109 7 libdispatch.dylib 0x00007fff5d8eddcf _dispatch_client_callout + 8 8 libdispatch.dylib 0x00007fff5d8f4124 _dispatch_lane_serial_drain + 618 9 libdispatch.dylib 0x00007fff5d8f4bdc _dispatch_lane_invoke + 388 10 libdispatch.dylib 0x00007fff5d8fd090 _dispatch_workloop_worker_thread + 603 11 libsystem_pthread.dylib 0x00007fff5db2e60b _pthread_wqthread + 409 12 libsystem_pthread.dylib 0x00007fff5db2e405 start_wqthread + 13

wimbledon commented 5 years ago

I have the same crash as well. It happens when device is in background.

Crashed: HTTPServer 0 libdispatch.dylib 0x239347f30 __DISPATCH_WAIT_FOR_QUEUE + 444 1 libdispatch.dylib 0x239347ad4 _dispatch_sync_f_slow + 140 2 KTVCocoaHTTPServer 0x102b0404c -[HTTPServer stop:] (HTTPServer.m:472) 3 KTVCocoaHTTPServer 0x102b02384 -[HTTPServer dealloc] (HTTPServer.m:122) 4 CocoaAsyncSocket 0x10222ddc4 destroy_helperblock.306 (GCDAsyncSocket.m:2035) 5 libsystem_blocks.dylib 0x2393f4a44 _Block_release + 152 6 libdispatch.dylib 0x2393997d4 _dispatch_client_callout + 16 7 libdispatch.dylib 0x239342320 _dispatch_lane_serial_drain$VARIANT$mp + 592 8 libdispatch.dylib 0x239342e3c _dispatch_lane_invoke$VARIANT$mp + 428 9 libdispatch.dylib 0x23934b4a8 _dispatch_workloop_worker_thread + 596 10 libsystem_pthread.dylib 0x239579114 _pthread_wqthread + 304 11 libsystem_pthread.dylib 0x23957bcd4 start_wqthread + 4

xihuang31 commented 3 years ago

Same Crash. Does anyone can fix it

bdkjones commented 3 years ago

Unfortunately this project is definitely dead. Nobody has committed anything in years. If you're able to, I'd suggest checking out one of the open source Swift HTTP server projects. If I were starting a new project today, I would not use CocoaHTTPServer. It's on my list of things to extricate from my existing projects when I have time.