johnno1962 / GitDiff

Highlights deltas against git repo in Xcode
MIT License
891 stars 54 forks source link

Problem if a project does not use Git #10

Closed InerziaSoft closed 9 years ago

InerziaSoft commented 9 years ago

Very useful plugin! It works well with projects backed up with git. But sometimes I need to create a test project, without using Git and sometimes (not always) it makes Xcode to crash. Maybe a menu to disable the plugin could be useful. I enclose the trace of the crashed thread.

Thread 19 Crashed:: Dispatch queue: com.apple.root.background-priority 0 libsystem_c.dylib 0x00007fff8e70a1aa popen + 450 1 com.johnholdsworth.GitDiff 0x000000011b22e9a3 -[GitFileDiffs initWithFilepath:] + 467 (GitDiff.mm:120) 2 com.johnholdsworth.GitDiff 0x000000011b22e751 __36+[GitFileDiffs asyncUpdateFilepath:]_block_invoke + 65 (GitDiff.mm:109) 3 libdispatch.dylib 0x00007fff86e4e1bb _dispatch_call_block_and_release + 12 4 libdispatch.dylib 0x00007fff86e4b28d _dispatch_client_callout + 8 5 libdispatch.dylib 0x00007fff86e4d082 _dispatch_root_queue_drain + 326 6 libdispatch.dylib 0x00007fff86e4e177 _dispatch_worker_thread2 + 40 7 libsystem_pthread.dylib 0x00007fff8950bef8 _pthread_wqthread + 314 8 libsystem_pthread.dylib 0x00007fff8950efb9 start_wqthread + 13

Thread 19 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0xd000000000000000 rcx: 0x00007fdaf9315000 rdx: 0x0000000000000004 rdi: 0x000000012e665538 rsi: 0x0000000000000036 rbp: 0x000000012e6655a0 rsp: 0x000000012e665520 r8: 0x00007fdaf3c31e00 r9: 0x0000000000000010 r10: 0x0000000000002000 r11: 0x00000000ca2aff89 r12: 0x00007fdaf51ae170 r13: 0x000000012e665538 r14: 0x000000011b24ac3d r15: 0x00007fff76c56500 rip: 0x00007fff8e70a1aa rfl: 0x0000000000010286 cr2: 0x000000012e664884

Logical CPU: 0 Error Code: 0x00000000 Trap Number: 13

johnno1962 commented 9 years ago

Hi, Trap 13 is our old friend SIGPIPE which is where you write to a dead process. Not sure how this is happening but I've put some code in to protect against it. Can you test the change please as I wasn't able to replicate the problem.

InerziaSoft commented 9 years ago

It seems the bug is went away (I'm saying "seems" because I rarely use a project without a git backup, so I have not heavily tested it!). Thanks!