Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 835376 - www-apps/gitea segfaults when built with dev-lang/go-1.18
Summary: www-apps/gitea segfaults when built with dev-lang/go-1.18
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: go-1.18-bugs
  Show dependency tree
 
Reported: 2022-03-15 22:40 UTC by jon R-B
Modified: 2022-03-25 19:25 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jon R-B 2022-03-15 22:40:17 UTC
when rebuilding gitea (1.16.3) against golang-1.18, the application builds but segfaults when launching 


 su git
sh-5.1$ gitea
2022/03/15 22:34:04 cmd/web.go:102:runWeb() [I] Starting Gitea on PID: 19427
2022/03/15 22:34:04 cmd/web.go:150:runWeb() [I] Global init
2022/03/15 22:34:04 routers/init.go:106:GlobalInitInstalled() [I] Git Version: 2.35.1, Wire Protocol Version 2 Enabled
2022/03/15 22:34:04 routers/init.go:109:GlobalInitInstalled() [I] AppPath: /usr/bin/gitea
2022/03/15 22:34:04 routers/init.go:110:GlobalInitInstalled() [I] AppWorkPath: /var/lib/gitea
2022/03/15 22:34:04 routers/init.go:111:GlobalInitInstalled() [I] Custom path: /var/lib/gitea/custom
2022/03/15 22:34:04 routers/init.go:112:GlobalInitInstalled() [I] Log path: /var/lib/gitea/log
2022/03/15 22:34:04 routers/init.go:113:GlobalInitInstalled() [I] Configuration file: /etc/gitea/app.ini
2022/03/15 22:34:04 routers/init.go:114:GlobalInitInstalled() [I] Run Mode: Prod
unexpected fault address 0x0
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x3106b1f]

goroutine 1 [running]:
runtime.throw({0x7eb99e?, 0xd0?})
	/usr/lib/go/src/runtime/panic.go:992 +0x71 fp=0xc000640df0 sp=0xc000640dc0 pc=0x30d6551
runtime.sigpanic()
	/usr/lib/go/src/runtime/signal_unix.go:825 +0x305 fp=0xc000640e40 sp=0xc000640df0 pc=0x30ec925
aeshashbody()
	/usr/lib/go/src/runtime/asm_amd64.s:1343 +0x39f fp=0xc000640e48 sp=0xc000640e40 pc=0x3106b1f
runtime.mapiternext(0xc00277c3c0)
	/usr/lib/go/src/runtime/map.go:934 +0x2cb fp=0xc000640eb8 sp=0xc000640e48 pc=0x30b008b
runtime.mapiterinit(0xc000640f50?, 0x30ad8a5?, 0xc002818490?)
	/usr/lib/go/src/runtime/map.go:861 +0x228 fp=0xc000640ed8 sp=0xc000640eb8 pc=0x30afd68
reflect.mapiterinit(0x30af67d?, 0x422f20?, 0xc002d989d8?)
	/usr/lib/go/src/runtime/map.go:1373 +0x19 fp=0xc000640f00 sp=0xc000640ed8 pc=0x3103299
github.com/modern-go/reflect2.(*UnsafeMapType).UnsafeIterate(...)
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/modern-go/reflect2/unsafe_map.go:112
github.com/json-iterator/go.(*sortKeysMapEncoder).Encode(0xc0043c6060, 0xc0007c7610, 0xc00005ec00)
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/json-iterator/go/reflect_map.go:291 +0x225 fp=0xc000641070 sp=0xc000640f00 pc=0x32966e5
github.com/json-iterator/go.(*onePtrEncoder).Encode(0xc0007f3910, 0xc003455e60, 0xc00277c3c0?)
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/json-iterator/go/reflect.go:219 +0x82 fp=0xc0006410a8 sp=0xc000641070 pc=0x328e9e2
github.com/json-iterator/go.(*Stream).WriteVal(0xc00005ec00, {0x463e40, 0xc003455e60})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/json-iterator/go/reflect.go:98 +0x158 fp=0xc000641118 sp=0xc0006410a8 pc=0x328dcf8
github.com/json-iterator/go.(*frozenConfig).Marshal(0xc0000d6280, {0x463e40, 0xc003455e60})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/json-iterator/go/config.go:299 +0xc9 fp=0xc0006411b0 sp=0xc000641118 pc=0x3284e29
code.gitea.io/gitea/modules/json.JSONiter.Marshal({{0x1af6198?, 0xc0000d6280?}}, {0x463e40?, 0xc003455e60?})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/json/json.go:78 +0x37 fp=0xc0006411d8 sp=0xc0006411b0 pc=0x32af7f7
code.gitea.io/gitea/modules/json.(*JSONiter).Marshal(0x463e40?, {0x463e40?, 0xc003455e60?})
	<autogenerated>:1 +0x45 fp=0xc000641208 sp=0xc0006411d8 pc=0x32b06e5
code.gitea.io/gitea/modules/json.Marshal(...)
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/json/json.go:103
code.gitea.io/gitea/modules/setting.generateLogConfig(0x30b3519?, {0xc002819351, 0x4}, {{0x7eb101, 0x5}, {0x82eb8f, 0x8}, {0xc0036e7640, 0x1c}, 0x2710, ...})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/setting/log.go:205 +0x1469 fp=0xc000641378 sp=0xc000641208 pc=0x3533dc9
code.gitea.io/gitea/modules/setting.newLogService()
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/setting/log.go:323 +0x6b5 fp=0xc000641568 sp=0xc000641378 pc=0x3535455
code.gitea.io/gitea/modules/setting.NewLogServices(0x0?)
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/setting/log.go:349 +0x1d fp=0xc000641588 sp=0xc000641568 pc=0x353589d
code.gitea.io/gitea/modules/setting.NewServices()
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/setting/setting.go:1224 +0x31 fp=0xc0006415a0 sp=0xc000641588 pc=0x3545211
code.gitea.io/gitea/routers.InitGitServices()
	/var/tmp/portage/www-apps/gitea-1.16.3/work/routers/init.go:74 +0x19 fp=0xc0006415b8 sp=0xc0006415a0 pc=0x4c2e459
code.gitea.io/gitea/routers.GlobalInitInstalled({0x1ae7578, 0xc00022fd40})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/routers/init.go:119 +0x385 fp=0xc0006416a0 sp=0xc0006415b8 pc=0x4c2ea85
code.gitea.io/gitea/cmd.runWeb(0xc0002446e0)
	/var/tmp/portage/www-apps/gitea-1.16.3/work/cmd/web.go:153 +0x811 fp=0xc000641780 sp=0xc0006416a0 pc=0x4d09771
github.com/urfave/cli.HandleAction({0x3cd300?, 0x15d77d0?}, 0xc00025e000?)
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/urfave/cli/app.go:524 +0xa8 fp=0xc000641798 sp=0xc000641780 pc=0x46d8088
github.com/urfave/cli.(*App).Run(0xc00025e000, {0xc00003c220, 0x1, 0x1})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/urfave/cli/app.go:286 +0x7c5 fp=0xc000641d70 sp=0xc000641798 pc=0x46d5605
main.main()
	/var/tmp/portage/www-apps/gitea-1.16.3/work/main.go:115 +0xcf9 fp=0xc000641f80 sp=0xc000641d70 pc=0x4d3f919
runtime.main()
	/usr/lib/go/src/runtime/proc.go:250 +0x212 fp=0xc000641fe0 sp=0xc000641f80 pc=0x30d8c72
runtime.goexit()
	/usr/lib/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc000641fe8 sp=0xc000641fe0 pc=0x3109721

goroutine 7 [select]:
code.gitea.io/gitea/modules/log.(*MultiChannelledLog).Start(0xc00019a100)
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/log/event.go:300 +0x26c
created by code.gitea.io/gitea/modules/log.(*MultiChannelledLog).AddLogger
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/log/event.go:190 +0x176

goroutine 13 [select]:
github.com/blevesearch/bleve_index_api.AnalysisWorker({0xc00275d8c0?, 0xc00275d920?})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/blevesearch/bleve_index_api/analysis.go:46 +0x8f
created by github.com/blevesearch/bleve_index_api.NewAnalysisQueue
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/blevesearch/bleve_index_api/analysis.go:38 +0x92

goroutine 14 [select]:
github.com/blevesearch/bleve_index_api.AnalysisWorker({0xc00275d8c0?, 0xc00275d920?})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/blevesearch/bleve_index_api/analysis.go:46 +0x8f
created by github.com/blevesearch/bleve_index_api.NewAnalysisQueue
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/blevesearch/bleve_index_api/analysis.go:38 +0x92

goroutine 15 [select]:
github.com/blevesearch/bleve_index_api.AnalysisWorker({0xc00275d8c0?, 0xc00275d920?})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/blevesearch/bleve_index_api/analysis.go:46 +0x8f
created by github.com/blevesearch/bleve_index_api.NewAnalysisQueue
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/blevesearch/bleve_index_api/analysis.go:38 +0x92

goroutine 16 [select]:
github.com/blevesearch/bleve_index_api.AnalysisWorker({0xc00275d8c0?, 0xc00275d920?})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/blevesearch/bleve_index_api/analysis.go:46 +0x8f
created by github.com/blevesearch/bleve_index_api.NewAnalysisQueue
	/var/tmp/portage/www-apps/gitea-1.16.3/work/vendor/github.com/blevesearch/bleve_index_api/analysis.go:38 +0x92

goroutine 21 [select]:
code.gitea.io/gitea/modules/graceful.(*Manager).handleSignals(0xc00005f320?, {0x1ae7578, 0xc00022fc80})
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/graceful/manager_unix.go:118 +0x1c6
created by code.gitea.io/gitea/modules/graceful.(*Manager).start
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/graceful/manager_unix.go:65 +0x19a

goroutine 22 [semacquire]:
sync.runtime_Semacquire(0x0?)
	/usr/lib/go/src/runtime/sema.go:56 +0x25
sync.(*WaitGroup).Wait(0x0?)
	/usr/lib/go/src/sync/waitgroup.go:136 +0x52
code.gitea.io/gitea/modules/graceful.(*Manager).start.func1()
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/graceful/manager_unix.go:73 +0x65
created by code.gitea.io/gitea/modules/graceful.(*Manager).start
	/var/tmp/portage/www-apps/gitea-1.16.3/work/modules/graceful/manager_unix.go:69 +0x205

goroutine 53 [syscall]:
os/signal.signal_recv()
	/usr/lib/go/src/runtime/sigqueue.go:151 +0x2f
os/signal.loop()
	/usr/lib/go/src/os/signal/signal_unix.go:23 +0x19
created by os/signal.Notify.func1.1
	/usr/lib/go/src/os/signal/signal.go:151 +0x2a

Reproducible: Always

Steps to Reproduce:
1. build gitea with golang-1.18
2. launch gitea 
3.
Comment 1 jon R-B 2022-03-15 22:42:37 UTC
https://github.com/go-gitea/gitea/pull/19099

this is a backport of the golang-1.18 changes
Comment 2 jon R-B 2022-03-15 23:22:42 UTC
the correct patch to be applied: https://github.com/go-gitea/gitea/pull/19100
Comment 3 Holger Hoffstätte 2022-03-16 18:10:14 UTC
The patch unfortunately doesn't help right away as it changes a dependency, all of which are vendored into the upstream tarball. So a fix would have to re-vendor everything as well.
Comment 4 Holger Hoffstätte 2022-03-24 08:10:59 UTC
Fixed in 1.16.5, which also has security fixes.
Comment 5 Larry the Git Cow gentoo-dev 2022-03-25 19:25:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99b860baf770849dc16cb7e2b58d346144f129d7

commit 99b860baf770849dc16cb7e2b58d346144f129d7
Author:     Tomáš Mózes <hydrapolic@gmail.com>
AuthorDate: 2022-03-25 07:23:58 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-03-25 19:25:35 +0000

    www-apps/gitea: security bump to 1.16.5
    
    Bug: https://bugs.gentoo.org/835932
    Closes: https://bugs.gentoo.org/835376
    Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 www-apps/gitea/Manifest            |   1 +
 www-apps/gitea/gitea-1.16.5.ebuild | 107 +++++++++++++++++++++++++++++++++++++
 2 files changed, 108 insertions(+)