SEGFAULT on Repository.LookupBlob #352

Closed
opened 2016-10-31 10:54:31 -05:00 by AaronO · 2 comments
AaronO commented 2016-10-31 10:54:31 -05:00 (Migrated from github.com)

Stacktrace

runtime stack:
runtime.throw(0xbd91e0, 0x2a)
        /usr/local/go/src/runtime/panic.go:547 +0x90
runtime.sigpanic()
        /usr/local/go/src/runtime/sigpanic_unix.go:12 +0x5a

goroutine 2654459 [syscall, locked to thread]:
runtime.cgocall(0x8881fd, 0xc823f46eb8, 0xc800000000)
        /usr/local/go/src/runtime/cgocall.go:123 +0x11b fp=0xc823f46e68 sp=0xc823f46e38
github.com/libgit2/git2go._Cfunc_git_object_lookup(0xc8202b2048, 0x7fe296dffa20, 0xc8237b0760, 0x3, 0x0)
        ??:0 +0x41 fp=0xc823f46eb8 sp=0xc823f46e68
github.com/libgit2/git2go.(*Repository).lookupType(0xc822bc2980, 0xc8237b0760, 0x3, 0x0, 0x0, 0x0)
        /go/src/github.com/libgit2/git2go/repository.go:172 +0x288 fp=0xc823f46f60 sp=0xc823f46eb8
github.com/libgit2/git2go.(*Repository).LookupBlob(0xc822bc2980, 0xc8237b0760, 0xc8237b0760, 0x0, 0x0)
        /go/src/github.com/libgit2/git2go/repository.go:203 +0x44 fp=0xc823f46fa8 sp=0xc823f46f60

Calling code

func GetBlob(repo *git.Repository, sha string) (*BlobResponse, error) {
	// Ensure SHA is OID
	oid, err := git.NewOid(sha)
	if err != nil {
		return nil, err
	}

	// Get blob
	blob, err := repo.LookupBlob(oid)
	if err != nil {
		return nil, err
	}

        // More code

        return nil, nil
}

Environment

  • go : 1.6
  • git2go : 37d3c2d9ad4c4e970cac02faec8ad184412c34e6
  • libgit2 : 97e57e8770132d61ff2c36bee2de2c7ac5c9d609
### Stacktrace ``` runtime stack: runtime.throw(0xbd91e0, 0x2a) /usr/local/go/src/runtime/panic.go:547 +0x90 runtime.sigpanic() /usr/local/go/src/runtime/sigpanic_unix.go:12 +0x5a goroutine 2654459 [syscall, locked to thread]: runtime.cgocall(0x8881fd, 0xc823f46eb8, 0xc800000000) /usr/local/go/src/runtime/cgocall.go:123 +0x11b fp=0xc823f46e68 sp=0xc823f46e38 github.com/libgit2/git2go._Cfunc_git_object_lookup(0xc8202b2048, 0x7fe296dffa20, 0xc8237b0760, 0x3, 0x0) ??:0 +0x41 fp=0xc823f46eb8 sp=0xc823f46e68 github.com/libgit2/git2go.(*Repository).lookupType(0xc822bc2980, 0xc8237b0760, 0x3, 0x0, 0x0, 0x0) /go/src/github.com/libgit2/git2go/repository.go:172 +0x288 fp=0xc823f46f60 sp=0xc823f46eb8 github.com/libgit2/git2go.(*Repository).LookupBlob(0xc822bc2980, 0xc8237b0760, 0xc8237b0760, 0x0, 0x0) /go/src/github.com/libgit2/git2go/repository.go:203 +0x44 fp=0xc823f46fa8 sp=0xc823f46f60 ``` ### Calling code ``` func GetBlob(repo *git.Repository, sha string) (*BlobResponse, error) { // Ensure SHA is OID oid, err := git.NewOid(sha) if err != nil { return nil, err } // Get blob blob, err := repo.LookupBlob(oid) if err != nil { return nil, err } // More code return nil, nil } ``` ### Environment - `go` : `1.6` - `git2go` : `37d3c2d9ad4c4e970cac02faec8ad184412c34e6` - `libgit2` : `97e57e8770132d61ff2c36bee2de2c7ac5c9d609`
carlosmn commented 2017-07-07 15:00:06 -05:00 (Migrated from github.com)

This might be another instance of #334, #373 and #356 where Go's GC is a bit too eager for the assumptions the code makes.

This might be another instance of #334, #373 and #356 where Go's GC is a bit too eager for the assumptions the code makes.
carlosmn commented 2017-07-09 14:24:50 -05:00 (Migrated from github.com)

This should be fixed via #393

This should be fixed via #393
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jcarr/git2go#352
No description provided.