Skip to content
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

Crash during apparently successful merge of pull request #4883

Closed
2 of 7 tasks
pgleghorn opened this issue Nov 22, 2017 · 13 comments
Closed
2 of 7 tasks

Crash during apparently successful merge of pull request #4883

pgleghorn opened this issue Nov 22, 2017 · 13 comments
Assignees
Labels
💊 bug Something isn't working status: needs feedback Tell me more about it status: needs reproduce Wait, how did that happen?

Comments

@pgleghorn
Copy link

pgleghorn commented Nov 22, 2017

  • Gogs version (or commit ref): 0.11.33.1119
  • Git version: 2.8.3.windows.1
  • Operating system: Gogs on Windows 2012
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gogs.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist (usually found in log/gogs.log): please see comments below

Gogs crashed during a pull request merge. After restarting it, the merge appears to have completed successfully according to the pull request info. (Have not checked the repo to verify if the merge was indeed successful).
Other trivia - The merge was between two branches in the same repo (from "tools" to "develop"), comprising 1 commit and 21 file changes. This was performed by a non-admin user. The repo has the "Ignore whitespace" flag set. This repo is a fork from another repo of the same name belonging to another user.

@pgleghorn
Copy link
Author

The last lines in gogs.log at the time of the merge and crash were

2017/11/21 10:30:50 [TRACE] Pull request merged: 28
2017/11/21 10:30:50 [TRACE] DeliverHooks [repo_id: 21]
2017/11/21 10:30:50 [TRACE] AddTestPullRequestTask [head_repo_id: 21, head_branch: develop]: finding pull requests
2017/11/21 10:30:50 [TRACE] addHeadRepoTasks[27]: composing new test task
2017/11/21 10:30:50 [TRACE] PullRequest[27].UpdatePatch: ignored cruppted data
2017/11/21 10:30:50 [TRACE] PushToBaseRepo[12]: pushing commits to base repo 'refs/pull/10/head'

@pgleghorn
Copy link
Author

At the same time this was written to console

Macaron] 2017-11-21 10:30:50: Completed POST /rajashekar/sparse-6.1/pulls/1/merge 302 Found in 1m2.
2485652s
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x10 pc=0xb726bd]

goroutine 51497 [running]:
github.com/gogits/gogs/models.(*Repository).getOwner(0x0, 0x153a9e0, 0xc0422af720, 0xc043d7a580, 0x0)
        C:/Users/Unknwon/Desktop/Applications/Luban/gopath/src/github.com/gogits/gogs/models/repo.go:324 +0x2d
github.com/gogits/gogs/models.(*Repository).mustOwner(0x0, 0x153a9e0, 0xc0422af720, 0xc042172360)
        C:/Users/Unknwon/Desktop/Applications/Luban/gopath/src/github.com/gogits/gogs/models/repo.go:337 +0x4a
github.com/gogits/gogs/models.(*Repository).repoPath(0x0, 0x153a9e0, 0xc0422af720, 0x2, 0x2)
        C:/Users/Unknwon/Desktop/Applications/Luban/gopath/src/github.com/gogits/gogs/models/repo.go:457 +0x4a
github.com/gogits/gogs/models.(*Repository).RepoPath(0x0, 0x44, 0xc0442afcb0)
        C:/Users/Unknwon/Desktop/Applications/Luban/gopath/src/github.com/gogits/gogs/models/repo.go:461 +0x4a
github.com/gogits/gogs/models.(*PullRequest).PushToBaseRepo(0xc043ee42a0, 0x0, 0x0)
        C:/Users/Unknwon/Desktop/Applications/Luban/gopath/src/github.com/gogits/gogs/models/pull.go:612 +0x14b
github.com/gogits/gogs/models.addHeadRepoTasks(0xc044ad8010, 0x1, 0x2)
        C:/Users/Unknwon/Desktop/Applications/Luban/gopath/src/github.com/gogits/gogs/models/pull.go:694 +0x16e
github.com/gogits/gogs/models.AddTestPullRequestTask(0xc043ca6800, 0x15, 0xc0443c4bd8, 0x7, 0xc0447ae400)
        C:/Users/Unknwon/Desktop/Applications/Luban/gopath/src/github.com/gogits/gogs/models/pull.go:739 +0x657
created by github.com/gogits/gogs/models.(*PullRequest).Merge.func1
        C:/Users/Unknwon/Desktop/Applications/Luban/gopath/src/github.com/gogits/gogs/models/pull.go:199 +0xca

@pgleghorn pgleghorn mentioned this issue Nov 22, 2017
7 tasks
@unknwon
Copy link
Member

unknwon commented Nov 22, 2017

Thanks for the info!

I think this log line indicated the main problem:

2017/11/21 10:30:50 [TRACE] PullRequest[27].UpdatePatch: ignored cruppted data

I'll look into it.

@unknwon unknwon added 💊 bug Something isn't working status: needs reproduce Wait, how did that happen? labels Nov 22, 2017
@unknwon unknwon self-assigned this Nov 22, 2017
@unknwon unknwon added this to the 0.12 milestone Nov 22, 2017
@unknwon unknwon changed the title Crash (invalid memory address) during apparently successful merge of pull request Crash during apparently successful merge of pull request Nov 22, 2017
@ah-edg
Copy link

ah-edg commented Nov 22, 2017

We also have a problem on pull requests with the new release.
Also on 0.11.33, but with gogs in a custom docker container based on debian jessie.
The data is stored in MySQL.

Gogs showed an 500-error on pull request merges in multiple repositories - but not from one repo to itself.
A rollback to 0.11.29 helped.

Maybe relevant: on the merge site, only the first radio button was shown. I understand it should look like this:
new merge GUI

Logs:

2017/11/21 21:24:48 [ERROR] [...g/context/context.go:171 ServerError()] Repo.GitRepo.CommitsCountBetween: exit status 128 - fatal: Invalid symme
tric difference expression 709f3ff102dd3945e8e7bb80b1d31e3f31dfdbb4...68af527862a00b0e08324a5700889cf9877fba27
2017/11/21 21:24:48 [TRACE] Template: status/500

@unknwon
Copy link
Member

unknwon commented Nov 22, 2017

@ah-edg you can follow #4890.

@unknwon
Copy link
Member

unknwon commented Mar 12, 2018

@pgleghorn Just to check... is this crash constantly appearing or seem randomly?

@unknwon unknwon added the status: needs feedback Tell me more about it label Mar 12, 2018
@unknwon unknwon removed this from the 0.12 milestone Mar 12, 2018
@unknwon unknwon closed this as completed Mar 31, 2018
@pgleghorn
Copy link
Author

Sorry didn't spot the question. This crash has only been seen once, very strange. Thanks for looking into it. If it occurs again I will try to capture more info.

@vblz
Copy link

vblz commented Jun 8, 2018

same trouble with 0.11.43.0330. This trouble reproduces every try on this PR.
The PR is in same repo.

[Macaron] 2018-06-08 08:35:25: Started POST /command/repo/pulls/12/merge for ip
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xb89006]

goroutine 512 [running]:
github.com/gogits/gogs/models.(*Repository).getOwner(0x0, 0x1778440, 0xc4201c3550, 0xc421879e60, 0x18f4820)
        /tmp/go/src/github.com/gogits/gogs/models/repo.go:328 +0x26
github.com/gogits/gogs/models.(*Repository).mustOwner(0x0, 0x1778440, 0xc4201c3550, 0xc420185b48)
        /tmp/go/src/github.com/gogits/gogs/models/repo.go:341 +0x43
github.com/gogits/gogs/models.(*Repository).repoPath(0x0, 0x1778440, 0xc4201c3550, 0x2, 0x2)
        /tmp/go/src/github.com/gogits/gogs/models/repo.go:461 +0x43
github.com/gogits/gogs/models.(*Repository).RepoPath(0x0, 0x44, 0xc421ef5d08)
        /tmp/go/src/github.com/gogits/gogs/models/repo.go:465 +0x43
github.com/gogits/gogs/models.(*PullRequest).PushToBaseRepo(0xc420185b20, 0x0, 0x0)
        /tmp/go/src/github.com/gogits/gogs/models/pull.go:644 +0x152
github.com/gogits/gogs/models.addHeadRepoTasks(0xc421a8e3f0, 0x1, 0x2)
        /tmp/go/src/github.com/gogits/gogs/models/pull.go:726 +0x165
github.com/gogits/gogs/models.AddTestPullRequestTask(0xc4202e6800, 0x2, 0xc421b3fda0, 0xc, 0xc421c32200)
        /tmp/go/src/github.com/gogits/gogs/models/pull.go:771 +0x6c1
created by github.com/gogits/gogs/models.(*PullRequest).Merge.func1
        /tmp/go/src/github.com/gogits/gogs/models/pull.go:199 +0xc3
2018/06/08 08:35:26 [TRACE] Custom path: /data/gogs
2018/06/08 08:35:26 [TRACE] Log path: /app/gogs/log
2018/06/08 08:35:26 [TRACE] Build Time: 2018-03-31 03:44:54 UTC
2018/06/08 08:35:26 [TRACE] Build Git Hash:
2018/06/08 08:35:26 [TRACE] Log Mode: File (Trace)
2018/06/08 08:35:26 [ INFO] NAME git 0.11.43.0330

@unknwon
Copy link
Member

unknwon commented Jun 9, 2018

Upgrade your Gogs..

@neoromantique
Copy link

neoromantique commented Jul 26, 2018

Version: 0.11.56.0613

2018/07/26 09:48:00 [TRACE] DeliverHooks [repo_id: 9]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xc106f6]

goroutine 7434 [running]:
github.com/gogs/gogs/models.(*Repository).getOwner(0x0, 0x1888400, 0xc42017bc70, 0xc42290ed00, 0xc420488000)
        /tmp/go/src/github.com/gogs/gogs/models/repo.go:328 +0x26
github.com/gogs/gogs/models.(*Repository).mustOwner(0x0, 0x1888400, 0xc42017bc70, 0xc422186108)
        /tmp/go/src/github.com/gogs/gogs/models/repo.go:341 +0x43
github.com/gogs/gogs/models.(*Repository).repoPath(0x0, 0x1888400, 0xc42017bc70, 0x2, 0x2)
        /tmp/go/src/github.com/gogs/gogs/models/repo.go:461 +0x43
github.com/gogs/gogs/models.(*Repository).RepoPath(0x0, 0x44, 0xc422181d08)
        /tmp/go/src/github.com/gogs/gogs/models/repo.go:465 +0x43
github.com/gogs/gogs/models.(*PullRequest).PushToBaseRepo(0xc4221860e0, 0x0, 0x0)
        /tmp/go/src/github.com/gogs/gogs/models/pull.go:638 +0x152
github.com/gogs/gogs/models.addHeadRepoTasks(0xc421f78a30, 0x1, 0x2)
        /tmp/go/src/github.com/gogs/gogs/models/pull.go:720 +0x165
github.com/gogs/gogs/models.AddTestPullRequestTask(0xc422575c00, 0x9, 0xc42246a900, 0xb, 0xc421e8c300)
        /tmp/go/src/github.com/gogs/gogs/models/pull.go:765 +0x6c1
created by github.com/gogs/gogs/models.(*PullRequest).Merge.func1
        /tmp/go/src/github.com/gogs/gogs/models/pull.go:199 +0xc3```

@kylebarron
Copy link

Version 0.11.66

This happened on two separate occasions for two separate users of the system. On both occasions, restarting Gogs and attempting the PR again succeeded.

This issue should probably be reopened.

Stdout:

[Macaron] 2018-10-30 15:12:51: Started GET /daltonm/medicare-documentation/commit/e4cfb62a6a93e0f0033999dd42a0d254b3d74661 for 10.200.10.2
[Macaron] 2018-10-30 15:12:52: Completed GET /daltonm/medicare-documentation/commit/e4cfb62a6a93e0f0033999dd42a0d254b3d74661 200 OK in 387.942988ms
[Macaron] 2018-10-30 15:12:55: Started GET /daltonm/medicare-documentation/commit/e91a16ec5c07634704e16068d7637851e6eeb3ad for 10.200.10.2
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x88d4ec]

goroutine 6078 [running]:
github.com/gogs/gogs/vendor/github.com/gogs/git-module.ParsePatch(0xc4223d4f00, 0x3e8, 0x1f4, 0x64, 0x1109de0, 0xc4220989e0, 0xc4223d4d80)
        /home/vagrant/gopath/src/github.com/gogs/gogs/vendor/github.com/gogs/git-module/repo_diff.go:178 +0x2fc
github.com/gogs/gogs/vendor/github.com/gogs/git-module.GetDiffRange.func1(0xc4223d4f00, 0x3e8, 0x1f4, 0x64, 0xc4220989e0, 0xc4220989f0)
        /home/vagrant/gopath/src/github.com/gogs/gogs/vendor/github.com/gogs/git-module/repo_diff.go:336 +0x63
created by github.com/gogs/gogs/vendor/github.com/gogs/git-module.GetDiffRange
        /home/vagrant/gopath/src/github.com/gogs/gogs/vendor/github.com/gogs/git-module/repo_diff.go:335 +0x322

Log (without CSRF token lines):

2018/10/30 15:12:36 [TRACE] Template: repo/pulls/compare
2018/10/30 15:12:39 [TRACE] Session ID: 998fc15e7021affa
2018/10/30 15:12:39 [TRACE] Template: repo/pulls/compare
2018/10/30 15:12:51 [TRACE] Session ID: 998fc15e7021affa
2018/10/30 15:12:52 [TRACE] Template: repo/diff/page
2018/10/30 15:12:55 [TRACE] Session ID: 998fc15e7021affa
2018/10/30 15:14:17 [TRACE] Log Mode: File (Trace)

@unknwon
Copy link
Member

unknwon commented Oct 30, 2018

@kylebarron please file a new issue with your report, I did a quick look and yours is different cause.

@kylebarron
Copy link

kylebarron commented Oct 30, 2018

@unknwon I did and closed it because it seemed on the second read that this was the same issue: #5486. I reopened that issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💊 bug Something isn't working status: needs feedback Tell me more about it status: needs reproduce Wait, how did that happen?
Projects
None yet
Development

No branches or pull requests

6 participants