Skip to content

Crash while using SSH transport #1700

@tiennou

Description

@tiennou

While investigating fetching remotes in Objective-Git, I got a crash (stack trace at the end of the issue).

It seems the stack trace is wrong, because using the debugger I can step inside _git_ssh_setup_conn until t->owner->cred_acquire_cb, and here the crash happens. I imagine that's because I didn't provide a callback through git_remote_set_cred_acquire_cb but I'm not sure...

libgit2: v0.16.0-3099-gc8a39f9

* thread #1: tid = 0x1d07, 0x0000000000000000, stop reason = step over
    frame #0: 0x0000000000000000
    frame #1: 0x000000010021c07f ObjectiveGit`ssh_uploadpack_ls(t=0x00000001129538b0, url=0x000000011293ee50, stream=0x00007fff5fbfdde0) + 47 at ssh.c:405
    frame #2: 0x000000010021bedb ObjectiveGit`_ssh_action(stream=0x00007fff5fbfdde0, subtransport=0x00000001129538b0, url=0x000000011293ee50, action=GIT_SERVICE_UPLOADPACK_LS) + 91 at ssh.c:464
    frame #3: 0x0000000100217453 ObjectiveGit`git_smart__connect(transport=0x0000000102172200, url=0x00000001130423b0, cred_acquire_cb=0x0000000000000000, cred_acquire_payload=0x0000000000000000, direction=0, flags=0) + 323 at smart.c:96
    frame #4: 0x00000001001eeac1 ObjectiveGit`git_remote_connect(remote=0x00000001130423f0, direction=GIT_DIRECTION_FETCH) + 353 at remote.c:549
    frame #5: 0x0000000100243bf7 ObjectiveGit`-[GTRemote fetchWithError:](self=0x0000000113036aa0, _cmd=0x000000010007b3c2, error=0x00007fff5fbfe008) + 343 at GTRemote.m:118
    frame #6: 0x00000001000414d3 GitX`-[PBGitRepository beginFetchFromRemoteForRef:](self=0x0000000109d04d40, _cmd=0x0000000100077d51, ref=0x0000000112e83ae0) + 1411 at PBGitRepository.m:652
    frame #7: 0x0000000100022104 GitX`-[PBRefController fetchRemote:](self=0x000000011112ba60, _cmd=0x0000000100079953, sender=0x000000011302a6a0) + 212 at PBRefController.m:40
    frame #8: 0x00007fff8fe98959 AppKit`-[NSApplication sendAction:to:from:] + 342
    frame #9: 0x00007fff8ffce36c AppKit`-[NSMenuItem _corePerformAction] + 406
    frame #10: 0x00007fff8ffce05a AppKit`-[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 133
    frame #11: 0x00007fff8fcbb20f AppKit`-[NSMenu _internalPerformActionForItemAtIndex:] + 36
    frame #12: 0x00007fff8fcbb097 AppKit`-[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 135
    frame #13: 0x00007fff8ffc7165 AppKit`NSSLMMenuEventHandler + 342
    frame #14: 0x00007fff8d97dd1a HIToolbox`DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1206
    frame #15: 0x00007fff8d97d1e9 HIToolbox`SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 410
    frame #16: 0x00007fff8d992fc9 HIToolbox`SendEventToEventTarget + 40
    frame #17: 0x00007fff8d9c9ca9 HIToolbox`SendHICommandEvent(unsigned int, HICommand const*, unsigned int, unsigned int, unsigned char, void const*, OpaqueEventTargetRef*, OpaqueEventTargetRef*, OpaqueEventRef**) + 443
    frame #18: 0x00007fff8d96ea21 HIToolbox`SendMenuCommandWithContextAndModifiers + 59
    frame #19: 0x00007fff8d96e9d3 HIToolbox`SendMenuItemSelectedEvent + 254
    frame #20: 0x00007fff8d96e85f HIToolbox`FinishMenuSelection(SelectionData*, MenuResult*, MenuResult*) + 94
    frame #21: 0x00007fff8dae4e79 HIToolbox`PopUpMenuSelectCore(MenuData*, Point, double, Point, unsigned short, unsigned int, Rect const*, unsigned short, unsigned int, Rect const*, Rect const*, __CFString const*, OpaqueMenuRef**, unsigned short*) + 1673
    frame #22: 0x00007fff8dae4794 HIToolbox`_HandlePopUpMenuSelection7 + 629
    frame #23: 0x00007fff9004a56b AppKit`_NSSLMPopUpCarbonMenu3 + 3916
    frame #24: 0x00007fff900495f8 AppKit`-[NSCarbonMenuImpl _popUpContextMenu:withEvent:forView:withFont:] + 189
    frame #25: 0x00007fff901a3ff3 AppKit`-[NSMenu _popUpContextMenu:withEvent:forView:withFont:] + 200
    frame #26: 0x00007fff90369937 AppKit`-[NSView rightMouseDown:] + 130
    frame #27: 0x00007fff90098cfb AppKit`-[NSControl _rightMouseUpOrDown:] + 534
    frame #28: 0x00007fff8fe8db81 AppKit`-[NSWindow sendEvent:] + 8504
    frame #29: 0x00007fff8fe89644 AppKit`-[NSApplication sendEvent:] + 5761
    frame #30: 0x00007fff8fd9f21a AppKit`-[NSApplication run] + 636
    frame #31: 0x00007fff8fd43bd6 AppKit`NSApplicationMain + 869
    frame #32: 0x0000000100054d5b GitX`main(argc=3, argv=0x00007fff5fbff848) + 43 at main.m:15
    frame #33: 0x0000000100001984 GitX`start + 52

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