-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
issue/criticalThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPtype/bug
Milestone
Description
strconv.Atoi
has different behavior:
$ GOARCH=386 go run test-int.go
2147483647 (0x80bee40,0x8c8e000)
$ GOARCH=amd64 go run test-int.go
4294967295 (0x0,0x0)
$ cat test-int.go
package main
import "strconv"
func main() {
println(strconv.Atoi("4294967295"))
}
For example, in XORM:
A user has reported that Gitea 1.17 failed with error:
...
2022/06/28 11:47:32 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds
2022/06/28 11:47:35 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #9/10...
2022/06/28 11:47:35 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #9/10 failed. Error: sync database struct error: strconv.Atoi: parsing "4294967295": value out of range
2022/06/28 11:47:35 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds
2022/06/28 11:47:38 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #10/10...
2022/06/28 11:47:38 routers/init.go:68:mustInitCtx() [F] code.gitea.io/gitea/routers/common.InitDBEngine(ctx) failed: sync database struct error: strconv.Atoi: parsing "4294967295": value out of range
Metadata
Metadata
Assignees
Labels
issue/criticalThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPtype/bug
Activity
aha-tech commentedon Jul 10, 2022
I'm having the same issue using gitea-1.17-linux-arm-6 on a Raspberry Pi 4 Model B (32-bit ARMv7)
nesc1 commentedon Jul 12, 2022
Also here same problem when executing:
it seems that CHARACTER_MAXIMUM_LENGTH with value 4294967295 creates the problem...
Now server is unusable because I can not return to previous version because I did not backup the database....
zeripath commentedon Jul 12, 2022
on 32bit systems int is most likely to be int32 rather than int64.
The problem is that xorm
*schemas.Column
uses signed int for column length and should either: a) use int64 or b) uint or even uint64 - however this is a breaking change in xorm.zeripath commentedon Jul 12, 2022
https://gitea.com/xorm/xorm/pulls/2160
update xorm.io/xorm v1.3.2-0.20220714055524-c3bce556200f (#20371) (#2…
update xorm.io/xorm v1.3.2-0.20220714055524-c3bce556200f (#20371)
wxiaoguang commentedon Jul 15, 2022
wxiaoguang commentedon Jul 15, 2022
If you have met this bug, please download latest from https://dl.gitea.io/gitea/
update xorm.io/xorm v1.3.2-0.20220714055524-c3bce556200f (go-gitea#20371