Skip to content

Panic when trying git lfs clean #944

Closed

Description

@dennisroche

When executing git lfs clean on local repository that has downloaded the large files.

Windows 8.1
Git for Windows git version 2.6.2.windows.1

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x4b9309]

goroutine 1 [running]:
github.com/github/git-lfs/commands.requireStdin(0x99e120, 0x34)
        C:/Users/techn/go/src/github.com/github/git-lfs/commands/commands.go:105 +0x49
github.com/github/git-lfs/commands.cleanCommand(0xb65d40, 0xb91620, 0x0, 0x0)
        C:/Users/techn/go/src/github.com/github/git-lfs/commands/command_clean.go:18 +0x71
github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra.(*Command).execute(0xb65d40, 0xb91620, 0x0, 0x0, 0x0, 0x0)
        C:/Users/techn/go/src/github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra/command.go:477 +0x40a
github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra.(*Command).Execute(0xb68fa0, 0x0, 0x0)
        C:/Users/techn/go/src/github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra/command.go:551 +0x59a
github.com/github/git-lfs/commands.Run()
        C:/Users/techn/go/src/github.com/github/git-lfs/commands/commands.go:88 +0x2a
main.main()
        C:/Users/techn/go/src/github.com/github/git-lfs/git-lfs.go:34 +0x135

goroutine 5 [syscall]:
os/signal.loop()
        c:/go/src/os/signal/signal_unix.go:22 +0x1f
created by os/signal.init.1
        c:/go/src/os/signal/signal_unix.go:28 +0x3e

goroutine 8 [chan receive]:
main.main.func1(0xc082106fc0, 0xc08200def0)
        C:/Users/techn/go/src/github.com/github/git-lfs/git-lfs.go:22 +0x74
created by main.main
        C:/Users/techn/go/src/github.com/github/git-lfs/git-lfs.go:32 +0x130

Activity

  1. technoweenie commented on Jan 22, 2016

    @technoweenie
    Contributor

    Thanks for the report. Is this happening during normal git lfs operation, or are you running git lfs clean manually? It is intended to be run by the internal git filters. While this panic is a legit bug that we should fix, it shouldn't be impacting normal usage of git lfs.

    Also, what version of git lfs are you running? Run git lfs version. This will let me match up line numbers from the trace.

  2. dennisroche commented on Jan 27, 2016

    @dennisroche
    Author

    I was running git lfs clean manually when trying to troubleshoot authentication issues and wanted to reset to ref-only state.

    The git lfs version is git-lfs/1.1.0 (GitHub; windows amd64; go 1.5.1; git 258acf1)

  3. technoweenie commented on Jan 27, 2016

    @technoweenie
    Contributor

    Oh, interesting interpretation of the command :) The name clean actually refers to a filter triggered by gitattributes when a file is added. It has no relation to git clean. Thanks for the version details.

  4. dennisroche commented on Jan 27, 2016

    @dennisroche
    Author
    * git lfs clean:
        Git clean filter that converts large files to pointers.
    

    Ah. It sounded like what I wanted to do, which was reset the large files back to pointers. I mentally skipped over the filter part of the help text as didn't understand it - however it now makes sense.

    Is there another way to reset the local large files back to pointers?

  5. technoweenie commented on Jan 27, 2016

    @technoweenie
    Contributor

    I mentally skipped over the filter part of the help text as didn't understand it - however it now makes sense.

    Thanks for explaining. Your interpretation makes a lot of sense to me now. I don't think it's worth renaming the command, but I should make the description more clear.

    Is there another way to reset the local large files back to pointers?

    Can you explain why you want this? Someone just asked about it recently in #951. I'm not opposed, just trying to understand why you want it.

  6. technoweenie commented on Feb 5, 2016

    @technoweenie
    Contributor

    Added this to my list of features to investigate for Git LFS v1.2: #844. It's something I want, I'm just not sure when I'll get around to it.

  7. dylanfries commented on Apr 16, 2016

    @dylanfries

    Hi there, this is a bit old but I ran into this bug as well when trying to debug this issue:

    image 3

    and version number
    D:\dev\owlVR_2\Owls_v2>git lfs version
    git-lfs/1.1.2 (GitHub; windows amd64; go 1.6; git bf6a6c9)

    D:\dev\owlVR_2\Owls_v2>git lfs clean
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal 0xc0000005 code=0x0 addr=0x30 pc=0x4b9f69]
    
    goroutine 1 [running]:
    panic(0x8f67c0, 0xc082008090)
            C:/Go/src/runtime/panic.go:464 +0x3f4
    github.com/github/git-lfs/commands.requireStdin(0xa374c0, 0x34)
            C:/Users/techn/go/src/github.com/github/git-lfs/commands/commands.go:116
     +0x49
    github.com/github/git-lfs/commands.cleanCommand(0xc2b2e0, 0xc4e708, 0x0, 0x0)
            C:/Users/techn/go/src/github.com/github/git-lfs/commands/command_clean.g
    o:18 +0x75
    github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra.(*Command).execute
    (0xc2b2e0, 0xc4e708, 0x0, 0x0, 0x0, 0x0)
            C:/Users/techn/go/src/github.com/github/git-lfs/vendor/_nuts/github.com/
    spf13/cobra/command.go:477 +0x3fb
    github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra.(*Command).Execute
    (0xc2e540, 0x0, 0x0)
            C:/Users/techn/go/src/github.com/github/git-lfs/vendor/_nuts/github.com/
    spf13/cobra/command.go:551 +0x593
    github.com/github/git-lfs/commands.Run()
            C:/Users/techn/go/src/github.com/github/git-lfs/commands/commands.go:99
    +0x2a
    main.main()
            C:/Users/techn/go/src/github.com/github/git-lfs/git-lfs.go:34 +0x135
    :\dev\owlVR_2\Owls_v2>git lfs cleanpanic: runtime error: invalid memory address or nil pointer dereference[signal 0xc0000005 code=0x0 addr=0x30 pc=0x4b9f69]goroutine 1 [running]:panic(0x8f67c0, 0xc082008090)        C:/Go/src/runtime/panic.go:464 +0x3f4github.com/github/git-lfs/commands.requireStdin(0xa374c0, 0x34)        C:/Users/techn/go/src/github.com/github/git-lfs/commands/commands.go:116 +0x49github.com/github/git-lfs/commands.cleanCommand(0xc2b2e0, 0xc4e708, 0x0, 0x0)        C:/Users/techn/go/src/github.com/github/git-lfs/commands/command_clean.go:18 +0x75github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra.(*Command).execute(0xc2b2e0, 0xc4e708, 0x0, 0x0, 0x0, 0x0)        C:/Users/techn/go/src/github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra/command.go:477 +0x3fbgithub.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra.(*Command).Execute(0xc2e540, 0x0, 0x0)        C:/Users/techn/go/src/github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra/command.go:551 +0x593github.com/github/git-lfs/commands.Run()        C:/Users/techn/go/src/github.com/github/git-lfs/commands/commands.go:99+0x2amain.main()        C:/Users/techn/go/src/github.com/github/git-lfs/git-lfs.go:34 +0x135
    

    Any insight would be appreciated ! Thanks!

    Dylan

  8. technoweenie commented on Apr 16, 2016

    @technoweenie
    Contributor

    The popup says that the "git-lfs" command does not exist. Check that it's installed properly, and that your native git tool has access to it. Specifically, it seems like your system path is missing something, or your git tool has a different environment. Please open a new issue with details, and we'll try to help the best we can.

    The second error is totally unrelated. The git lfs clean command is not designed to be run by users, and must be called a very specific way by internal git filters. While it IS a bug we need to look at, I don't think it has anything to do with the first problem in the app popup window.

    Can you run git lfs version so I can match the line numbers in the backtrace up with the correct code?

  9. dylanfries commented on Apr 21, 2016

    @dylanfries

    I copied the git-lfs.exe into the same folder as git.exe and this issue was resolved. It seems to be git not being able to find the lfs executable. Thanks for taking the time to respond !

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

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