Skip to content

Added check for _lastHEADBranch to be not NSNull. #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from

Conversation

tgunr
Copy link

@tgunr tgunr commented Jul 28, 2016

When cloning from remote URL _lastHEADBranch gets set to a NSNull which
later would cause crash as conditional would fall thru and fail on
the comparison.

When cloning from remote URL _lastHEADBranch gets set to a NSNull which
later would cause crash as conditional would fall thru and fail on
the comparison.
@tgunr
Copy link
Author

tgunr commented Jul 28, 2016

Encountered this on first use of cloning from remote URL.

@swisspol swisspol added the bug label Jul 28, 2016
@swisspol
Copy link
Contributor

What was the crash exactly? I don't think this fix is right since the code checks for _lastHEADBranch being NSNull later.

@tgunr
Copy link
Author

tgunr commented Jul 28, 2016

After opening app for first time and selecting a remote URL, the app crashed because the conditional fell thru and the test

if (![headBranch isEqualToBranch:_lastHEADBranch]) {

Crashed because _lastHEADBranch was a NSNull

First time thru _lastHEADBranch is nil then the later code sets it to NSNull, Adding the additional test caused the problem to go away.

On Jul 28, 2016, at 9:56 AM, Pierre-Olivier Latour notifications@github.com wrote:

What was the crash exactly? I don't think this fix is right since the code checks for _lastHEADBranch being NSNull later.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #182 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAEIjPN8xRjB_sn2q7LKhKT6Az--oGnOks5qaQmKgaJpZM4JXiSZ.

@swisspol
Copy link
Contributor

That's working around the crash, but I'd like to know its exact cause since nobody reported it before. That's the only way to make sure the fix is the right one.

For instance if not executing this code at all anymore if NSNull then this test later never happens:

if ((headBranch != [NSNull null]) && (_lastHEADBranch != [NSNull null]))

If you can share more details (is it reproducible?) and a backtrace that'd be great, thanks.

@tgunr
Copy link
Author

tgunr commented Jul 28, 2016

As I said, entering remote URL to clone, _lastHEADBranch first time thru = 0, after the clone is fetched the second time in _lastHEADBranch Is a NSNull in frame 3

  • thread command line completion for gitup command #1: tid = 0x8c5666, 0x000000010014eaf5 libclang_rt.asan_osx_dynamic.dylibwrap_strcmp + 85, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x50) frame #0: 0x000000010014eaf5 libclang_rt.asan_osx_dynamic.dylibwrap_strcmp + 85
    • frame command line completion for gitup command #1: 0x000000010178de01 GitUpKit-[GCReference compareWithReference:](self=0x0000606000820ca0, _cmd="compareWithReference:", reference=0x0000000000000014) + 113 at GCReference.m:52 frame #2: 0x000000010178e420 GitUpKit-[GCReference(self=0x0000606000820ca0, _cmd="isEqualToReference:", reference=0x0000000104968e20) isEqualToReference:] + 576 at GCReference.m:68
      frame Faster graph rendering for repositories with huge amount of branches. #3: 0x00000001016c1428 GitUpKit-[GCBranch(self=0x0000606000820ca0, _cmd="isEqualToBranch:", branch=0x0000000104968e20) isEqualToBranch:] + 424 at GCBranch.m:54 frame #4: 0x000000010005732d GitUp-[Document mapViewControllerDidReloadGraph:](self=0x0000618000de0480, _cmd="mapViewControllerDidReloadGraph:", controller=0x000061200083dac0) + 1357 at Document.m:1513
      frame Fix spelling mistake in README #5: 0x00000001019c79c4 GitUpKit-[GIMapViewController _reloadMap:](self=0x000061200083dac0, _cmd="_reloadMap:", force=NO) + 3636 at GIMapViewController.m:155 frame #6: 0x00000001019c6b20 GitUpKit-[GIMapViewController repositoryHistoryDidUpdate](self=0x000061200083dac0, _cmd="repositoryHistoryDidUpdate") + 240 at GIMapViewController.m:120
      frame Faster git-clone due to depth=1 (not for developers) #7: 0x000000010443996c CoreFoundation__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12 frame #8: 0x000000010443986b CoreFoundation_CFXRegistrationPost + 427
      frame Update URL for "Release Notes" menu item #9: 0x00000001044395d2 CoreFoundation**_CFXNotificationPost_block_invoke + 50 frame #10: 0x00000001043f7992 CoreFoundation-[_CFXNotificationRegistrar find:object:observer:enumerator:] + 2018
      frame Add Objective-C generic types to collections in headers #11: 0x00000001043f697b CoreFoundation_CFXNotificationPost + 667 frame #12: 0x0000000102176c03 Foundation-[NSNotificationCenter postNotificationName:object:userInfo:] + 66
      frame Animated transition in/out of Quick View #13: 0x000000010176a7af GitUpKit-[GCLiveRepository _updateHistory](self=0x00006120007e97c0, _cmd="_updateHistory") + 2559 at GCLiveRepository.m:427 frame #14: 0x0000000101769d3d GitUpKit-[GCLiveRepository resumeHistoryUpdates](self=0x00006120007e97c0, _cmd="resumeHistoryUpdates") + 669 at GCLiveRepository.m:405
      frame Include both commit messages in squash #15: 0x000000010002d6b2 GitUp__47-[Document _performCloneUsingRemote:recursive:]_block_invoke.356(.block_descriptor=<unavailable>, success=YES, error=0x0000000000000000) + 530 at Document.m:449 frame #16: 0x000000010177c33d GitUpKit__104-[GCLiveRepository performOperationInBackgroundWithReason:argument:usingOperationBlock:completionBlock:]_block_invoke_2(.block_descriptor=) + 3885 at GCLiveRepository.m:886
      frame Display both author and committer dates in Quick View #17: 0x0000000100188d14 libclang_rt.asan_osx_dynamic.dylib__wrap_dispatch_async_block_invoke + 260 frame #18: 0x0000000106890cad libdispatch.dylib_dispatch_call_block_and_release + 12
      frame Allow switching to Map/Commit/Stashes directly from Quick View #19: 0x000000010688743c libdispatch.dylib_dispatch_client_callout + 8 frame #20: 0x000000010689614f libdispatch.dylib_dispatch_main_queue_callback_4CF + 362
      frame New branch titles #21: 0x00000001044621a9 CoreFoundation__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE** + 9 frame #22: 0x000000010442468d CoreFoundation__CFRunLoopRun + 2221
      frame New branch titles #23: 0x0000000104423b84 CoreFoundationCFRunLoopRunSpecific + 420 frame #24: 0x000000010b4b4a3c HIToolboxRunCurrentEventLoopInMode + 240
      frame Safer remote operations #25: 0x000000010b4b4871 HIToolboxReceiveNextEventCommon + 432 frame #26: 0x000000010b4b46a6 HIToolbox_BlockUntilNextEventMatchingListInModeWithFilter + 71
      frame Add 30% horizontal space between branch lines #27: 0x0000000102db1dcd AppKit_DPSNextEvent + 1093 frame #28: 0x00000001034bebbc AppKit-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1658
      frame Added support for Vim keystrokes while navigating commits. #29: 0x0000000102da673c AppKit-[NSApplication run] + 926 frame #30: 0x0000000102d71cda AppKitNSApplicationMain + 1237
      frame In commit view, list tracked files first, and untracked files last #31: 0x0000000100003362 GitUpmain(argc=1, argv=0x00007fff5fbff758) + 34 at main.m:19 frame #32: 0x0000000106900255 libdyld.dylibstart + 1
      frame Set a specific environment variable on hooks executed from GitUp #33: 0x0000000106900255 libdyld.dylib`start + 1

@swisspol
Copy link
Contributor

Looks like you're pushing a bunch of commits to that branch as part of your experiments. I have to close this PR to stop Travis from building it.

@swisspol swisspol closed this Jul 29, 2016
@tgunr
Copy link
Author

tgunr commented Jul 30, 2016

It was not pushing at all, its was cloning from the remote repo.

On Jul 29, 2016, at 8:41 AM, Pierre-Olivier Latour notifications@github.com wrote:

Looks like you're pushing a bunch of commits to that branch as part of your experiments. I have to close this PR to stop Travis from building it.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #182 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAEIjLANU-K623zoKMakMMl3uJbmCnt-ks5qaklrgaJpZM4JXiSZ.

@swisspol
Copy link
Contributor

This appears related to #185.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants