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

Panic #28

Closed
jony4 opened this issue Oct 27, 2022 · 6 comments
Closed

Panic #28

jony4 opened this issue Oct 27, 2022 · 6 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@jony4
Copy link

jony4 commented Oct 27, 2022

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x63 pc=0x7f6fa803a298]

runtime stack:
runtime.throw({0x10e5520?, 0x7f6f60000d53?})
	/usr/local/go/src/runtime/panic.go:992 +0x71
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:802 +0x389

goroutine 15 [syscall]:
runtime.cgocall(0xd45130, 0xc000071598)
	/usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc000071570 sp=0xc000071538 pc=0x405a9c
net._C2func_getaddrinfo(0xc0002ead90, 0x0, 0xc001bae660, 0xc0000103e8)
	_cgo_gotypes.go:94 +0x56 fp=0xc000071598 sp=0xc000071570 pc=0x5da936
net.cgoLookupIPCNAME.func1({0xc0002ead90, 0x0?, 0x0?}, 0xc0005a4bee?, 0x5e107b?)
	/usr/local/go/src/net/cgo_unix.go:160 +0x9f fp=0xc0000715f0 sp=0xc000071598 pc=0x5dc65f
net.cgoLookupIPCNAME({0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x2})
	/usr/local/go/src/net/cgo_unix.go:160 +0x16d fp=0xc000071738 sp=0xc0000715f0 pc=0x5dbecd
net.cgoIPLookup(0x3656050?, {0xc0005a4bea?, 0xc0002ead88?}, {0xc0005a4bee?, 0x0?})
	/usr/local/go/src/net/cgo_unix.go:217 +0x3b fp=0xc0000717a8 sp=0xc000071738 pc=0x5dc71b
net.cgoLookupIP.func1()
	/usr/local/go/src/net/cgo_unix.go:227 +0x36 fp=0xc0000717e0 sp=0xc0000717a8 pc=0x5dcb56
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc0000717e8 sp=0xc0000717e0 pc=0x466a01
created by net.cgoLookupIP
	/usr/local/go/src/net/cgo_unix.go:227 +0x12a

goroutine 1 [chan receive]:
github.com/segmentfault/pacman.(*Application).Run(0xc000514600)
	/go/pkg/mod/github.com/segmentfault/pacman@v1.0.1/pacman.go:96 +0x111
main.runApp()
	/go/src/github.com/answerdev/answer/cmd/answer/main.go:54 +0x1ea
main.glob..func1(0x2d22940?, {0x109a91b?, 0x2?, 0x2?})
	/go/src/github.com/answerdev/answer/cmd/answer/command.go:52 +0x17
github.com/spf13/cobra.(*Command).execute(0x2d22940, {0xc00043a820, 0x2, 0x2})
	/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876 +0x67b
github.com/spf13/cobra.(*Command).ExecuteC(0x2d21cc0)
	/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
main.Execute()
	/go/src/github.com/answerdev/answer/cmd/answer/command.go:155 +0x25
main.main()
	/go/src/github.com/answerdev/answer/cmd/answer/main.go:37 +0x17

goroutine 5 [select]:
database/sql.(*DB).connectionOpener(0xc0003c5450, {0x25ef998, 0xc0003fa880})
	/usr/local/go/src/database/sql/sql.go:1226 +0x8d
created by database/sql.OpenDB
	/usr/local/go/src/database/sql/sql.go:794 +0x18d

goroutine 8 [select]:
github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1()
	/go/pkg/mod/github.com/go-sql-driver/mysql@v1.6.0/connection.go:614 +0xaa
created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher
	/go/pkg/mod/github.com/go-sql-driver/mysql@v1.6.0/connection.go:611 +0xfe

goroutine 27 [select]:
github.com/patrickmn/go-cache.(*janitor).Run(0xc000800000, 0x0?)
	/go/pkg/mod/github.com/patrickmn/go-cache@v2.1.0+incompatible/cache.go:1079 +0x85
created by github.com/patrickmn/go-cache.runJanitor
	/go/pkg/mod/github.com/patrickmn/go-cache@v2.1.0+incompatible/cache.go:1099 +0xed

goroutine 28 [chan receive]:
github.com/answerdev/answer/internal/base/data.NewCache.func1()
	/go/src/github.com/answerdev/answer/internal/base/data/data.go:78 +0x65
created by github.com/answerdev/answer/internal/base/data.NewCache
	/go/src/github.com/answerdev/answer/internal/base/data/data.go:76 +0x1ed

goroutine 66 [chan receive]:
github.com/answerdev/answer/internal/service/notification_common.(*NotificationCommon).HandleNotification.func1()
	/go/src/github.com/answerdev/answer/internal/service/notification_common/notification.go:64 +0x47
created by github.com/answerdev/answer/internal/service/notification_common.(*NotificationCommon).HandleNotification
	/go/src/github.com/answerdev/answer/internal/service/notification_common/notification.go:63 +0x56

goroutine 68 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378728, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc0011ee200?, 0xc000042a00?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Accept(0xc0011ee200)
	/usr/local/go/src/internal/poll/fd_unix.go:614 +0x22c
net.(*netFD).accept(0xc0011ee200)
	/usr/local/go/src/net/fd_unix.go:172 +0x35
net.(*TCPListener).accept(0xc0011da2d0)
	/usr/local/go/src/net/tcpsock_posix.go:139 +0x28
net.(*TCPListener).Accept(0xc0011da2d0)
	/usr/local/go/src/net/tcpsock.go:288 +0x3d
net/http.(*Server).Serve(0xc001af20e0, {0x25eef48, 0xc0011da2d0})
	/usr/local/go/src/net/http/server.go:3039 +0x385
net/http.(*Server).ListenAndServe(0xc001af20e0)
	/usr/local/go/src/net/http/server.go:2968 +0x7d
github.com/segmentfault/pacman/contrib/server/http.(*Server).Start(0x0?)
	/go/pkg/mod/github.com/segmentfault/pacman/contrib/server/http@v0.0.0-20220929065758-260b3093a347/http.go:57 +0x1d
github.com/segmentfault/pacman.(*Application).Run.func1({0x25eb820?, 0xc001ae1830?})
	/go/pkg/mod/github.com/segmentfault/pacman@v1.0.1/pacman.go:88 +0x2b
created by github.com/segmentfault/pacman.(*Application).Run
	/go/pkg/mod/github.com/segmentfault/pacman@v1.0.1/pacman.go:87 +0xbc

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

goroutine 54 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378818, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc00049c380?, 0xc0004a7000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc00049c380, {0xc0004a7000, 0x1000, 0x1000})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc00049c380, {0xc0004a7000?, 0x4cb120?, 0xc00049c380?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000010140, {0xc0004a7000?, 0xfee?, 0xc0004a7000?})
	/usr/local/go/src/net/net.go:183 +0x45
github.com/go-sql-driver/mysql.(*buffer).fill(0xc0004a5200, 0x4)
	/go/pkg/mod/github.com/go-sql-driver/mysql@v1.6.0/buffer.go:90 +0x23a
github.com/go-sql-driver/mysql.(*buffer).readNext(0xc0004a5200, 0x4)
	/go/pkg/mod/github.com/go-sql-driver/mysql@v1.6.0/buffer.go:119 +0x2d
github.com/go-sql-driver/mysql.(*mysqlConn).readPacket(0xc0004a5200)
	/go/pkg/mod/github.com/go-sql-driver/mysql@v1.6.0/packets.go:32 +0x85
github.com/go-sql-driver/mysql.(*mysqlConn).readResultSetHeaderPacket(0xc001b46378?)
	/go/pkg/mod/github.com/go-sql-driver/mysql@v1.6.0/packets.go:538 +0x25
github.com/go-sql-driver/mysql.(*mysqlStmt).query(0xc001b46378, {0xc000800490?, 0xc00013a048?, 0x0?})
	/go/pkg/mod/github.com/go-sql-driver/mysql@v1.6.0/statement.go:114 +0x125
github.com/go-sql-driver/mysql.(*mysqlStmt).QueryContext(0xc001b46378, {0x25ef9d0, 0xc00013a048}, {0xc000272a50, 0x1, 0xc001b46378?})
	/go/pkg/mod/github.com/go-sql-driver/mysql@v1.6.0/connection.go:558 +0xc8
database/sql.ctxDriverStmtQuery({0x25ef9d0, 0xc00013a048}, {0x25efca8, 0xc001b46378}, {0xc000272a50?, 0x1, 0x1})
	/usr/local/go/src/database/sql/ctxutil.go:82 +0xcc
database/sql.rowsiFromStatement({0x25ef9d0, 0xc00013a048}, {0x25ed718, 0xc0004a5200}, 0xc000690540, {0xc001b32690, 0x1, 0x1})
	/usr/local/go/src/database/sql/sql.go:2835 +0x17e
database/sql.(*DB).queryDC(0xc001b10401?, {0x25ef9d0, 0xc00013a048}, {0x0, 0x0}, 0xc000270000, 0xc001b326b0, {0xc0007a6140, 0x6a}, {0xc001b32690, ...})
	/usr/local/go/src/database/sql/sql.go:1789 +0x3d7
database/sql.(*DB).query(0xf46160?, {0x25ef9d0, 0xc00013a048}, {0xc0007a6140, 0x6a}, {0xc001b32690, 0x1, 0x1}, 0xc0?)
	/usr/local/go/src/database/sql/sql.go:1737 +0xfd
database/sql.(*DB).QueryContext(0xc0003ec060?, {0x25ef9d0, 0xc00013a048}, {0xc0007a6140, 0x6a}, {0xc001b32690, 0x1, 0x1})
	/usr/local/go/src/database/sql/sql.go:1710 +0xda
xorm.io/xorm/core.(*DB).QueryContext(0xc0003ec060, {0x25ef9d0?, 0xc00013a048}, {0xc0007a6140, 0x6a}, {0xc001b32690, 0x1, 0x1})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/core/db.go:151 +0x1f7
xorm.io/xorm.(*Session).queryRows(0xc001b48d00, {0xc0007a6140, 0x6a}, {0xc001b32690?, 0x1, 0x1})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/session_raw.go:52 +0x33a
xorm.io/xorm.(*Session).nocacheGet(0x40c2ed?, 0x7f6fa836fa58?, 0x0?, {0xc001b896d0, 0x1, 0x1}, {0xc0007a6140?, 0xc001b12900?}, {0xc001b32690, 0x1, ...})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/session_get.go:147 +0xa5
xorm.io/xorm.(*Session).get(0xc001b48d00, {0xc001b896d0?, 0x1, 0x1})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/session_get.go:120 +0xa66
xorm.io/xorm.(*Session).Get(0x101bbe0?, {0xc001b896d0?, 0xc001b12900?, 0x0?})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/session_get.go:34 +0x70
github.com/answerdev/answer/internal/repo.(*siteInfoRepo).GetByType(0xc001ab82e0, {0x0?, 0xb?}, {0x10ba681, 0x9})
	/go/src/github.com/answerdev/answer/internal/repo/siteinfo_repo.go:49 +0x107
github.com/answerdev/answer/internal/service.(*SiteInfoService).GetSiteInterface(0xc001adf920, {0x25efc70, 0xc0001b6e00})
	/go/src/github.com/answerdev/answer/internal/service/siteinfo_service.go:53 +0x63
github.com/answerdev/answer/internal/controller.(*SiteinfoController).GetInfo(0xc001ab8368, 0xf1ec00?)
	/go/src/github.com/answerdev/answer/internal/controller/siteinfo_controller.go:43 +0x1b2
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/answerdev/answer/internal/base/middleware.(*AuthUserMiddleware).Auth.func1(0xc0001b6e00)
	/go/src/github.com/answerdev/answer/internal/base/middleware/auth.go:49 +0xc6
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0004909c0, 0xc0001b6e00)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 +0x671
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0004909c0, {0x25ef128?, 0xc0000b2540}, 0xc001ac4600)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 +0x1dd
net/http.serverHandler.ServeHTTP({0xc0004a8450?}, {0x25ef128, 0xc0000b2540}, 0xc001ac4600)
	/usr/local/go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc001b16000, {0x25efa40, 0xc0002729f0})
	/usr/local/go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3071 +0x4db

goroutine 55 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378548, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc001b10080?, 0xc001b36000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc001b10080, {0xc001b36000, 0x1000, 0x1000})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc001b10080, {0xc001b36000?, 0xc001b4a6e0?, 0x47d77e?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc001b14008, {0xc001b36000?, 0x88d68c?, 0xc001b30040?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).Read(0xc001b12120, {0xc001b36000, 0x1000, 0x1000})
	/usr/local/go/src/net/http/server.go:780 +0x16d
bufio.(*Reader).fill(0xc001b34000)
	/usr/local/go/src/bufio/bufio.go:106 +0x103
bufio.(*Reader).ReadSlice(0xc001b34000, 0x0?)
	/usr/local/go/src/bufio/bufio.go:371 +0x2f
bufio.(*Reader).ReadLine(0xc001b34000)
	/usr/local/go/src/bufio/bufio.go:400 +0x27
net/textproto.(*Reader).readLineSlice(0xc001ae5230)
	/usr/local/go/src/net/textproto/reader.go:57 +0x99
net/textproto.(*Reader).ReadLine(...)
	/usr/local/go/src/net/textproto/reader.go:38
net/http.readRequest(0xc001b14008?)
	/usr/local/go/src/net/http/request.go:1029 +0x79
net/http.(*conn).readRequest(0xc001b160a0, {0x25ef998, 0xc001b30000})
	/usr/local/go/src/net/http/server.go:988 +0x24a
net/http.(*conn).serve(0xc001b160a0, {0x25efa40, 0xc0002729f0})
	/usr/local/go/src/net/http/server.go:1891 +0x32b
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3071 +0x4db

goroutine 12 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378638, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc001b10000?, 0xc0004a8461?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc001b10000, {0xc0004a8461, 0x1, 0x1})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc001b10000, {0xc0004a8461?, 0xc001b30098?, 0xc000070768?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc001b14000, {0xc0004a8461?, 0xc000463130?, 0x0?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).backgroundRead(0xc0004a8450)
	/usr/local/go/src/net/http/server.go:672 +0x3f
created by net/http.(*connReader).startBackgroundRead
	/usr/local/go/src/net/http/server.go:668 +0xca

goroutine 59 [select]:
net.(*Resolver).lookupIPAddr(0x3656040, {0x25ef9d0?, 0xc00013a048}, {0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x2})
	/usr/local/go/src/net/lookup.go:325 +0x51b
net.(*Resolver).internetAddrList(0x25ef9d0?, {0x25ef9d0?, 0xc00013a048?}, {0xc0005a4bea, 0x3}, {0xc0005a4bee?, 0x7?})
	/usr/local/go/src/net/ipsock.go:288 +0x67a
net.(*Resolver).resolveAddrList(0xc00013a048?, {0x25ef9d0, 0xc00013a048}, {0x109a6d3, 0x4}, {0xc0005a4bea?, 0xc0002eaad0?}, {0xc0005a4bee, 0x7}, {0x0, ...})
	/usr/local/go/src/net/dial.go:221 +0x41b
net.(*Dialer).DialContext(0xc001b84fe8, {0x25ef9d0, 0xc00013a048}, {0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x7})
	/usr/local/go/src/net/dial.go:406 +0x448
github.com/go-sql-driver/mysql.(*connector).Connect(0xc000010118, {0x25ef9d0, 0xc00013a048})
	/go/pkg/mod/github.com/go-sql-driver/mysql@v1.6.0/connector.go:49 +0x32f
database/sql.(*DB).conn(0xc0003c5450, {0x25ef9d0, 0xc00013a048}, 0x1)
	/usr/local/go/src/database/sql/sql.go:1395 +0x782
database/sql.(*DB).query(0xf46160?, {0x25ef9d0, 0xc00013a048}, {0xc00068ef00, 0x175}, {0xc001b90cf0, 0x1, 0x1}, 0x40?)
	/usr/local/go/src/database/sql/sql.go:1732 +0x5d
database/sql.(*DB).QueryContext(0xc0003ec060?, {0x25ef9d0, 0xc00013a048}, {0xc00068ef00, 0x175}, {0xc001b90cf0, 0x1, 0x1})
	/usr/local/go/src/database/sql/sql.go:1710 +0xda
xorm.io/xorm/core.(*DB).QueryContext(0xc0003ec060, {0x25ef9d0?, 0xc00013a048}, {0xc00068ef00, 0x175}, {0xc001b90cf0, 0x1, 0x1})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/core/db.go:151 +0x1f7
xorm.io/xorm.(*Session).queryRows(0xc001ba6c30, {0xc00068ef00, 0x175}, {0xc001b90cf0?, 0x1, 0x1})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/session_raw.go:52 +0x33a
xorm.io/xorm.(*Session).nocacheGet(0x40f445?, 0x7f6fa815eec8?, 0x0?, {0xc001b857a0, 0x1, 0x1}, {0xc00068ef00?, 0xc0004a9620?}, {0xc001b90cf0, 0x1, ...})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/session_get.go:147 +0xa5
xorm.io/xorm.(*Session).get(0xc001ba6c30, {0xc001b857a0?, 0x1, 0x1})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/session_get.go:120 +0xa66
xorm.io/xorm.(*Session).Get(0x2d5aa28?, {0xc001b857a0?, 0x25e5210?, 0xc001b90910?})
	/go/pkg/mod/xorm.io/xorm@v1.3.2/session_get.go:34 +0x70
github.com/answerdev/answer/internal/repo/user.(*userRepo).GetByUserID(0xc001adf818, {0xc001b85800?, 0xaef9e5?}, {0x2d5aa28, 0x1})
	/go/src/github.com/answerdev/answer/internal/repo/user/user_repo.go:121 +0xe7
github.com/answerdev/answer/internal/service.(*UserService).GetUserStatus(0xc001abe100, {0x25efc70, 0xc0001b7100}, {0x2d5aa28, 0x1}, {0xc0000a9c21, 0x24})
	/go/src/github.com/answerdev/answer/internal/service/user_service.go:73 +0x83
github.com/answerdev/answer/internal/controller.(*UserController).GetUserStatus(0xc001ae44b0, 0xf1ec00?)
	/go/src/github.com/answerdev/answer/internal/controller/user_controller.go:96 +0x66
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/answerdev/answer/internal/base/middleware.(*AuthUserMiddleware).Auth.func1(0xc0001b7100)
	/go/src/github.com/answerdev/answer/internal/base/middleware/auth.go:49 +0xc6
github.com/gin-gonic/gin.(*Context).Next(...)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0004909c0, 0xc0001b7100)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 +0x671
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0004909c0, {0x25ef128?, 0xc0000b2620}, 0xc001ac4700)
	/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 +0x1dd
net/http.serverHandler.ServeHTTP({0xc001ae5290?}, {0x25ef128, 0xc0000b2620}, 0xc001ac4700)
	/usr/local/go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc001b161e0, {0x25efa40, 0xc0002729f0})
	/usr/local/go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3071 +0x4db

goroutine 60 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378368, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc001b10300?, 0xc001b62000?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc001b10300, {0xc001b62000, 0x1000, 0x1000})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc001b10300, {0xc001b62000?, 0xc0005446a0?, 0x894c25?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc001b14090, {0xc001b62000?, 0x0?, 0x0?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).Read(0xc001b127e0, {0xc001b62000, 0x1000, 0x1000})
	/usr/local/go/src/net/http/server.go:780 +0x16d
bufio.(*Reader).fill(0xc001b34180)
	/usr/local/go/src/bufio/bufio.go:106 +0x103
bufio.(*Reader).ReadSlice(0xc001b34180, 0x0?)
	/usr/local/go/src/bufio/bufio.go:371 +0x2f
bufio.(*Reader).ReadLine(0xc001b34180)
	/usr/local/go/src/bufio/bufio.go:400 +0x27
net/textproto.(*Reader).readLineSlice(0xc0004a84b0)
	/usr/local/go/src/net/textproto/reader.go:57 +0x99
net/textproto.(*Reader).ReadLine(...)
	/usr/local/go/src/net/textproto/reader.go:38
net/http.readRequest(0xc001b14090?)
	/usr/local/go/src/net/http/request.go:1029 +0x79
net/http.(*conn).readRequest(0xc001b16280, {0x25ef998, 0xc001b30240})
	/usr/local/go/src/net/http/server.go:988 +0x24a
net/http.(*conn).serve(0xc001b16280, {0x25efa40, 0xc0002729f0})
	/usr/local/go/src/net/http/server.go:1891 +0x32b
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3071 +0x4db

goroutine 13 [IO wait]:
internal/poll.runtime_pollWait(0x7f6fa8378458, 0x72)
	/usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc001b10280?, 0xc001ae52a1?, 0x0)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc001b10280, {0xc001ae52a1, 0x1, 0x1})
	/usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc001b10280, {0xc001ae52a1?, 0x0?, 0x0?})
	/usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc001b14088, {0xc001ae52a1?, 0x0?, 0x0?})
	/usr/local/go/src/net/net.go:183 +0x45
net/http.(*connReader).backgroundRead(0xc001ae5290)
	/usr/local/go/src/net/http/server.go:672 +0x3f
created by net/http.(*connReader).startBackgroundRead
	/usr/local/go/src/net/http/server.go:668 +0xca

goroutine 14 [select]:
net.cgoLookupIP({0x25ef998, 0xc0003faf00}, {0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x2})
	/usr/local/go/src/net/cgo_unix.go:228 +0x1aa
net.(*Resolver).lookupIP(0x3656040, {0x25ef998, 0xc0003faf00}, {0xc0005a4bea, 0x3}, {0xc0005a4bee, 0x2})
	/usr/local/go/src/net/lookup_unix.go:96 +0x128
net.glob..func1({0x25ef998?, 0xc0003faf00?}, 0x0?, {0xc0005a4bea?, 0x0?}, {0xc0005a4bee?, 0x0?})
	/usr/local/go/src/net/hook.go:23 +0x3d
net.(*Resolver).lookupIPAddr.func1()
	/usr/local/go/src/net/lookup.go:319 +0x9f
internal/singleflight.(*Group).doCall(0x3656050, 0xc000463c20, {0xc0002ead88, 0x6}, 0x0?)
	/usr/local/go/src/internal/singleflight/singleflight.go:95 +0x3b
created by internal/singleflight.(*Group).DoChan
	/usr/local/go/src/internal/singleflight/singleflight.go:88 +0x2ec
@jony4
Copy link
Author

jony4 commented Oct 27, 2022

启动方式

$ mkdir answer && cd answer
$ wget https://raw.githubusercontent.com/answerdev/answer/main/docker-compose.yaml
$ docker-compose up

在点点点的过程中就 painic 了。然后强制重启,退登录。

@LinkinStars
Copy link
Member

感谢问题反馈,正在排查。如果再次出现问题,请留意触发问题的场景并反馈,万分感谢~

@mingcheng mingcheng added the bug Something isn't working label Oct 27, 2022
@LinkinStars
Copy link
Member

问题已经找到,正在修复,由于使用了 sqlite3,开启了 CGO,但 cgocall 显然在不同的机器上,即使是使用 docker,表现仍有区别。

@lurenyang418
Copy link

问题已经找到,正在修复,由于使用了 sqlite3,开启了 CGO,但 cgocall 显然在不同的机器上,即使是使用 docker,表现仍有区别。

能否使用 github.com/glebarez/go-sqlite 代替 CGO 版本的. 基于一个纯 go 实现的 sqlite3 驱动库 modernc.org/sqlite.
经过测试. L8 行引入, config.yaml 中 driver 设置为 sqlite 即可

@mingcheng
Copy link
Contributor

是的,当时也考虑过使用纯 go 实现的 sqlite 库去替代链接 CGO 编译的版本。不过目前而言我们无法保证这个类库是否能够完全替换掉目前的依赖,加上目标库的 star 数量还不够多比较担心后续的维护。所以,我们可能需要更多的测试以及支持这个想法。

@mingcheng mingcheng added the enhancement New feature or request label Oct 31, 2022
@jony4
Copy link
Author

jony4 commented Nov 5, 2022

问题已经找到,正在修复,由于使用了 sqlite3,开启了 CGO,但 cgocall 显然在不同的机器上,即使是使用 docker,表现仍有区别。

能否使用 github.com/glebarez/go-sqlite 代替 CGO 版本的. 基于一个纯 go 实现的 sqlite3 驱动库 modernc.org/sqlite. 经过测试. L8 行引入, config.yaml 中 driver 设置为 sqlite 即可

go-sqlite3 是可以的

@fenbox fenbox closed this as completed Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants