{"action":"created","issue":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/3193","labels_url":"https://api.github.com/repos/libgit2/libgit2/issues/3193/labels{/name}","comments_url":"https://api.github.com/repos/libgit2/libgit2/issues/3193/comments","events_url":"https://api.github.com/repos/libgit2/libgit2/issues/3193/events","html_url":"https://github.com/libgit2/libgit2/issues/3193","id":86284470,"number":3193,"title":"Crash in pack_entry_find_offset() > git_oid__hashcmp()","user":{"login":"swisspol","id":627915,"avatar_url":"https://avatars.githubusercontent.com/u/627915?v=3","gravatar_id":"","url":"https://api.github.com/users/swisspol","html_url":"https://github.com/swisspol","followers_url":"https://api.github.com/users/swisspol/followers","following_url":"https://api.github.com/users/swisspol/following{/other_user}","gists_url":"https://api.github.com/users/swisspol/gists{/gist_id}","starred_url":"https://api.github.com/users/swisspol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swisspol/subscriptions","organizations_url":"https://api.github.com/users/swisspol/orgs","repos_url":"https://api.github.com/users/swisspol/repos","events_url":"https://api.github.com/users/swisspol/events{/privacy}","received_events_url":"https://api.github.com/users/swisspol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-08T18:34:20Z","updated_at":"2015-10-22T17:11:55Z","closed_at":null,"body":"From the field, no idea how to repro, but could it be that `pack_entry_find_offset()` is passing \"garbage\" to `sha1_position()`?\r\n\r\n```\r\nThread : Crashed: com.apple.main-thread\r\nEXC_BAD_ACCESS UNKNOWN at 0x0000000101b1b074\r\n\r\n0  GitUp                          0x00000001001668c4 git_oid__hashcmp (oid.h:28)\r\n1  GitUp                          0x000000010016683b sha1_position (sha1_lookup.c:237)\r\n2  GitUp                          0x000000010013eabf pack_entry_find_offset (pack.c:1306)\r\n3  GitUp                          0x000000010013fb4c git_pack_entry_find (pack.c:1373)\r\n4  GitUp                          0x0000000100135a57 pack_entry_find_inner (odb_pack.c:247)\r\n5  GitUp                          0x0000000100135963 pack_entry_find (odb_pack.c:264)\r\n6  GitUp                          0x0000000100135d84 pack_backend__read_internal (odb_pack.c:389)\r\n7  GitUp                          0x0000000100134ef5 pack_backend__read (odb_pack.c:406)\r\n8  GitUp                          0x0000000100130204 git_odb_read (odb.c:808)\r\n9  GitUp                          0x000000010012d4a3 git_object_lookup_prefix (object.c:166)\r\n10 GitUp                          0x000000010012d649 git_object_lookup (object.c:201)\r\n11 GitUp                          0x0000000100012bfe __110-[GCRepository(GCHistory) _reloadHistory:usingSnapshot:referencesDidChange:addedCommits:removedCommits:error:]_block_invoke (GCHistory.m:777)\r\n12 GitUp                          0x0000000100019cd1 -[GCRepository(GCReference_Private) enumerateReferencesWithOptions:error:usingBlock:] (GCReference.m:111)\r\n13 GitUp                          0x0000000100010b42 -[GCRepository(GCHistory) _reloadHistory:usingSnapshot:referencesDidChange:addedCommits:removedCommits:error:] (GCHistory.m:884)\r\n14 GitUp                          0x00000001000135c7 -[GCRepository(GCHistory) loadHistoryUsingSorting:error:] (GCHistory.m:1191)\r\n15 GitUp                          0x000000010009485f -[GCLiveRepository initWithRepository:error:] (GCLiveRepository.m:204)\r\n16 GitUp                          0x0000000100047402 -[GCRepository initWithExistingLocalRepository:error:] (GCRepository.m:82)\r\n17 GitUp                          0x0000000100099c69 -[Document readFromURL:ofType:error:] (Document.m:200)\r\n18 AppKit                         0x00007fff8ce88bf5 -[NSDocument _initWithContentsOfURL:ofType:error:] + 171\r\n19 AppKit                         0x00007fff8ce88ad5 -[NSDocument initWithContentsOfURL:ofType:error:] + 230\r\n20 AppKit                         0x00007fff8d00b358 -[NSDocumentController makeDocumentWithContentsOfURL:ofType:error:] + 627\r\n21 AppKit                         0x00007fff8d2429f9 __97-[NSDocumentController makeDocumentWithContentsOfURL:alternateContents:ofType:completionHandler:]_block_invoke + 85\r\n22 AppKit                         0x00007fff8d242997 -[NSDocumentController makeDocumentWithContentsOfURL:alternateContents:ofType:completionHandler:] + 225\r\n23 AppKit                         0x00007fff8d00a34e __80-[NSDocumentController openDocumentWithContentsOfURL:display:completionHandler:]_block_invoke_2 + 552\r\n24 AppKit                         0x00007fff8d00aa03 -[NSDocumentController _openDocumentWithContentsOfURL:usingProcedure:] + 570\r\n25 AppKit                         0x00007fff8d00a0fa __80-[NSDocumentController openDocumentWithContentsOfURL:display:completionHandler:]_block_invoke + 495\r\n26 AppKit                         0x00007fff8d241ad6 __144-[NSDocumentController _coordinateReadingAndGetAlternateContentsForOpeningDocumentAtURL:resolvingSymlinks:thenContinueOnMainThreadWithAccessor:]_block_invoke_2885 + 183\r\n27 AppKit                         0x00007fff8d241a12 __144-[NSDocumentController _coordinateReadingAndGetAlternateContentsForOpeningDocumentAtURL:resolvingSymlinks:thenContinueOnMainThreadWithAccessor:]_block_invoke884 + 215\r\n28 AppKit                         0x00007fff8d241864 __144-[NSDocumentController _coordinateReadingAndGetAlternateContentsForOpeningDocumentAtURL:resolvingSymlinks:thenContinueOnMainThreadWithAccessor:]_block_invoke_2 + 372\r\n29 CoreFoundation                 0x00007fff86ed78ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12\r\n30 CoreFoundation                 0x00007fff86ec99f5 __CFRunLoopDoBlocks + 341\r\n31 CoreFoundation                 0x00007fff86ec91ae __CFRunLoopRun + 910\r\n32 CoreFoundation                 0x00007fff86ec8bd8 CFRunLoopRunSpecific + 296\r\n33 HIToolbox                      0x00007fff8f28456f RunCurrentEventLoopInMode + 235\r\n34 HIToolbox                      0x00007fff8f2841ee ReceiveNextEventCommon + 179\r\n35 HIToolbox                      0x00007fff8f28412b _BlockUntilNextEventMatchingListInModeWithFilter + 71\r\n36 AppKit                         0x00007fff8cd5598b _DPSNextEvent + 978\r\n37 AppKit                         0x00007fff8cd54f38 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346\r\n38 AppKit                         0x00007fff8cd4abd3 -[NSApplication run] + 594\r\n39 AppKit                         0x00007fff8ccc7324 NSApplicationMain + 1832\r\n40 libdyld.dylib                  0x00007fff9594d5c9 start + 1\r\n```"},"comment":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/comments/150293863","html_url":"https://github.com/libgit2/libgit2/issues/3193#issuecomment-150293863","issue_url":"https://api.github.com/repos/libgit2/libgit2/issues/3193","id":150293863,"user":{"login":"swisspol","id":627915,"avatar_url":"https://avatars.githubusercontent.com/u/627915?v=3","gravatar_id":"","url":"https://api.github.com/users/swisspol","html_url":"https://github.com/swisspol","followers_url":"https://api.github.com/users/swisspol/followers","following_url":"https://api.github.com/users/swisspol/following{/other_user}","gists_url":"https://api.github.com/users/swisspol/gists{/gist_id}","starred_url":"https://api.github.com/users/swisspol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swisspol/subscriptions","organizations_url":"https://api.github.com/users/swisspol/orgs","repos_url":"https://api.github.com/users/swisspol/repos","events_url":"https://api.github.com/users/swisspol/events{/privacy}","received_events_url":"https://api.github.com/users/swisspol/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T17:11:55Z","updated_at":"2015-10-22T17:11:55Z","body":"Yes it is still happening in the wild. I wasn't able to reproduce on my computer unfortunately. I reached out to several affected users but none was able to provide a reproducible case."}}